Updating MixedMenu, now using fallback theme instead of direct path for icons when possible, for better theme integration.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adsooi 2021-07-22 22:52:23 +02:00
parent b8db13bbf2
commit ef9610d4dd
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
5 changed files with 11 additions and 5 deletions

View file

@ -19,7 +19,7 @@
from PySide2.QtWidgets import QApplication, QFileDialog
from PySide2.QtQml import QQmlApplicationEngine, qmlRegisterType
from PySide2.QtCore import Qt, QObject, Signal, Slot, Property
from PySide2.QtGui import QIcon, QImage
from PySide2.QtGui import QIcon, QImage, QKeySequence
from PySide2 import __version__ as PySide2_version
import os
@ -122,6 +122,12 @@ def run():
"darwin": "default"
}[platform]
icon_fallbacks = QIcon.fallbackSearchPaths();
icon_fallbacks.append(os.path.realpath(os.path.join(os.getcwd(), "qml", "eu", "ad5001", "LogarithmPlotter", "icons")))
icon_fallbacks.append(os.path.realpath(os.path.join(os.getcwd(), "qml", "eu", "ad5001", "LogarithmPlotter", "icons", "settings")))
icon_fallbacks.append(os.path.realpath(os.path.join(os.getcwd(), "qml", "eu", "ad5001", "LogarithmPlotter", "icons", "settings", "custom")))
QIcon.setFallbackSearchPaths(icon_fallbacks);
app = QApplication(argv)
app.setApplicationName("LogarithmPlotter")
app.setOrganizationName("Ad5001")

View file

@ -23,6 +23,7 @@ import "js/objects.js" as Objects
import "js/historylib.js" as HistoryLib
MenuBar {
Menu {
title: qsTr("&File")
Action {
@ -89,7 +90,6 @@ MenuBar {
text: modelData
visible: Objects.types[modelData].createable()
height: visible ? implicitHeight : 0
iconSource: './icons/'+modelData+'.svg' // Default to dark version
iconName: modelData
iconColor: sysPalette.windowText
onTriggered: {
@ -104,6 +104,7 @@ MenuBar {
title: qsTr("&Help")
Action {
text: qsTr("&About")
shortcut: StandardKey.HelpContents
iconName: 'about'
onTriggered: about.open()
}

View file

@ -41,6 +41,7 @@ ApplicationWindow {
About {id: about}
Drawer {
id: sidebar
width: 300

View file

@ -129,7 +129,6 @@ ListView {
anchors.right: colorPickRect.left
anchors.rightMargin: 5
anchors.topMargin: 5
icon.source: './icons/delete.svg'
icon.name: 'delete'
onClicked: {
@ -434,7 +433,6 @@ ListView {
visible: Objects.types[modelData].createable()
height: visible ? implicitHeight : 0
display: AbstractButton.TextUnderIcon
icon.source: './icons/'+modelData+'.svg' // Default to dark version
icon.name: modelData
icon.width: 24
icon.height: 24

@ -1 +1 @@
Subproject commit 092a101d2d8690a9d101783e97ea4fdc54d9d0f7
Subproject commit 66e3761b50fcc2f14eec97eaaf20fa5ef3a48300