QmlDesigner: Make use of mode for zoom icons

Add mode disabled to the zoom all button in FormEditor widget

Task-number: QDS-2558
Change-Id: Ie0da97cca5ea4c2411e21fc3cbea202397e02097
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2020-07-13 17:20:25 +02:00
committed by Henning Gründl
parent f726b0d90b
commit 520c70bd8c

View File

@@ -147,19 +147,31 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) :
// Zoom actions // Zoom actions
const QString fontName = "qtds_propertyIconFont.ttf"; const QString fontName = "qtds_propertyIconFont.ttf";
QColor buttonColor(Theme::getColor(Theme::QmlDesigner_TabLight)); const QColor textColorNormal(Theme::getColor(Theme::MenuItemTextColorNormal));
const QColor textColorDisabled(Theme::getColor(Theme::MenuBarItemTextColorDisabled));
const QIcon zoomAllIcon = Utils::StyleHelper::getIconFromIconFont(fontName, const QIcon zoomAllIcon = Utils::StyleHelper::getIconFromIconFont(fontName,
Theme::getIconUnicode(Theme::Icon::zoomAll), Theme::getIconUnicode(Theme::Icon::zoomAll),
28, 28, buttonColor); 28, 28, textColorNormal);
const QString zoomSelectionUnicode = Theme::getIconUnicode(Theme::Icon::zoomSelection);
const auto zoomSelectionNormal = Utils::StyleHelper::IconFontHelper(zoomSelectionUnicode,
textColorNormal,
QSize(28, 28),
QIcon::Normal);
const auto zoomSelectionDisabeld = Utils::StyleHelper::IconFontHelper(zoomSelectionUnicode,
textColorDisabled,
QSize(28, 28),
QIcon::Disabled);
const QIcon zoomSelectionIcon = Utils::StyleHelper::getIconFromIconFont(fontName, const QIcon zoomSelectionIcon = Utils::StyleHelper::getIconFromIconFont(fontName,
Theme::getIconUnicode(Theme::Icon::zoomSelection), {zoomSelectionNormal,
28, 28, buttonColor); zoomSelectionDisabeld});
const QIcon zoomInIcon = Utils::StyleHelper::getIconFromIconFont(fontName, const QIcon zoomInIcon = Utils::StyleHelper::getIconFromIconFont(fontName,
Theme::getIconUnicode(Theme::Icon::zoomIn), Theme::getIconUnicode(Theme::Icon::zoomIn),
28, 28, buttonColor); 28, 28, textColorNormal);
const QIcon zoomOutIcon = Utils::StyleHelper::getIconFromIconFont(fontName, const QIcon zoomOutIcon = Utils::StyleHelper::getIconFromIconFont(fontName,
Theme::getIconUnicode(Theme::Icon::zoomOut), Theme::getIconUnicode(Theme::Icon::zoomOut),
28, 28, buttonColor); 28, 28, textColorNormal);
m_zoomInAction = new QAction(zoomInIcon, tr("Zoom in"), this); m_zoomInAction = new QAction(zoomInIcon, tr("Zoom in"), this);
m_zoomInAction->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Plus)); m_zoomInAction->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Plus));