mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 22:58:58 +08:00
Remove 'roundedness' and 'shadow' from action-buttons.
Per the new UI design. Keep them as deprecated properties, so we may not need a major API/SDK increase just yet. contributes to CURA-8012
This commit is contained in:
parent
45977e109b
commit
e5d77a46d6
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2020 Ultimaker B.V.
|
// Copyright (c) 2021 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.7
|
import QtQuick 2.7
|
||||||
@ -18,7 +18,6 @@ Button
|
|||||||
property alias textFont: buttonText.font
|
property alias textFont: buttonText.font
|
||||||
property alias cornerRadius: backgroundRect.radius
|
property alias cornerRadius: backgroundRect.radius
|
||||||
property alias tooltip: tooltip.tooltipText
|
property alias tooltip: tooltip.tooltipText
|
||||||
property alias cornerSide: backgroundRect.cornerSide
|
|
||||||
|
|
||||||
property color color: UM.Theme.getColor("primary")
|
property color color: UM.Theme.getColor("primary")
|
||||||
property color hoverColor: UM.Theme.getColor("primary_hover")
|
property color hoverColor: UM.Theme.getColor("primary_hover")
|
||||||
@ -29,8 +28,6 @@ Button
|
|||||||
property color outlineColor: color
|
property color outlineColor: color
|
||||||
property color outlineHoverColor: hoverColor
|
property color outlineHoverColor: hoverColor
|
||||||
property color outlineDisabledColor: outlineColor
|
property color outlineDisabledColor: outlineColor
|
||||||
property alias shadowColor: shadow.color
|
|
||||||
property alias shadowEnabled: shadow.visible
|
|
||||||
property alias busy: busyIndicator.visible
|
property alias busy: busyIndicator.visible
|
||||||
|
|
||||||
property bool underlineTextOnHover: false
|
property bool underlineTextOnHover: false
|
||||||
@ -46,6 +43,49 @@ Button
|
|||||||
// but it can exceed a maximum, then this value have to be set.
|
// but it can exceed a maximum, then this value have to be set.
|
||||||
property int maximumWidth: 0
|
property int maximumWidth: 0
|
||||||
|
|
||||||
|
// These properties are deprecated.
|
||||||
|
// To (maybe) prevent a major SDK upgrade, mark them as deprecated instead of just outright removing them.
|
||||||
|
// Note, if you still want rounded corners, use (something based on) Cura.RoundedRectangle.
|
||||||
|
property alias cornerSide: deprecatedProperties.cornerSide
|
||||||
|
property alias shadowColor: deprecatedProperties.shadowColor
|
||||||
|
property alias shadowEnabled: deprecatedProperties.shadowEnabled
|
||||||
|
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
id: deprecatedProperties
|
||||||
|
|
||||||
|
visible: false
|
||||||
|
enabled: false
|
||||||
|
width: 0
|
||||||
|
height: 0
|
||||||
|
|
||||||
|
property var cornerSide: null
|
||||||
|
property var shadowColor: null
|
||||||
|
property var shadowEnabled: null
|
||||||
|
|
||||||
|
onCornerSideChanged:
|
||||||
|
{
|
||||||
|
if (cornerSide != null)
|
||||||
|
{
|
||||||
|
CuraApplication.writeToLog("w", "'ActionButton.cornerSide' is deprecated since 4.11. Rounded corners can still be made with 'Cura.RoundedRectangle'.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onShadowColorChanged:
|
||||||
|
{
|
||||||
|
if (shadowColor != null)
|
||||||
|
{
|
||||||
|
CuraApplication.writeToLog("w", "'ActionButton.shadowColor' is deprecated since 4.11.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onShadowEnabledChanged:
|
||||||
|
{
|
||||||
|
if (shadowEnabled != null)
|
||||||
|
{
|
||||||
|
CuraApplication.writeToLog("w", "'ActionButton.shadowEnabled' is deprecated since 4.11.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
leftPadding: UM.Theme.getSize("default_margin").width
|
leftPadding: UM.Theme.getSize("default_margin").width
|
||||||
rightPadding: UM.Theme.getSize("default_margin").width
|
rightPadding: UM.Theme.getSize("default_margin").width
|
||||||
height: UM.Theme.getSize("action_button").height
|
height: UM.Theme.getSize("action_button").height
|
||||||
@ -127,29 +167,14 @@ Button
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Cura.RoundedRectangle
|
background: Rectangle
|
||||||
{
|
{
|
||||||
id: backgroundRect
|
id: backgroundRect
|
||||||
cornerSide: Cura.RoundedRectangle.Direction.All
|
|
||||||
color: button.enabled ? (button.hovered ? button.hoverColor : button.color) : button.disabledColor
|
color: button.enabled ? (button.hovered ? button.hoverColor : button.color) : button.disabledColor
|
||||||
radius: UM.Theme.getSize("action_button_radius").width
|
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: button.enabled ? (button.hovered ? button.outlineHoverColor : button.outlineColor) : button.outlineDisabledColor
|
border.color: button.enabled ? (button.hovered ? button.outlineHoverColor : button.outlineColor) : button.outlineDisabledColor
|
||||||
}
|
}
|
||||||
|
|
||||||
DropShadow
|
|
||||||
{
|
|
||||||
id: shadow
|
|
||||||
// Don't blur the shadow
|
|
||||||
radius: 0
|
|
||||||
anchors.fill: backgroundRect
|
|
||||||
source: backgroundRect
|
|
||||||
verticalOffset: 2
|
|
||||||
visible: false
|
|
||||||
// Should always be drawn behind the background.
|
|
||||||
z: backgroundRect.z - 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Cura.ToolTip
|
Cura.ToolTip
|
||||||
{
|
{
|
||||||
id: tooltip
|
id: tooltip
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2018 Ultimaker B.V.
|
// Copyright (c) 2021 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.7
|
import QtQuick 2.7
|
||||||
@ -23,7 +23,6 @@ Item
|
|||||||
id: saveToButton
|
id: saveToButton
|
||||||
height: parent.height
|
height: parent.height
|
||||||
fixedWidthMode: true
|
fixedWidthMode: true
|
||||||
cornerSide: deviceSelectionMenu.visible ? Cura.RoundedRectangle.Direction.Left : Cura.RoundedRectangle.Direction.All
|
|
||||||
|
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
@ -48,10 +47,6 @@ Item
|
|||||||
id: deviceSelectionMenu
|
id: deviceSelectionMenu
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
|
||||||
shadowEnabled: true
|
|
||||||
shadowColor: UM.Theme.getColor("primary_shadow")
|
|
||||||
cornerSide: Cura.RoundedRectangle.Direction.Right
|
|
||||||
|
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
top: parent.top
|
top: parent.top
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2018 Ultimaker B.V.
|
// Copyright (c) 2021 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
@ -9,8 +9,6 @@ import Cura 1.1 as Cura
|
|||||||
|
|
||||||
Cura.ActionButton
|
Cura.ActionButton
|
||||||
{
|
{
|
||||||
shadowEnabled: true
|
|
||||||
shadowColor: enabled ? UM.Theme.getColor("primary_button_shadow"): UM.Theme.getColor("action_button_disabled_shadow")
|
|
||||||
color: UM.Theme.getColor("primary_button")
|
color: UM.Theme.getColor("primary_button")
|
||||||
textColor: UM.Theme.getColor("primary_button_text")
|
textColor: UM.Theme.getColor("primary_button_text")
|
||||||
outlineColor: "transparent"
|
outlineColor: "transparent"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2018 Ultimaker B.V.
|
// Copyright (c) 2021 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
@ -9,8 +9,6 @@ import Cura 1.1 as Cura
|
|||||||
|
|
||||||
Cura.ActionButton
|
Cura.ActionButton
|
||||||
{
|
{
|
||||||
shadowEnabled: true
|
|
||||||
shadowColor: enabled ? UM.Theme.getColor("secondary_button_shadow"): UM.Theme.getColor("action_button_disabled_shadow")
|
|
||||||
color: UM.Theme.getColor("secondary_button")
|
color: UM.Theme.getColor("secondary_button")
|
||||||
textColor: UM.Theme.getColor("secondary_button_text")
|
textColor: UM.Theme.getColor("secondary_button_text")
|
||||||
outlineColor: "transparent"
|
outlineColor: "transparent"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2020 Ultimaker B.V.
|
// Copyright (c) 2021 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
@ -9,8 +9,6 @@ import Cura 1.1 as Cura
|
|||||||
|
|
||||||
Cura.ActionButton
|
Cura.ActionButton
|
||||||
{
|
{
|
||||||
shadowEnabled: true
|
|
||||||
shadowColor: enabled ? UM.Theme.getColor("secondary_button_shadow"): UM.Theme.getColor("action_button_disabled_shadow")
|
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
textColor: UM.Theme.getColor("text_link")
|
textColor: UM.Theme.getColor("text_link")
|
||||||
outlineColor: "transparent"
|
outlineColor: "transparent"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user