mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Use Cura.MenuItem instead of UM.MenuItem
I didn't realise that Cura already had a menu item. To prevent Confusion, i've changed Cura.MenuItem to use UM.MenuItem and let all other menus use Cura.MenuItem
This commit is contained in:
parent
bab9311284
commit
3130ea0f74
17 changed files with 96 additions and 128 deletions
|
@ -18,29 +18,27 @@ Menu
|
|||
property var multiBuildPlateModel: CuraApplication.getMultiBuildPlateModel()
|
||||
|
||||
// Selection-related actions.
|
||||
UM.MenuItem { action: Cura.Actions.centerSelection; }
|
||||
UM.MenuItem { action: Cura.Actions.deleteSelection; }
|
||||
UM.MenuItem { action: Cura.Actions.multiplySelection; }
|
||||
Cura.MenuItem { action: Cura.Actions.centerSelection; }
|
||||
Cura.MenuItem { action: Cura.Actions.deleteSelection; }
|
||||
Cura.MenuItem { action: Cura.Actions.multiplySelection; }
|
||||
|
||||
// Extruder selection - only visible if there is more than 1 extruder
|
||||
MenuSeparator { visible: base.shouldShowExtruders }
|
||||
UM.MenuItem
|
||||
Cura.MenuSeparator { visible: base.shouldShowExtruders }
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: extruderHeader
|
||||
text: catalog.i18ncp("@label", "Print Selected Model With:", "Print Selected Models With:", UM.Selection.selectionCount)
|
||||
enabled: false
|
||||
visible: base.shouldShowExtruders
|
||||
height: visible ? implicitHeight: 0
|
||||
}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: CuraApplication.getExtrudersModel()
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: "%1: %2 - %3".arg(model.name).arg(model.material).arg(model.variant)
|
||||
visible: base.shouldShowExtruders
|
||||
height: visible ? implicitHeight: 0
|
||||
enabled: UM.Selection.hasSelection && model.enabled
|
||||
checkable: true
|
||||
checked: Cura.ExtruderManager.selectedObjectExtruders.indexOf(model.id) != -1
|
||||
|
@ -53,19 +51,19 @@ Menu
|
|||
}
|
||||
|
||||
// Global actions
|
||||
MenuSeparator {}
|
||||
UM.MenuItem { action: Cura.Actions.selectAll }
|
||||
UM.MenuItem { action: Cura.Actions.arrangeAll }
|
||||
UM.MenuItem { action: Cura.Actions.deleteAll }
|
||||
UM.MenuItem { action: Cura.Actions.reloadAll }
|
||||
UM.MenuItem { action: Cura.Actions.resetAllTranslation }
|
||||
UM.MenuItem { action: Cura.Actions.resetAll }
|
||||
Cura.MenuSeparator {}
|
||||
Cura.MenuItem { action: Cura.Actions.selectAll }
|
||||
Cura.MenuItem { action: Cura.Actions.arrangeAll }
|
||||
Cura.MenuItem { action: Cura.Actions.deleteAll }
|
||||
Cura.MenuItem { action: Cura.Actions.reloadAll }
|
||||
Cura.MenuItem { action: Cura.Actions.resetAllTranslation }
|
||||
Cura.MenuItem { action: Cura.Actions.resetAll }
|
||||
|
||||
// Group actions
|
||||
MenuSeparator {}
|
||||
UM.MenuItem { action: Cura.Actions.groupObjects }
|
||||
UM.MenuItem { action: Cura.Actions.mergeObjects }
|
||||
UM.MenuItem { action: Cura.Actions.unGroupObjects }
|
||||
Cura.MenuSeparator {}
|
||||
Cura.MenuItem { action: Cura.Actions.groupObjects }
|
||||
Cura.MenuItem { action: Cura.Actions.mergeObjects }
|
||||
Cura.MenuItem { action: Cura.Actions.unGroupObjects }
|
||||
|
||||
Connections
|
||||
{
|
||||
|
|
|
@ -11,18 +11,18 @@ Menu
|
|||
{
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel", "&Edit")
|
||||
|
||||
UM.MenuItem { action: Cura.Actions.undo }
|
||||
UM.MenuItem { action: Cura.Actions.redo }
|
||||
Cura.MenuItem { action: Cura.Actions.undo }
|
||||
Cura.MenuItem { action: Cura.Actions.redo }
|
||||
MenuSeparator { }
|
||||
UM.MenuItem { action: Cura.Actions.selectAll }
|
||||
UM.MenuItem { action: Cura.Actions.arrangeAll }
|
||||
UM.MenuItem { action: Cura.Actions.multiplySelection }
|
||||
UM.MenuItem { action: Cura.Actions.deleteSelection }
|
||||
UM.MenuItem { action: Cura.Actions.deleteAll }
|
||||
UM.MenuItem { action: Cura.Actions.resetAllTranslation }
|
||||
UM.MenuItem { action: Cura.Actions.resetAll }
|
||||
Cura.MenuItem { action: Cura.Actions.selectAll }
|
||||
Cura.MenuItem { action: Cura.Actions.arrangeAll }
|
||||
Cura.MenuItem { action: Cura.Actions.multiplySelection }
|
||||
Cura.MenuItem { action: Cura.Actions.deleteSelection }
|
||||
Cura.MenuItem { action: Cura.Actions.deleteAll }
|
||||
Cura.MenuItem { action: Cura.Actions.resetAllTranslation }
|
||||
Cura.MenuItem { action: Cura.Actions.resetAll }
|
||||
MenuSeparator { }
|
||||
UM.MenuItem { action: Cura.Actions.groupObjects }
|
||||
UM.MenuItem { action: Cura.Actions.mergeObjects }
|
||||
UM.MenuItem { action: Cura.Actions.unGroupObjects }
|
||||
Cura.MenuItem { action: Cura.Actions.groupObjects }
|
||||
Cura.MenuItem { action: Cura.Actions.mergeObjects }
|
||||
Cura.MenuItem { action: Cura.Actions.unGroupObjects }
|
||||
}
|
|
@ -16,7 +16,7 @@ Menu
|
|||
{
|
||||
id: extensionsMenuItem
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: modelText
|
||||
onTriggered: extensionsModel.subMenuTriggered(extensionName, modelText)
|
||||
|
|
|
@ -14,18 +14,17 @@ Menu
|
|||
property var fileProviderModel: CuraApplication.getFileProviderModel()
|
||||
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: newProjectMenu
|
||||
action: Cura.Actions.newProject
|
||||
}
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: openMenu
|
||||
action: Cura.Actions.open
|
||||
visible: base.fileProviderModel.count == 1
|
||||
height: visible ? implicitHeight: 0
|
||||
}
|
||||
|
||||
OpenFilesMenu
|
||||
|
@ -37,13 +36,12 @@ Menu
|
|||
|
||||
RecentFilesMenu { }
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: saveWorkspaceMenu
|
||||
shortcut: StandardKey.Save
|
||||
text: catalog.i18nc("@title:menu menubar:file", "&Save Project...")
|
||||
visible: saveProjectMenu.model.count == 1
|
||||
height: visible ? implicitHeight : 0
|
||||
enabled: UM.WorkspaceFileHandler.enabled
|
||||
onTriggered:
|
||||
{
|
||||
|
@ -72,7 +70,7 @@ Menu
|
|||
|
||||
MenuSeparator { }
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: saveAsMenu
|
||||
text: catalog.i18nc("@title:menu menubar:file", "&Export...")
|
||||
|
@ -83,7 +81,7 @@ Menu
|
|||
}
|
||||
}
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: exportSelectionMenu
|
||||
text: catalog.i18nc("@action:inmenu menubar:file", "Export Selection...")
|
||||
|
@ -94,7 +92,7 @@ Menu
|
|||
|
||||
MenuSeparator { }
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: reloadAllMenu
|
||||
action: Cura.Actions.reloadAll
|
||||
|
@ -102,5 +100,5 @@ Menu
|
|||
|
||||
MenuSeparator { }
|
||||
|
||||
UM.MenuItem { action: Cura.Actions.quit }
|
||||
Cura.MenuItem { action: Cura.Actions.quit }
|
||||
}
|
||||
|
|
|
@ -13,11 +13,11 @@ Menu
|
|||
id: helpMenu
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel", "&Help")
|
||||
|
||||
UM.MenuItem { action: Cura.Actions.showProfileFolder }
|
||||
UM.MenuItem { action: Cura.Actions.showTroubleshooting}
|
||||
UM.MenuItem { action: Cura.Actions.documentation }
|
||||
UM.MenuItem { action: Cura.Actions.reportBug }
|
||||
MenuSeparator { }
|
||||
UM.MenuItem { action: Cura.Actions.whatsNew }
|
||||
UM.MenuItem { action: Cura.Actions.about }
|
||||
Cura.MenuItem { action: Cura.Actions.showProfileFolder }
|
||||
Cura.MenuItem { action: Cura.Actions.showTroubleshooting}
|
||||
Cura.MenuItem { action: Cura.Actions.documentation }
|
||||
Cura.MenuItem { action: Cura.Actions.reportBug }
|
||||
Cura.MenuSeparator { }
|
||||
Cura.MenuItem { action: Cura.Actions.whatsNew }
|
||||
Cura.MenuItem { action: Cura.Actions.about }
|
||||
}
|
|
@ -48,18 +48,17 @@ UM.Menu
|
|||
enabled: updateModels
|
||||
}
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@label:category menu label", "Favorites")
|
||||
enabled: false
|
||||
visible: favoriteMaterialsModel.items.length > 0
|
||||
height: visible ? implicitHeight: 0
|
||||
}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: favoriteMaterialsModel
|
||||
delegate: UM.MenuItem
|
||||
delegate: Cura.MenuItem
|
||||
{
|
||||
text: model.brand + " " + model.name
|
||||
checkable: true
|
||||
|
@ -81,7 +80,7 @@ UM.Menu
|
|||
Instantiator
|
||||
{
|
||||
model: genericMaterialsModel
|
||||
delegate: UM.MenuItem
|
||||
delegate: Cura.MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
|
@ -94,12 +93,12 @@ UM.Menu
|
|||
}
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
Cura.MenuSeparator {}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: brandModel
|
||||
UM.Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: brandMenu
|
||||
title: brandName
|
||||
|
@ -119,7 +118,7 @@ UM.Menu
|
|||
Instantiator
|
||||
{
|
||||
model: brandMaterialColors
|
||||
delegate: UM.MenuItem
|
||||
delegate: Cura.MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
|
@ -140,16 +139,16 @@ UM.Menu
|
|||
onObjectRemoved: materialMenu.removeMenu(object)
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
Cura.MenuSeparator {}
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
action: Cura.Actions.manageMaterials
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
Cura.MenuSeparator {}
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
action: Cura.Actions.marketplaceMaterials
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ UM.Menu
|
|||
{
|
||||
model: nozzleModel
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: model.hotend_name
|
||||
checkable: true
|
||||
|
|
|
@ -18,7 +18,7 @@ UM.Menu
|
|||
{
|
||||
id: fileProviders
|
||||
model: CuraApplication.getFileProviderModel()
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text:
|
||||
{
|
||||
|
|
|
@ -20,6 +20,6 @@ Menu
|
|||
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
|
||||
title: (Qt.platform.os == "osx") ? "&Preferences" : catalog.i18nc("@title:menu menubar:toplevel", "P&references")
|
||||
|
||||
UM.MenuItem { action: Cura.Actions.preferences }
|
||||
Cura.MenuItem { action: Cura.Actions.preferences }
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ Menu
|
|||
{
|
||||
id: menu
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: networkEnabledPrinterItem
|
||||
text: catalog.i18nc("@label:category menu label", "Network enabled printers")
|
||||
|
@ -23,7 +23,7 @@ Menu
|
|||
{
|
||||
id: networKPrinterInstantiator
|
||||
model: Cura.GlobalStacksModel {filterOnlineOnly: true }
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
property string connectGroupName:
|
||||
{
|
||||
|
@ -42,12 +42,9 @@ Menu
|
|||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
|
||||
MenuSeparator
|
||||
{
|
||||
visible: networKPrinterInstantiator.count > 0
|
||||
}
|
||||
Cura.MenuSeparator { visible: networKPrinterInstantiator.count > 0 }
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: localPrinterMenu
|
||||
text: catalog.i18nc("@label:category menu label", "Local printers")
|
||||
|
@ -60,13 +57,12 @@ Menu
|
|||
id: localPrinterInstantiator
|
||||
model: Cura.GlobalStacksModel {}
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id == model.id: false
|
||||
visible: !model.hasRemoteConnection
|
||||
height: visible ? implicitHeight: 0
|
||||
onTriggered: Cura.MachineManager.setActiveMachine(model.id)
|
||||
}
|
||||
// A bit hackish, but we have 2 items at the end, put them before that
|
||||
|
@ -74,11 +70,8 @@ Menu
|
|||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
|
||||
MenuSeparator
|
||||
{
|
||||
visible: localPrinterInstantiator.count > 0
|
||||
}
|
||||
Cura.MenuSeparator { visible: localPrinterInstantiator.count > 0 }
|
||||
|
||||
UM.MenuItem { action: Cura.Actions.addMachine }
|
||||
UM.MenuItem { action: Cura.Actions.configureMachines }
|
||||
Cura.MenuItem { action: Cura.Actions.addMachine }
|
||||
Cura.MenuItem { action: Cura.Actions.configureMachines }
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ Menu
|
|||
id: printerTypeInstantiator
|
||||
model: outputDevice != null ? outputDevice.connectedPrintersTypeCount : []
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: modelData.machine_type
|
||||
checkable: true
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import QtQuick 2.2
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
import UM 1.6 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
import "../Dialogs"
|
||||
|
@ -18,7 +18,7 @@ UM.Menu
|
|||
Instantiator
|
||||
{
|
||||
id: projectOutputDevices
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: model.name
|
||||
onTriggered:
|
||||
|
|
|
@ -44,13 +44,13 @@ Menu
|
|||
visible: Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasMaterials
|
||||
}
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu", "Set as Active Extruder")
|
||||
onTriggered: Cura.ExtruderManager.setActiveExtruderIndex(model.index)
|
||||
}
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu", "Enable Extruder")
|
||||
onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true)
|
||||
|
@ -58,7 +58,7 @@ Menu
|
|||
height: visible ? implicitHeight: 0
|
||||
}
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu", "Disable Extruder")
|
||||
onTriggered: Cura.MachineManager.setExtruderEnabled(index, false)
|
||||
|
@ -71,7 +71,7 @@ Menu
|
|||
onObjectRemoved: base.removeMenu(object)
|
||||
}
|
||||
|
||||
MenuSeparator { }
|
||||
Cura.MenuSeparator { }
|
||||
|
||||
UM.MenuItem { action: Cura.Actions.configureSettingVisibility }
|
||||
Cura.MenuItem { action: Cura.Actions.configureSettingVisibility }
|
||||
}
|
|
@ -15,12 +15,12 @@ Menu
|
|||
Menu
|
||||
{
|
||||
title: catalog.i18nc("@action:inmenu menubar:view", "&Camera position")
|
||||
UM.MenuItem { action: Cura.Actions.view3DCamera }
|
||||
UM.MenuItem { action: Cura.Actions.viewFrontCamera }
|
||||
UM.MenuItem { action: Cura.Actions.viewTopCamera }
|
||||
UM.MenuItem { action: Cura.Actions.viewBottomCamera }
|
||||
UM.MenuItem { action: Cura.Actions.viewLeftSideCamera }
|
||||
UM.MenuItem { action: Cura.Actions.viewRightSideCamera }
|
||||
Cura.MenuItem { action: Cura.Actions.view3DCamera }
|
||||
Cura.MenuItem { action: Cura.Actions.viewFrontCamera }
|
||||
Cura.MenuItem { action: Cura.Actions.viewTopCamera }
|
||||
Cura.MenuItem { action: Cura.Actions.viewBottomCamera }
|
||||
Cura.MenuItem { action: Cura.Actions.viewLeftSideCamera }
|
||||
Cura.MenuItem { action: Cura.Actions.viewRightSideCamera }
|
||||
}
|
||||
|
||||
Menu
|
||||
|
@ -43,7 +43,7 @@ Menu
|
|||
}
|
||||
}
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu menubar:view", "Perspective")
|
||||
checkable: true
|
||||
|
@ -54,7 +54,7 @@ Menu
|
|||
}
|
||||
}
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu menubar:view", "Orthographic")
|
||||
checkable: true
|
||||
|
@ -66,9 +66,9 @@ Menu
|
|||
}
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
Cura.MenuSeparator {}
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
action: Cura.Actions.toggleFullScreen
|
||||
}
|
||||
|
|
|
@ -416,37 +416,34 @@ Item
|
|||
property var provider
|
||||
property bool settingVisible
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
//: Settings context menu action
|
||||
text: catalog.i18nc("@action:menu", "Copy value to all extruders")
|
||||
visible: machineExtruderCount.properties.value > 1
|
||||
height: visible ? implicitHeight : 0
|
||||
enabled: contextMenu.provider !== undefined && contextMenu.provider.properties.settable_per_extruder !== "False"
|
||||
onTriggered: Cura.MachineManager.copyValueToExtruders(contextMenu.key)
|
||||
}
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
//: Settings context menu action
|
||||
text: catalog.i18nc("@action:menu", "Copy all changed values to all extruders")
|
||||
visible: machineExtruderCount.properties.value > 1
|
||||
height: visible ? implicitHeight : 0
|
||||
enabled: contextMenu.provider !== undefined
|
||||
onTriggered: Cura.MachineManager.copyAllValuesToExtruders()
|
||||
}
|
||||
|
||||
MenuSeparator
|
||||
Cura.MenuSeparator
|
||||
{
|
||||
visible: machineExtruderCount.properties.value > 1
|
||||
height: visible ? implicitHeight : 0
|
||||
}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
id: customMenuItems
|
||||
model: Cura.SidebarCustomMenuItemsModel { }
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: model.name
|
||||
onTriggered:
|
||||
|
@ -458,24 +455,22 @@ Item
|
|||
onObjectRemoved: contextMenu.removeItem(object)
|
||||
}
|
||||
|
||||
MenuSeparator
|
||||
Cura.MenuSeparator
|
||||
{
|
||||
visible: customMenuItems.count > 0
|
||||
height: visible ? implicitHeight : 0
|
||||
}
|
||||
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
//: Settings context menu action
|
||||
visible: !findingSettings
|
||||
text: catalog.i18nc("@action:menu", "Hide this setting")
|
||||
height: visible ? implicitHeight : 0
|
||||
onTriggered:
|
||||
{
|
||||
definitionsModel.hide(contextMenu.key)
|
||||
}
|
||||
}
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
//: Settings context menu action
|
||||
text:
|
||||
|
@ -490,7 +485,6 @@ Item
|
|||
}
|
||||
}
|
||||
visible: findingSettings
|
||||
height: visible ? implicitHeight : 0
|
||||
onTriggered:
|
||||
{
|
||||
if (contextMenu.settingVisible)
|
||||
|
@ -503,7 +497,7 @@ Item
|
|||
}
|
||||
}
|
||||
}
|
||||
UM.MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
//: Settings context menu action
|
||||
text: catalog.i18nc("@action:menu", "Configure setting visibility...")
|
||||
|
|
|
@ -4,18 +4,17 @@
|
|||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.1 as UM
|
||||
import UM 1.5 as UM
|
||||
|
||||
//
|
||||
// MenuItem with Cura styling.
|
||||
//
|
||||
MenuItem
|
||||
UM.MenuItem
|
||||
{
|
||||
id: menuItem
|
||||
|
||||
implicitHeight: UM.Theme.getSize("setting_control").height + UM.Theme.getSize("narrow_margin").height
|
||||
opacity: enabled ? 1.0 : 0.5
|
||||
height: visible ? implicitHeight : 0
|
||||
|
||||
arrow: UM.RecolorImage
|
||||
{
|
||||
|
@ -42,20 +41,8 @@ MenuItem
|
|||
color: UM.Theme.getColor("setting_control_text")
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
leftPadding: menuItem.checkable ? menuItem.indicator.width + UM.Theme.getSize("default_margin").width : UM.Theme.getSize("thin_margin").width
|
||||
rightPadding: menuItem.subMenu ? menuItem.arrow.width + UM.Theme.getSize("default_margin").width : UM.Theme.getSize("thin_margin").width
|
||||
text: menuItem.text
|
||||
|
||||
textFormat: Text.PlainText
|
||||
renderType: Text.NativeRendering
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
background: Rectangle
|
||||
{
|
||||
x: UM.Theme.getSize("default_lining").width
|
||||
y: UM.Theme.getSize("default_lining").width
|
||||
width: menuItem.width - 2 * UM.Theme.getSize("default_lining").width
|
||||
|
|
|
@ -12,7 +12,6 @@ import UM 1.1 as UM
|
|||
MenuSeparator
|
||||
{
|
||||
padding: 0
|
||||
|
||||
contentItem: Rectangle {
|
||||
implicitHeight: UM.Theme.getSize("default_lining").height
|
||||
color: UM.Theme.getColor("setting_control_border")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue