Fixing black icons when using dark theme on KDE SDK

This commit is contained in:
Ad5001 2022-01-31 17:15:33 +01:00
parent 78343cf153
commit 82d2ee84b7
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
2 changed files with 46 additions and 12 deletions

View file

@ -20,6 +20,8 @@ import QtQuick 2.12
import QtQuick.Controls 2.12
import "../js/objects.js" as Objects
import "../js/historylib.js" as HistoryLib
import eu.ad5001.LogarithmPlotter.Setting 1.0 as Setting
/*!
\qmltype ObjectCreationGrid
@ -48,19 +50,42 @@ Column {
Button {
id: createBtn
text: Objects.types[modelData].displayType()
width: parent.width/3
visible: Objects.types[modelData].createable()
height: visible ? implicitHeight : 0
display: AbstractButton.TextUnderIcon
icon.name: modelData
icon.source: '../icons/objects/' + modelData + '.svg'
icon.width: 24
icon.height: 24
icon.color: sysPalette.windowText
height: visible ? width*0.6 : 0
// The KDE SDK is kinda buggy, so it respects neither specified color nor display propreties.
//display: AbstractButton.TextUnderIcon
Setting.Icon {
id: icon
width: 24
height: 24
anchors.left: parent.left
anchors.leftMargin: (parent.width-width)/2
anchors.top: parent.top
anchors.topMargin: 8
color: sysPalette.windowText
source: '../icons/objects/'+modelData+'.svg'
}
Label {
id: label
anchors.bottom: parent.bottom
anchors.bottomMargin: 5
anchors.left: parent.left
anchors.leftMargin: 4
anchors.right: parent.right
anchors.rightMargin: 4
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 14
text: Objects.types[modelData].displayType()
clip: true
}
ToolTip.visible: hovered
ToolTip.delay: 200
ToolTip.text: text
ToolTip.text: label.text
onClicked: {
var newObj = Objects.createNewRegisteredObject(modelData)

View file

@ -19,6 +19,7 @@
import QtQuick 2.12
import QtQuick.Dialogs 1.3 as D
import QtQuick.Controls 2.12
import eu.ad5001.LogarithmPlotter.Setting 1.0 as Setting
import "../js/objects.js" as Objects
import "../js/historylib.js" as HistoryLib
@ -139,9 +140,17 @@ ListView {
anchors.right: deleteButton.left
anchors.rightMargin: 5
anchors.topMargin: 5
icon.name: 'position'
icon.source: '../icons/common/position.svg'
icon.color: sysPalette.buttonText
Setting.Icon {
id: icon
width: 18
height: 18
anchors.centerIn: parent
color: sysPalette.windowText
source: '../icons/common/position.svg'
}
property bool hasXProp: Objects.types[objType].properties().hasOwnProperty('x')
property bool hasYProp: Objects.types[objType].properties().hasOwnProperty('y')
visible: hasXProp || hasYProp