void BrowseFolderMenuItem::init(QString& caption) { QString fontFamily = themeManager->getValueAsFontFamilyName(QT_NT("ui.message.font.family"),QT_NT("")); int fontSize = themeManager->getValueAsInt(QT_NT("ui.message.font.size"), 14); TextOverlay* text = new TextOverlay(caption); text->getStyle().setAlpha(1.0f); text->setFont(FontDescription(fontFamily, fontSize)); text->getStyle().setBackgroundColor(ColorVal(0, 0, 0, 0)); text->getStyle().setPadding(LeftRightEdges, 0.0f); text->getStyle().setPadding(TopBottomEdges, 0.0f); this->addItem(text); }
void LibraryMenuItem::init(QSharedPointer<Library> &library) { _library = library; _closeButton = NULL; QString fontFamily = themeManager->getValueAsFontFamilyName(QT_NT("ui.message.font.family"),QT_NT("")); int fontSize = themeManager->getValueAsInt(QT_NT("ui.message.font.size"), 14); TextOverlay* text = new TextOverlay(_library->getName()); text->getStyle().setAlpha(1.0f); text->setFont(FontDescription(fontFamily, fontSize)); text->getStyle().setBackgroundColor(ColorVal(0, 0, 0, 0)); text->getStyle().setPadding(LeftRightEdges, 0.0f); text->getStyle().setPadding(TopBottomEdges, 0.0f); float height = (float)text->getTextBuffer().getActualSize().height(); ImageOverlay* icon = new ImageOverlay(_library->getIconTextureKey()); icon->getStyle().setScaledDimensions(Vec3(height, height, 0.0f)); this->addItem(icon); this->addItem(text); }
void ColorChart::mouseReleaseEvent(QMouseEvent *m) { drawMark(m->x(), m->y()); emit ColorVal(m->x() * 359 / width(), m->y() * 255 / height(), true); }