Merge branch 'master' of github.com:Ultimaker/Cura into replace_controls_1_for_controls_2

This commit is contained in:
Jaime van Kessel 2022-02-17 15:02:03 +01:00
commit f682f56923
371 changed files with 41465 additions and 33048 deletions

View file

@ -15,6 +15,7 @@ Button
property bool isIconOnRightSide: false
property alias iconSource: buttonIconLeft.source
property real iconSize: UM.Theme.getSize("action_button_icon").height
property alias textFont: buttonText.font
property alias cornerRadius: backgroundRect.radius
property alias tooltip: tooltip.tooltipText
@ -109,7 +110,7 @@ Button
{
id: buttonIconLeft
source: ""
height: visible ? UM.Theme.getSize("action_button_icon").height : 0
height: visible ? button.iconSize : 0
width: visible ? height : 0
sourceSize.width: width
sourceSize.height: height
@ -156,7 +157,7 @@ Button
{
id: buttonIconRight
source: buttonIconLeft.source
height: visible ? UM.Theme.getSize("action_button_icon").height : 0
height: visible ? button.iconSize : 0
width: visible ? height : 0
sourceSize.width: width
sourceSize.height: height

View file

@ -71,6 +71,7 @@ Item
property alias configureSettingVisibility: configureSettingVisibilityAction
property alias browsePackages: browsePackagesAction
property alias openMarketplace: openMarketplaceAction
UM.I18nCatalog{id: catalog; name: "cura"}
@ -482,4 +483,11 @@ Item
text: "&Marketplace"
icon.name: "plugins_browse"
}
Action
{
id: openMarketplaceAction
text: catalog.i18nc("@action:menu", "&Marketplace")
iconName: "plugins_browse"
}
}

View file

@ -1,60 +0,0 @@
// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Controls 2.1
import UM 1.5 as UM
CheckBox
{
id: checkbox
hoverEnabled: true
property alias tooltip: tooltip.text
indicator: Rectangle
{
implicitWidth: UM.Theme.getSize("checkbox").width
implicitHeight: UM.Theme.getSize("checkbox").height
x: 0
anchors.verticalCenter: parent.verticalCenter
color: UM.Theme.getColor("main_background")
radius: UM.Theme.getSize("checkbox_radius").width
border.width: UM.Theme.getSize("default_lining").width
border.color: checkbox.hovered ? UM.Theme.getColor("checkbox_border_hover") : UM.Theme.getColor("checkbox_border")
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(parent.width / 2.5)
height: Math.round(parent.height / 2.5)
sourceSize.height: width
color: UM.Theme.getColor("checkbox_mark")
source: UM.Theme.getIcon("Check")
opacity: checkbox.checked
Behavior on opacity { NumberAnimation { duration: 100; } }
}
}
contentItem: UM.Label
{
anchors
{
left: checkbox.indicator.right
leftMargin: UM.Theme.getSize("narrow_margin").width
}
text: checkbox.text
color: UM.Theme.getColor("checkbox_text")
elide: Text.ElideRight
}
ToolTip
{
id: tooltip
text: ""
delay: 500
visible: text != "" && checkbox.hovered
}
}

View file

@ -5,8 +5,14 @@ import QtQuick 2.2
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.1
<<<<<<< HEAD
import UM 1.3 as UM
import Cura 1.5 as Cura
=======
import UM 1.5 as UM
import Cura 1.0 as Cura
>>>>>>> e66628e2da80d38637b58288f5e478f8ae4a74ba
UM.Dialog
{
@ -84,7 +90,7 @@ UM.Dialog
wrapMode: Text.WordWrap
}
CheckBox
UM.CheckBox
{
id: rememberChoiceCheckBox
text: catalog.i18nc("@text:window", "Remember my choice")

View file

@ -5,7 +5,7 @@ import QtQuick 2.10
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import UM 1.3 as UM
import UM 1.5 as UM
import Cura 1.1 as Cura
@ -20,7 +20,7 @@ UM.TooltipArea
property int controlHeight: UM.Theme.getSize("setting_control").height
height: childrenRect.height
height: controlHeight
width: childrenRect.width
text: tooltip
@ -57,13 +57,16 @@ UM.TooltipArea
renderType: Text.NativeRendering
}
Cura.CheckBox
UM.CheckBox
{
id: checkBox
anchors.left: fieldLabel.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors {
left: fieldLabel.right
leftMargin: UM.Theme.getSize("default_margin").width
verticalCenter: parent.verticalCenter
}
checked: String(propertyProvider.properties.value).toLowerCase() != 'false'
height: simpleCheckBox.controlHeight
height: UM.Theme.getSize("checkbox").height
text: ""
onClicked:
{

View file

@ -111,4 +111,4 @@ Item
extensionMenu.extensionModel.callExtensionMethod("Toolbox", "setViewCategoryToMaterials")
}
}
}
}

View file

@ -199,4 +199,4 @@ UM.PreferencesPage
UM.SettingVisibilityItem { }
}
}
}
}

View file

@ -0,0 +1,35 @@
// Copyright (C) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.1
import UM 1.6 as UM
import Cura 1.7 as Cura
Cura.TextField
{
UM.I18nCatalog { id: catalog; name: "cura" }
leftPadding: searchIcon.width + UM.Theme.getSize("default_margin").width * 2
placeholderText: catalog.i18nc("@placeholder", "Search")
font.italic: true
UM.RecolorImage
{
id: searchIcon
anchors
{
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: UM.Theme.getSize("default_margin").width
}
source: UM.Theme.getIcon("Magnifier")
height: UM.Theme.getSize("small_button_icon").height
width: height
color: UM.Theme.getColor("text")
}
}

View file

@ -85,20 +85,20 @@ SettingItem
{
anchors
{
top: parent.top
bottom: parent.bottom
verticalCenter: parent.verticalCenter
left: parent.left
}
width: height
width: UM.Theme.getSize("checkbox").width
height: width
radius: UM.Theme.getSize("setting_control_radius").width
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")
return UM.Theme.getColor("checkbox_border")
}
switch (propertyProvider.properties.validationState)
{
@ -114,7 +114,7 @@ SettingItem
// Validation is OK.
if (control.containsMouse || control.activeFocus || hovered)
{
return UM.Theme.getColor("setting_control_border_highlight")
return UM.Theme.getColor("checkbox_border_hover")
}
return UM.Theme.getColor("setting_control_border")
}
@ -122,7 +122,7 @@ SettingItem
color: {
if (!enabled)
{
return UM.Theme.getColor("setting_control_disabled")
return UM.Theme.getColor("checkbox_disabled")
}
switch (propertyProvider.properties.validationState)
{
@ -140,18 +140,18 @@ SettingItem
{
return UM.Theme.getColor("setting_control_highlight")
}
return UM.Theme.getColor("setting_control")
return UM.Theme.getColor("checkbox")
}
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(parent.width / 2.5)
height: Math.round(parent.height / 2.5)
height: UM.Theme.getSize("checkbox_mark").height
width: UM.Theme.getSize("checkbox_mark").width
sourceSize.height: width
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text");
source: UM.Theme.getIcon("Check")
source: UM.Theme.getIcon("Check", "low")
opacity: control.checked ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100; } }
}

View file

@ -16,4 +16,5 @@ Cura.ActionButton
textDisabledColor: UM.Theme.getColor("action_button_disabled_text")
hoverColor: "transparent"
underlineTextOnHover: true
iconSize: UM.Theme.getSize("action_button_icon_small").height
}

View file

@ -38,7 +38,7 @@ ToolTip
onAboutToHide: hide()
// If the text is not set, just set the height to 0 to prevent it from showing
height: text != "" ? label.contentHeight + 2 * UM.Theme.getSize("thin_margin").width: 0
height: label.contentHeight + 2 * UM.Theme.getSize("thin_margin").width
x:
{
@ -73,7 +73,7 @@ ToolTip
}
function show() {
opacity = 1
opacity = text != "" ? 1 : 0
}
function hide() {

View file

@ -1,74 +0,0 @@
// Copyright (c) 2021 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.5 as UM
import Cura 1.1 as Cura
//
// Checkbox with Cura styling.
//
CheckBox
{
id: control
hoverEnabled: true
indicator: Rectangle
{
width: control.height
height: control.height
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("setting_control_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
width: Math.round(parent.width / 2.5)
height: Math.round(parent.height / 2.5)
sourceSize.height: width
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text")
source: UM.Theme.getIcon("Check")
opacity: control.checked ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100; } }
}
}
contentItem: UM.Label
{
id: textLabel
leftPadding: control.indicator.width + control.spacing
text: control.text
font: control.font
}
}

View file

@ -37,7 +37,7 @@ UM.MenuItem
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
source: UM.Theme.getIcon("Check")
source: UM.Theme.getIcon("Check", "low")
color: UM.Theme.getColor("setting_control_text")
}

View file

@ -0,0 +1,46 @@
// 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.1 as UM
ScrollView
{
clip: true
// Setting this property to false hides the scrollbar both when the scrollbar is not needed (child height < height)
// and when the scrollbar is not actively being hovered or pressed
property bool scrollAlwaysVisible: true
ScrollBar.vertical: ScrollBar
{
hoverEnabled: true
policy: parent.scrollAlwaysVisible ? ScrollBar.AlwaysOn : ScrollBar.AsNeeded
anchors.top: parent.top
anchors.right: parent.right
anchors.bottom: parent.bottom
contentItem: Rectangle
{
implicitWidth: UM.Theme.getSize("scrollbar").width
opacity: (parent.active || parent.parent.scrollAlwaysVisible) ? 1.0 : 0.0
radius: Math.round(width / 2)
color:
{
if (parent.pressed)
{
return UM.Theme.getColor("scrollbar_handle_down")
}
else if (parent.hovered)
{
return UM.Theme.getColor("scrollbar_handle_hover")
}
return UM.Theme.getColor("scrollbar_handle")
}
Behavior on color { ColorAnimation { duration: 100; } }
Behavior on opacity { NumberAnimation { duration: 100 } }
}
}
}

View file

@ -17,7 +17,6 @@ ViewsSelector 1.0 ViewsSelector.qml
ToolbarButton 1.0 ToolbarButton.qml
SettingView 1.0 SettingView.qml
ProfileMenu 1.0 ProfileMenu.qml
CheckBoxWithTooltip 1.0 CheckBoxWithTooltip.qml
ToolTip 1.0 ToolTip.qml
@ -29,7 +28,6 @@ WizardDialog 1.0 WizardDialog.qml
# Cura/Widgets
CheckBox 1.0 CheckBox.qml
ComboBox 1.0 ComboBox.qml
NotificationIcon 1.0 NotificationIcon.qml
RadioButton 1.0 RadioButton.qml