mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Fix context menu visibility for settingview
CURA-8683
This commit is contained in:
parent
97bf50d56c
commit
13af43b76c
1 changed files with 14 additions and 8 deletions
|
@ -4,7 +4,7 @@
|
||||||
import QtQuick 2.7
|
import QtQuick 2.7
|
||||||
import QtQuick.Controls 2.1
|
import QtQuick.Controls 2.1
|
||||||
|
|
||||||
import UM 1.2 as UM
|
import UM 1.5 as UM
|
||||||
import Cura 1.0 as Cura
|
import Cura 1.0 as Cura
|
||||||
|
|
||||||
import "../Menus"
|
import "../Menus"
|
||||||
|
@ -423,20 +423,22 @@ Item
|
||||||
property var provider
|
property var provider
|
||||||
property bool settingVisible
|
property bool settingVisible
|
||||||
|
|
||||||
MenuItem
|
UM.MenuItem
|
||||||
{
|
{
|
||||||
//: Settings context menu action
|
//: Settings context menu action
|
||||||
text: catalog.i18nc("@action:menu", "Copy value to all extruders")
|
text: catalog.i18nc("@action:menu", "Copy value to all extruders")
|
||||||
visible: machineExtruderCount.properties.value > 1
|
visible: machineExtruderCount.properties.value > 1
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
enabled: contextMenu.provider !== undefined && contextMenu.provider.properties.settable_per_extruder !== "False"
|
enabled: contextMenu.provider !== undefined && contextMenu.provider.properties.settable_per_extruder !== "False"
|
||||||
onTriggered: Cura.MachineManager.copyValueToExtruders(contextMenu.key)
|
onTriggered: Cura.MachineManager.copyValueToExtruders(contextMenu.key)
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuItem
|
UM.MenuItem
|
||||||
{
|
{
|
||||||
//: Settings context menu action
|
//: Settings context menu action
|
||||||
text: catalog.i18nc("@action:menu", "Copy all changed values to all extruders")
|
text: catalog.i18nc("@action:menu", "Copy all changed values to all extruders")
|
||||||
visible: machineExtruderCount.properties.value > 1
|
visible: machineExtruderCount.properties.value > 1
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
enabled: contextMenu.provider !== undefined
|
enabled: contextMenu.provider !== undefined
|
||||||
onTriggered: Cura.MachineManager.copyAllValuesToExtruders()
|
onTriggered: Cura.MachineManager.copyAllValuesToExtruders()
|
||||||
}
|
}
|
||||||
|
@ -444,13 +446,14 @@ Item
|
||||||
MenuSeparator
|
MenuSeparator
|
||||||
{
|
{
|
||||||
visible: machineExtruderCount.properties.value > 1
|
visible: machineExtruderCount.properties.value > 1
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
Instantiator
|
Instantiator
|
||||||
{
|
{
|
||||||
id: customMenuItems
|
id: customMenuItems
|
||||||
model: Cura.SidebarCustomMenuItemsModel { }
|
model: Cura.SidebarCustomMenuItemsModel { }
|
||||||
MenuItem
|
UM.MenuItem
|
||||||
{
|
{
|
||||||
text: model.name
|
text: model.name
|
||||||
//iconName: model.icon_name
|
//iconName: model.icon_name
|
||||||
|
@ -466,19 +469,21 @@ Item
|
||||||
MenuSeparator
|
MenuSeparator
|
||||||
{
|
{
|
||||||
visible: customMenuItems.count > 0
|
visible: customMenuItems.count > 0
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuItem
|
UM.MenuItem
|
||||||
{
|
{
|
||||||
//: Settings context menu action
|
//: Settings context menu action
|
||||||
visible: !findingSettings
|
visible: !findingSettings
|
||||||
text: catalog.i18nc("@action:menu", "Hide this setting");
|
text: catalog.i18nc("@action:menu", "Hide this setting")
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
onTriggered:
|
onTriggered:
|
||||||
{
|
{
|
||||||
definitionsModel.hide(contextMenu.key)
|
definitionsModel.hide(contextMenu.key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MenuItem
|
UM.MenuItem
|
||||||
{
|
{
|
||||||
//: Settings context menu action
|
//: Settings context menu action
|
||||||
text:
|
text:
|
||||||
|
@ -493,6 +498,7 @@ Item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
visible: findingSettings
|
visible: findingSettings
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
onTriggered:
|
onTriggered:
|
||||||
{
|
{
|
||||||
if (contextMenu.settingVisible)
|
if (contextMenu.settingVisible)
|
||||||
|
@ -505,7 +511,7 @@ Item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MenuItem
|
UM.MenuItem
|
||||||
{
|
{
|
||||||
//: Settings context menu action
|
//: Settings context menu action
|
||||||
text: catalog.i18nc("@action:menu", "Configure setting visibility...");
|
text: catalog.i18nc("@action:menu", "Configure setting visibility...");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue