mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Merge branch 'master' of github.com:Ultimaker/Cura into replace_controls_1_for_controls_2
This commit is contained in:
commit
f682f56923
371 changed files with 41465 additions and 33048 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
@ -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")
|
||||
}
|
||||
|
||||
|
|
|
|||
46
resources/qml/Widgets/ScrollView.qml
Normal file
46
resources/qml/Widgets/ScrollView.qml
Normal 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 } }
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue