Now using the proper icon properties! Also removing debug.

This commit is contained in:
Adsooi 2021-07-23 00:37:42 +02:00
parent 66e3761b50
commit f0d6a96174
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
4 changed files with 2 additions and 11 deletions

View file

@ -42,9 +42,7 @@ Item {
property alias enabled: controlsAction.enabled property alias enabled: controlsAction.enabled
property alias shortcut: controlsAction.shortcut property alias shortcut: controlsAction.shortcut
property alias text: controlsAction.text property alias text: controlsAction.text
property alias iconName: controlsAction.icon.name property alias icon: controlsAction.icon
property alias iconSource: controlsAction.icon.source
property alias iconColor: controlsAction.icon.color
Native.MenuItem { Native.MenuItem {
id: nativeAction id: nativeAction
@ -65,7 +63,6 @@ Item {
Component.onCompleted: { Component.onCompleted: {
// Forwarding to MenuBar. Little hack to make Action shortcuts work properly, because otherwise, they would not trigger // Forwarding to MenuBar. Little hack to make Action shortcuts work properly, because otherwise, they would not trigger
if(shortcut != 0) { if(shortcut != 0) {
console.log("Adding shortcut for", text, "with shortcut", shortcut)
parent.parent.addShortcut(shortcut, root.triggered) parent.parent.addShortcut(shortcut, root.triggered)
} }
} }

View file

@ -95,6 +95,5 @@ Item {
}`, root, "shortcut" + sequence); }`, root, "shortcut" + sequence);
newShortcut.sequence = sequence newShortcut.sequence = sequence
newShortcut.activated.connect(trigger) newShortcut.activated.connect(trigger)
console.log("Added shortcut " + sequence)
} }
} }

View file

@ -42,9 +42,7 @@ Item {
property bool enabled: true property bool enabled: true
property font font: trueItem.font property font font: trueItem.font
property string text: "" property string text: ""
property alias iconName: controlsMenuItem.icon.name property alias icon: controlsMenuItem.icon
property alias iconSource: controlsMenuItem.icon.source
property alias iconColor: controlsMenuItem.icon.color
Native.MenuItem { Native.MenuItem {
id: nativeMenuItem id: nativeMenuItem

View file

@ -24,9 +24,6 @@ When switching from QtQuick.Controls 2 to MixedMenu, the following changes need
|QtQuick.Controls2/Qt.labs | > |eu.ad5001.MixedMenu | |QtQuick.Controls2/Qt.labs | > |eu.ad5001.MixedMenu |
|-------------------------------------|---|--------------------------------------------------------| |-------------------------------------|---|--------------------------------------------------------|
|`import import QtQuick.Controls 2.12`| > |`import eu.ad5001.MixedMenu 1.0` | |`import import QtQuick.Controls 2.12`| > |`import eu.ad5001.MixedMenu 1.0` |
|`icon.name: ...` | > |`iconName: ...` |
|`icon.source: ...` | > |`iconSource: ...` |
|`icon.color: ...` | > |`iconColor: ...` |
|`menuBar: MenuBar {}` | > |`MenuBar { id: appMenu }`<br>`menuBar: appMenu.trueItem`| |`menuBar: MenuBar {}` | > |`MenuBar { id: appMenu }`<br>`menuBar: appMenu.trueItem`|