mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Codestyle fixes
This commit is contained in:
parent
13af43b76c
commit
313c10801d
1 changed files with 25 additions and 33 deletions
|
@ -14,7 +14,6 @@ Item
|
||||||
id: settingsView
|
id: settingsView
|
||||||
|
|
||||||
property QtObject settingVisibilityPresetsModel: CuraApplication.getSettingVisibilityPresetsModel()
|
property QtObject settingVisibilityPresetsModel: CuraApplication.getSettingVisibilityPresetsModel()
|
||||||
//property Action configureSettings
|
|
||||||
property bool findingSettings
|
property bool findingSettings
|
||||||
|
|
||||||
Item
|
Item
|
||||||
|
@ -46,7 +45,7 @@ Item
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
leftPadding: searchIcon.width + UM.Theme.getSize("default_margin").width * 2
|
leftPadding: searchIcon.width + UM.Theme.getSize("default_margin").width * 2
|
||||||
placeholderText: catalog.i18nc("@label:textbox", "Search settings")
|
placeholderText: catalog.i18nc("@label:textbox", "Search settings")
|
||||||
font.italic: true
|
font.italic: true
|
||||||
|
|
||||||
property var expandedCategories
|
property var expandedCategories
|
||||||
|
@ -68,10 +67,7 @@ Item
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
}
|
}
|
||||||
|
|
||||||
onTextChanged:
|
onTextChanged: settingsSearchTimer.restart()
|
||||||
{
|
|
||||||
settingsSearchTimer.restart()
|
|
||||||
}
|
|
||||||
|
|
||||||
onEditingFinished:
|
onEditingFinished:
|
||||||
{
|
{
|
||||||
|
@ -84,10 +80,7 @@ Item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onEscapePressed:
|
Keys.onEscapePressed: filter.text = ""
|
||||||
{
|
|
||||||
filter.text = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateDefinitionModel()
|
function updateDefinitionModel()
|
||||||
{
|
{
|
||||||
|
@ -294,12 +287,12 @@ Item
|
||||||
if (inheritStackProvider.properties.limit_to_extruder !== undefined && inheritStackProvider.properties.limit_to_extruder >= 0)
|
if (inheritStackProvider.properties.limit_to_extruder !== undefined && inheritStackProvider.properties.limit_to_extruder >= 0)
|
||||||
{
|
{
|
||||||
//We have limit_to_extruder, so pick that stack.
|
//We have limit_to_extruder, so pick that stack.
|
||||||
return Cura.ExtruderManager.extruderIds[inheritStackProvider.properties.limit_to_extruder];
|
return Cura.ExtruderManager.extruderIds[inheritStackProvider.properties.limit_to_extruder]
|
||||||
}
|
}
|
||||||
if (Cura.ExtruderManager.activeExtruderStackId)
|
if (Cura.ExtruderManager.activeExtruderStackId)
|
||||||
{
|
{
|
||||||
//We're on an extruder tab. Pick the current extruder.
|
//We're on an extruder tab. Pick the current extruder.
|
||||||
return Cura.ExtruderManager.activeExtruderStackId;
|
return Cura.ExtruderManager.activeExtruderStackId
|
||||||
}
|
}
|
||||||
//No extruder tab is selected. Pick the global stack. Shouldn't happen any more since we removed the global tab.
|
//No extruder tab is selected. Pick the global stack. Shouldn't happen any more since we removed the global tab.
|
||||||
return contents.activeMachineId
|
return contents.activeMachineId
|
||||||
|
@ -332,10 +325,10 @@ Item
|
||||||
target: item
|
target: item
|
||||||
function onContextMenuRequested()
|
function onContextMenuRequested()
|
||||||
{
|
{
|
||||||
contextMenu.key = model.key;
|
contextMenu.key = model.key
|
||||||
contextMenu.settingVisible = model.visible;
|
contextMenu.settingVisible = model.visible
|
||||||
contextMenu.provider = provider
|
contextMenu.provider = provider
|
||||||
contextMenu.popup();
|
contextMenu.popup() //iconName: model.icon_name
|
||||||
}
|
}
|
||||||
function onShowTooltip(text) { base.showTooltip(delegate, Qt.point(-settingsView.x - UM.Theme.getSize("default_margin").width, 0), text) }
|
function onShowTooltip(text) { base.showTooltip(delegate, Qt.point(-settingsView.x - UM.Theme.getSize("default_margin").width, 0), text) }
|
||||||
function onHideTooltip() { base.hideTooltip() }
|
function onHideTooltip() { base.hideTooltip() }
|
||||||
|
@ -350,36 +343,36 @@ Item
|
||||||
}
|
}
|
||||||
function onFocusReceived()
|
function onFocusReceived()
|
||||||
{
|
{
|
||||||
contents.indexWithFocus = index;
|
contents.indexWithFocus = index
|
||||||
animateContentY.from = contents.contentY;
|
animateContentY.from = contents.contentY
|
||||||
contents.positionViewAtIndex(index, ListView.Contain);
|
contents.positionViewAtIndex(index, ListView.Contain)
|
||||||
animateContentY.to = contents.contentY;
|
animateContentY.to = contents.contentY
|
||||||
animateContentY.running = true;
|
animateContentY.running = true
|
||||||
}
|
}
|
||||||
function onSetActiveFocusToNextSetting(forward)
|
function onSetActiveFocusToNextSetting(forward)
|
||||||
{
|
{
|
||||||
if (forward == undefined || forward)
|
if (forward == undefined || forward)
|
||||||
{
|
{
|
||||||
contents.currentIndex = contents.indexWithFocus + 1;
|
contents.currentIndex = contents.indexWithFocus + 1
|
||||||
while(contents.currentItem && contents.currentItem.height <= 0)
|
while(contents.currentItem && contents.currentItem.height <= 0)
|
||||||
{
|
{
|
||||||
contents.currentIndex++;
|
contents.currentIndex++
|
||||||
}
|
}
|
||||||
if (contents.currentItem)
|
if (contents.currentItem)
|
||||||
{
|
{
|
||||||
contents.currentItem.item.focusItem.forceActiveFocus();
|
contents.currentItem.item.focusItem.forceActiveFocus()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
contents.currentIndex = contents.indexWithFocus - 1;
|
contents.currentIndex = contents.indexWithFocus - 1
|
||||||
while(contents.currentItem && contents.currentItem.height <= 0)
|
while(contents.currentItem && contents.currentItem.height <= 0)
|
||||||
{
|
{
|
||||||
contents.currentIndex--;
|
contents.currentIndex--
|
||||||
}
|
}
|
||||||
if (contents.currentItem)
|
if (contents.currentItem)
|
||||||
{
|
{
|
||||||
contents.currentItem.item.focusItem.forceActiveFocus();
|
contents.currentItem.item.focusItem.forceActiveFocus()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -456,7 +449,6 @@ Item
|
||||||
UM.MenuItem
|
UM.MenuItem
|
||||||
{
|
{
|
||||||
text: model.name
|
text: model.name
|
||||||
//iconName: model.icon_name
|
|
||||||
onTriggered:
|
onTriggered:
|
||||||
{
|
{
|
||||||
customMenuItems.model.callMenuItemMethod(name, model.actions, {"key": contextMenu.key})
|
customMenuItems.model.callMenuItemMethod(name, model.actions, {"key": contextMenu.key})
|
||||||
|
@ -490,11 +482,11 @@ Item
|
||||||
{
|
{
|
||||||
if (contextMenu.settingVisible)
|
if (contextMenu.settingVisible)
|
||||||
{
|
{
|
||||||
return catalog.i18nc("@action:menu", "Don't show this setting");
|
return catalog.i18nc("@action:menu", "Don't show this setting")
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return catalog.i18nc("@action:menu", "Keep this setting visible");
|
return catalog.i18nc("@action:menu", "Keep this setting visible")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
visible: findingSettings
|
visible: findingSettings
|
||||||
|
@ -503,20 +495,20 @@ Item
|
||||||
{
|
{
|
||||||
if (contextMenu.settingVisible)
|
if (contextMenu.settingVisible)
|
||||||
{
|
{
|
||||||
definitionsModel.hide(contextMenu.key);
|
definitionsModel.hide(contextMenu.key)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
definitionsModel.show(contextMenu.key);
|
definitionsModel.show(contextMenu.key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UM.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...")
|
||||||
|
|
||||||
onTriggered: Cura.Actions.configureSettingVisibility.trigger(contextMenu);
|
onTriggered: Cura.Actions.configureSettingVisibility.trigger(contextMenu)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue