From e46955f6271b56f53af48f41424b1e73f4896fc5 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 2 Dec 2020 16:21:38 +0100 Subject: [PATCH] QmlDesigner: Fix the color of some toolbar icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Give them the standard Theme::IconsBaseColor that works well with all themes. Task-number: QTCREATORBUG-24402 Change-Id: I458d1b4a7b3cceb2d318ff4257b4aa173170a533 Reviewed-by: Henning Gründl Reviewed-by: Thomas Hartmann --- .../components/formeditor/formeditorwidget.cpp | 14 +++++++------- .../components/richtexteditor/richtexteditor.cpp | 4 +++- src/plugins/qmldesigner/designmodewidget.cpp | 5 +++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp index cf7a5759e25..396c11cdf5e 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp @@ -149,18 +149,18 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) // Zoom actions const QString fontName = "qtds_propertyIconFont.ttf"; - const QColor textColorNormal(Theme::getColor(Theme::MenuItemTextColorNormal)); - const QColor textColorDisabled(Theme::getColor(Theme::MenuBarItemTextColorDisabled)); + const QColor iconColorNormal(Theme::getColor(Theme::IconsBaseColor)); + const QColor iconColorDisabled(Theme::getColor(Theme::IconsDisabledColor)); const QIcon zoomAllIcon = Utils::StyleHelper::getIconFromIconFont( - fontName, Theme::getIconUnicode(Theme::Icon::zoomAll), 28, 28, textColorNormal); + fontName, Theme::getIconUnicode(Theme::Icon::zoomAll), 28, 28, iconColorNormal); const QString zoomSelectionUnicode = Theme::getIconUnicode(Theme::Icon::zoomSelection); const auto zoomSelectionNormal = Utils::StyleHelper::IconFontHelper(zoomSelectionUnicode, - textColorNormal, + iconColorNormal, QSize(28, 28), QIcon::Normal); const auto zoomSelectionDisabeld = Utils::StyleHelper::IconFontHelper(zoomSelectionUnicode, - textColorDisabled, + iconColorDisabled, QSize(28, 28), QIcon::Disabled); @@ -168,9 +168,9 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) {zoomSelectionNormal, zoomSelectionDisabeld}); const QIcon zoomInIcon = Utils::StyleHelper::getIconFromIconFont( - fontName, Theme::getIconUnicode(Theme::Icon::zoomIn), 28, 28, textColorNormal); + fontName, Theme::getIconUnicode(Theme::Icon::zoomIn), 28, 28, iconColorNormal); const QIcon zoomOutIcon = Utils::StyleHelper::getIconFromIconFont( - fontName, Theme::getIconUnicode(Theme::Icon::zoomOut), 28, 28, textColorNormal); + fontName, Theme::getIconUnicode(Theme::Icon::zoomOut), 28, 28, iconColorNormal); auto writeZoomLevel = [this]() { double level = m_graphicsView->transform().m11(); diff --git a/src/plugins/qmldesigner/components/richtexteditor/richtexteditor.cpp b/src/plugins/qmldesigner/components/richtexteditor/richtexteditor.cpp index a8e693876e0..451b0130f1d 100644 --- a/src/plugins/qmldesigner/components/richtexteditor/richtexteditor.cpp +++ b/src/plugins/qmldesigner/components/richtexteditor/richtexteditor.cpp @@ -187,8 +187,10 @@ void RichTextEditor::setTabChangesFocus(bool change) QIcon RichTextEditor::getIcon(Theme::Icon icon) { const QString fontName = "qtds_propertyIconFont.ttf"; + const QColor iconColorNormal(Theme::getColor(Theme::IconsBaseColor)); - return Utils::StyleHelper::getIconFromIconFont(fontName, Theme::getIconUnicode(icon), 20, 20); + return Utils::StyleHelper::getIconFromIconFont( + fontName, Theme::getIconUnicode(icon), 20, 20, iconColorNormal); } QString RichTextEditor::richText() const diff --git a/src/plugins/qmldesigner/designmodewidget.cpp b/src/plugins/qmldesigner/designmodewidget.cpp index b4ae4159776..53dbc50f07e 100644 --- a/src/plugins/qmldesigner/designmodewidget.cpp +++ b/src/plugins/qmldesigner/designmodewidget.cpp @@ -239,6 +239,7 @@ void DesignModeWidget::setup() m_dockManager->setStyleSheet(Theme::replaceCssColors(sheet)); // Setup icons + const QColor iconColor(Theme::getColor(Theme::IconsBaseColor)); const QColor buttonColor(Theme::getColor(Theme::QmlDesigner_TabLight)); // TODO Use correct color roles const QColor tabColor(Theme::getColor(Theme::QmlDesigner_TabDark)); @@ -468,8 +469,8 @@ void DesignModeWidget::setup() m_dockManager->openWorkspace(workspaceComboBox->currentText()); }); - const QIcon gaIcon = Utils::StyleHelper::getIconFromIconFont(fontName, - Theme::getIconUnicode(Theme::Icon::annotationBubble), 36, 36); + const QIcon gaIcon = Utils::StyleHelper::getIconFromIconFont( + fontName, Theme::getIconUnicode(Theme::Icon::annotationBubble), 36, 36, iconColor); toolBar->addAction(gaIcon, tr("Edit global annotation for current file."), [&](){ ModelNode node = currentDesignDocument()->rewriterView()->rootModelNode();