Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Attempt to get theming to work for the glyph palette.

Wolthera van Hövell tot Westerflier9f3fd3ede8d9
diff --git a/plugins/tools/svgtexttool/glyphpalette/GlyphDelegate.qml b/plugins/tools/svgtexttool/glyphpalette/GlyphDelegate.qml
index 111e22ab76..d0dcbf9fa9 100644
--- a/plugins/tools/svgtexttool/glyphpalette/GlyphDelegate.qml
+++ b/plugins/tools/svgtexttool/glyphpalette/GlyphDelegate.qml
@@ -25,13 +25,13 @@ SvgTextLabel {
Rectangle {
anchors.fill: parent;
color: "transparent";
- border.color: parent.currentItem? palette.highlight: palette.alternateBase;
+ border.color: parent.currentItem? sysPalette.highlight: sysPalette.alternateBase;
border.width: parent.currentItem? 2: 1;
}
Rectangle {
anchors.top: parent.top;
anchors.left: parent.left;
- color: palette.text;
+ color: sysPalette.text;
opacity: 0.3;
layer.enabled: true
width: childrenRect.width;
@@ -39,7 +39,7 @@ SvgTextLabel {
Text {
padding: 2;
text: model.glyphLabel;
- color: palette.base;
+ color: sysPalette.base;
font.pointSize: 9;
}
visible: glyphMouseArea.containsMouse;
@@ -50,7 +50,7 @@ SvgTextLabel {
width: 8;
height: 8;
radius: 4;
- color: palette.text;
+ color: sysPalette.text;
opacity: 0.3;
visible: model.childCount > 1;
}
diff --git a/plugins/tools/svgtexttool/glyphpalette/GlyphPalette.qml b/plugins/tools/svgtexttool/glyphpalette/GlyphPalette.qml
index 3b4b42901c..85c542db16 100644
--- a/plugins/tools/svgtexttool/glyphpalette/GlyphPalette.qml
+++ b/plugins/tools/svgtexttool/glyphpalette/GlyphPalette.qml
@@ -22,10 +22,10 @@ Rectangle {
property int fontWeight : 400;
property int fontStyle;
SystemPalette {
- id: palette;
+ id: sysPalette;
colorGroup: SystemPalette.Active
}
- color: palette.window
+ color: sysPalette.window
TabBar {
id: tabs;
@@ -64,8 +64,8 @@ Rectangle {
}
delegate: GlyphDelegate {
- textColor: palette.text;
- fillColor: palette.base;
+ textColor: sysPalette.text;
+ fillColor: sysPalette.base;
fontFamilies: root.fontFamilies;
fontSize: root.fontSize;
fontStyle: root.fontStyle;
@@ -126,8 +126,8 @@ Rectangle {
cellHeight: cellWidth;
delegate: GlyphDelegate {
- textColor: palette.text;
- fillColor: palette.base;
+ textColor: sysPalette.text;
+ fillColor: sysPalette.base;
fontFamilies: root.fontFamilies;
fontSize: root.fontSize;
fontStyle: root.fontStyle;
@@ -173,8 +173,8 @@ Rectangle {
}
delegate: GlyphDelegate {
- textColor: palette.text;
- fillColor: palette.base;
+ textColor: sysPalette.text;
+ fillColor: sysPalette.base;
fontFamilies: root.fontFamilies;
fontSize: root.fontSize;
fontStyle: root.fontStyle;
diff --git a/plugins/tools/svgtexttool/glyphpalette/GlyphPaletteDialog.cpp b/plugins/tools/svgtexttool/glyphpalette/GlyphPaletteDialog.cpp
index fab058dd38..21a52e3ee8 100644
--- a/plugins/tools/svgtexttool/glyphpalette/GlyphPaletteDialog.cpp
+++ b/plugins/tools/svgtexttool/glyphpalette/GlyphPaletteDialog.cpp
@@ -42,6 +42,7 @@ GlyphPaletteDialog::GlyphPaletteDialog(QWidget *parent)
m_quickWidget->engine()->addPluginPath(KoResourcePaths::getApplicationRoot() + "/lib/qml/");
m_quickWidget->engine()->addPluginPath(KoResourcePaths::getApplicationRoot() + "/lib64/qml/");
+ m_quickWidget->setPalette(this->palette());
m_quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
m_quickWidget->setSource(QUrl("qrc:/GlyphPalette.qml"));