The visibility settings in the preferences is defined in Uranium rather than Cura. The CheckBox has been moved to Uranium so that all parts of the project have access to this default styled component.

This commit is contained in:
j.delarago 2022-01-24 14:03:47 +01:00
parent 17339ba77e
commit 5788ea8d00
10 changed files with 30 additions and 144 deletions

View file

@ -228,7 +228,7 @@ Item
width: childrenRect.width width: childrenRect.width
spacing: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width
Cura.CheckBox UM.CheckBox
{ {
id: asProjectCheckbox id: asProjectCheckbox
height: UM.Theme.getSize("checkbox").height height: UM.Theme.getSize("checkbox").height
@ -238,7 +238,7 @@ Item
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
} }
Cura.CheckBox UM.CheckBox
{ {
id: asSlicedCheckbox id: asSlicedCheckbox
height: UM.Theme.getSize("checkbox").height height: UM.Theme.getSize("checkbox").height

View file

@ -18,7 +18,7 @@ UM.TooltipArea
width: childrenRect.width; width: childrenRect.width;
height: childrenRect.height; height: childrenRect.height;
Cura.CheckBox UM.CheckBox
{ {
id: check id: check

View file

@ -57,7 +57,7 @@ UM.Dialog
onTextChanged: settingPickDialog.updateFilter() onTextChanged: settingPickDialog.updateFilter()
} }
Cura.CheckBox UM.CheckBox
{ {
id: toggleShowAll id: toggleShowAll
anchors anchors

View file

@ -33,7 +33,7 @@ Cura.MachineAction
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
Cura.CheckBox UM.CheckBox
{ {
anchors.top: pageDescription.bottom anchors.top: pageDescription.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height

View file

@ -92,7 +92,7 @@ UM.Dialog
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
Cura.CheckBox UM.CheckBox
{ {
id: rememberChoiceCheckBox id: rememberChoiceCheckBox
text: catalog.i18nc("@text:window", "Remember my choice") text: catalog.i18nc("@text:window", "Remember my choice")

View file

@ -275,7 +275,7 @@ UM.Dialog
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
Cura.CheckBox UM.CheckBox
{ {
id: dontShowAgainCheckbox id: dontShowAgainCheckbox
anchors.left: parent.left anchors.left: parent.left

View file

@ -57,7 +57,7 @@ UM.TooltipArea
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
Cura.CheckBox UM.CheckBox
{ {
id: checkBox id: checkBox
anchors { anchors {

View file

@ -304,7 +304,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip", "Slice automatically when changing settings.") text: catalog.i18nc("@info:tooltip", "Slice automatically when changing settings.")
Cura.CheckBox UM.CheckBox
{ {
id: autoSliceCheckbox id: autoSliceCheckbox
checked: boolCheck(UM.Preferences.getValue("general/auto_slice")) checked: boolCheck(UM.Preferences.getValue("general/auto_slice"))
@ -334,7 +334,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip", "Highlight unsupported areas of the model in red. Without support these areas will not print properly.") text: catalog.i18nc("@info:tooltip", "Highlight unsupported areas of the model in red. Without support these areas will not print properly.")
Cura.CheckBox UM.CheckBox
{ {
id: showOverhangCheckbox id: showOverhangCheckbox
@ -353,7 +353,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip", "Highlight missing or extraneous surfaces of the model using warning signs. The toolpaths will often be missing parts of the intended geometry.") text: catalog.i18nc("@info:tooltip", "Highlight missing or extraneous surfaces of the model using warning signs. The toolpaths will often be missing parts of the intended geometry.")
Cura.CheckBox UM.CheckBox
{ {
id: showXrayErrorCheckbox id: showXrayErrorCheckbox
@ -370,7 +370,7 @@ UM.PreferencesPage
height: childrenRect.height; height: childrenRect.height;
text: catalog.i18nc("@info:tooltip", "Moves the camera so the model is in the center of the view when a model is selected") text: catalog.i18nc("@info:tooltip", "Moves the camera so the model is in the center of the view when a model is selected")
Cura.CheckBox UM.CheckBox
{ {
id: centerOnSelectCheckbox id: centerOnSelectCheckbox
text: catalog.i18nc("@action:button","Center camera when item is selected"); text: catalog.i18nc("@action:button","Center camera when item is selected");
@ -385,7 +385,7 @@ UM.PreferencesPage
height: childrenRect.height; height: childrenRect.height;
text: catalog.i18nc("@info:tooltip", "Should the default zoom behavior of cura be inverted?") text: catalog.i18nc("@info:tooltip", "Should the default zoom behavior of cura be inverted?")
Cura.CheckBox UM.CheckBox
{ {
id: invertZoomCheckbox id: invertZoomCheckbox
text: catalog.i18nc("@action:button", "Invert the direction of camera zoom."); text: catalog.i18nc("@action:button", "Invert the direction of camera zoom.");
@ -406,7 +406,7 @@ UM.PreferencesPage
height: childrenRect.height; height: childrenRect.height;
text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthographic perspective.") text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthographic perspective.")
Cura.CheckBox UM.CheckBox
{ {
id: zoomToMouseCheckbox id: zoomToMouseCheckbox
text: catalog.i18nc("@action:button", "Zoom toward mouse direction") text: catalog.i18nc("@action:button", "Zoom toward mouse direction")
@ -437,7 +437,7 @@ UM.PreferencesPage
height: childrenRect.height height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved so that they no longer intersect?") text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved so that they no longer intersect?")
Cura.CheckBox UM.CheckBox
{ {
id: pushFreeCheckbox id: pushFreeCheckbox
text: catalog.i18nc("@option:check", "Ensure models are kept apart") text: catalog.i18nc("@option:check", "Ensure models are kept apart")
@ -451,7 +451,7 @@ UM.PreferencesPage
height: childrenRect.height height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved down to touch the build plate?") text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved down to touch the build plate?")
Cura.CheckBox UM.CheckBox
{ {
id: dropDownCheckbox id: dropDownCheckbox
text: catalog.i18nc("@option:check", "Automatically drop models to the build plate") text: catalog.i18nc("@option:check", "Automatically drop models to the build plate")
@ -468,7 +468,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip","Show caution message in g-code reader.") text: catalog.i18nc("@info:tooltip","Show caution message in g-code reader.")
Cura.CheckBox UM.CheckBox
{ {
id: gcodeShowCautionCheckbox id: gcodeShowCautionCheckbox
@ -485,7 +485,7 @@ UM.PreferencesPage
height: childrenRect.height height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should layer be forced into compatibility mode?") text: catalog.i18nc("@info:tooltip", "Should layer be forced into compatibility mode?")
Cura.CheckBox UM.CheckBox
{ {
id: forceLayerViewCompatibilityModeCheckbox id: forceLayerViewCompatibilityModeCheckbox
text: catalog.i18nc("@option:check", "Force layer view compatibility mode (restart required)") text: catalog.i18nc("@option:check", "Force layer view compatibility mode (restart required)")
@ -500,7 +500,7 @@ UM.PreferencesPage
height: childrenRect.height height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should Cura open at the location it was closed?") text: catalog.i18nc("@info:tooltip", "Should Cura open at the location it was closed?")
Cura.CheckBox UM.CheckBox
{ {
id: restoreWindowPositionCheckbox id: restoreWindowPositionCheckbox
text: catalog.i18nc("@option:check", "Restore window position on start") text: catalog.i18nc("@option:check", "Restore window position on start")
@ -575,7 +575,7 @@ UM.PreferencesPage
height: childrenRect.height height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Should opening files from the desktop or external applications open in the same instance of Cura?") text: catalog.i18nc("@info:tooltip","Should opening files from the desktop or external applications open in the same instance of Cura?")
Cura.CheckBox UM.CheckBox
{ {
id: singleInstanceCheckbox id: singleInstanceCheckbox
text: catalog.i18nc("@option:check","Use a single instance of Cura") text: catalog.i18nc("@option:check","Use a single instance of Cura")
@ -591,7 +591,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip","Should the build plate be cleared before loading a new model in the single instance of Cura?") text: catalog.i18nc("@info:tooltip","Should the build plate be cleared before loading a new model in the single instance of Cura?")
enabled: singleInstanceCheckbox.checked enabled: singleInstanceCheckbox.checked
Cura.CheckBox UM.CheckBox
{ {
id: singleInstanceClearBeforeLoadCheckbox id: singleInstanceClearBeforeLoadCheckbox
text: catalog.i18nc("@option:check","Clear buildplate before loading model into the single instance") text: catalog.i18nc("@option:check","Clear buildplate before loading model into the single instance")
@ -606,7 +606,7 @@ UM.PreferencesPage
height: childrenRect.height height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?") text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?")
Cura.CheckBox UM.CheckBox
{ {
id: scaleToFitCheckbox id: scaleToFitCheckbox
text: catalog.i18nc("@option:check","Scale large models") text: catalog.i18nc("@option:check","Scale large models")
@ -621,7 +621,7 @@ UM.PreferencesPage
height: childrenRect.height height: childrenRect.height
text: catalog.i18nc("@info:tooltip","An model may appear extremely small if its unit is for example in meters rather than millimeters. Should these models be scaled up?") text: catalog.i18nc("@info:tooltip","An model may appear extremely small if its unit is for example in meters rather than millimeters. Should these models be scaled up?")
Cura.CheckBox UM.CheckBox
{ {
id: scaleTinyCheckbox id: scaleTinyCheckbox
text: catalog.i18nc("@option:check","Scale extremely small models") text: catalog.i18nc("@option:check","Scale extremely small models")
@ -636,7 +636,7 @@ UM.PreferencesPage
height: childrenRect.height height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Should models be selected after they are loaded?") text: catalog.i18nc("@info:tooltip","Should models be selected after they are loaded?")
Cura.CheckBox UM.CheckBox
{ {
id: selectModelsOnLoadCheckbox id: selectModelsOnLoadCheckbox
text: catalog.i18nc("@option:check","Select models when loaded") text: catalog.i18nc("@option:check","Select models when loaded")
@ -651,7 +651,7 @@ UM.PreferencesPage
height: childrenRect.height height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?") text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?")
Cura.CheckBox UM.CheckBox
{ {
id: prefixJobNameCheckbox id: prefixJobNameCheckbox
text: catalog.i18nc("@option:check", "Add machine prefix to job name") text: catalog.i18nc("@option:check", "Add machine prefix to job name")
@ -666,7 +666,7 @@ UM.PreferencesPage
height: childrenRect.height height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?") text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?")
Cura.CheckBox UM.CheckBox
{ {
text: catalog.i18nc("@option:check", "Show summary dialog when saving project") text: catalog.i18nc("@option:check", "Show summary dialog when saving project")
checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save")) checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save"))
@ -811,7 +811,7 @@ UM.PreferencesPage
height: visible ? childrenRect.height : 0 height: visible ? childrenRect.height : 0
text: catalog.i18nc("@info:tooltip", "Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.") text: catalog.i18nc("@info:tooltip", "Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.")
Cura.CheckBox UM.CheckBox
{ {
id: sendDataCheckbox id: sendDataCheckbox
text: catalog.i18nc("@option:check","Send (anonymous) print information") text: catalog.i18nc("@option:check","Send (anonymous) print information")
@ -850,7 +850,7 @@ UM.PreferencesPage
height: visible ? childrenRect.height : 0 height: visible ? childrenRect.height : 0
text: catalog.i18nc("@info:tooltip", "Should Cura check for updates when the program is started?") text: catalog.i18nc("@info:tooltip", "Should Cura check for updates when the program is started?")
Cura.CheckBox UM.CheckBox
{ {
id: checkUpdatesCheckbox id: checkUpdatesCheckbox
text: catalog.i18nc("@option:check","Check for updates on start") text: catalog.i18nc("@option:check","Check for updates on start")
@ -898,7 +898,7 @@ UM.PreferencesPage
height: visible ? childrenRect.height : 0 height: visible ? childrenRect.height : 0
text: catalog.i18nc("@info:tooltip", "Should an automatic check for new plugins be done every time Cura is started? It is highly recommended that you do not disable this!") text: catalog.i18nc("@info:tooltip", "Should an automatic check for new plugins be done every time Cura is started? It is highly recommended that you do not disable this!")
Cura.CheckBox UM.CheckBox
{ {
id: pluginNotificationsUpdateCheckbox id: pluginNotificationsUpdateCheckbox
text: catalog.i18nc("@option:check", "Get notifications for plugin updates") text: catalog.i18nc("@option:check", "Get notifications for plugin updates")

View file

@ -36,7 +36,7 @@ UM.PreferencesPage
id: base; id: base;
anchors.fill: parent; anchors.fill: parent;
Cura.CheckBox UM.CheckBox
{ {
id: toggleVisibleSettings id: toggleVisibleSettings
anchors anchors

View file

@ -1,114 +0,0 @@
// Copyright (c) 2020 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10
import QtQuick.Controls 2.3
import UM 1.3 as UM
import Cura 1.1 as Cura
//
// Checkbox with Cura styling.
//
CheckBox
{
id: control
hoverEnabled: true
indicator: Rectangle
{
height: UM.Theme.getSize("checkbox").height
width: UM.Theme.getSize("checkbox").width
anchors.verticalCenter: parent.verticalCenter
color:
{
if (!control.enabled)
{
return UM.Theme.getColor("setting_control_disabled")
}
if (control.hovered || control.activeFocus)
{
return UM.Theme.getColor("setting_control_highlight")
}
return UM.Theme.getColor("setting_control")
}
radius: UM.Theme.getSize("checkbox_radius").width
border.width: UM.Theme.getSize("default_lining").width
border.color:
{
if (!enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if (control.hovered || control.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
return UM.Theme.getColor("setting_control_border")
}
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
height:
{
switch(control.checkState)
{
case Qt.Checked: return UM.Theme.getSize("checkbox_mark").height
case Qt.PartiallyChecked: return UM.Theme.getSize("checkbox_square").height
default: UM.Theme.getSize("checkbox_mark").height
}
}
width: height
sourceSize.height: height
color:
{
switch(control.checkState)
{
case Qt.Checked: return !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("checkbox_mark")
case Qt.PartiallyChecked: return !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("checkbox_square")
default: return !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("checkbox_mark")
}
}
source:
{
switch (control.checkState)
{
case Qt.Checked: return UM.Theme.getIcon("EmptyCheck", "low")
case Qt.PartiallyChecked: return UM.Theme.getIcon("CheckBoxFill", "low")
default: return UM.Theme.getIcon("EmptyCheck", "low")
}
}
opacity:
{
switch (control.checkState)
{
case Qt.Checked: return 1;
case Qt.PartiallyChecked: return 1;
default: 0;
}
}
Behavior on opacity { NumberAnimation { duration: 100; } }
}
}
contentItem: Label
{
id: textLabel
anchors.left: control.indicator.right
leftPadding: UM.Theme.getSize("checkbox_label_padding").width
text: control.text
font: control.font
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
verticalAlignment: Text.AlignVCenter
}
}