mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-10 07:09:02 +08:00
Make some items' size dependent on parent's. Also make the ActionButton
more themable. Contributes to CURA-5784.
This commit is contained in:
parent
0a07f48375
commit
fdfa81b2b8
@ -30,6 +30,7 @@ Column
|
||||
id: information
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
renderType: Text.NativeRendering
|
||||
text: loggedIn ? profile["username"] : catalog.i18nc("@label", "Please log in or create an account to\nenjoy all features of Ultimaker Cura.")
|
||||
font: loggedIn ? UM.Theme.getFont("large") : UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
|
@ -21,7 +21,6 @@ Button
|
||||
{
|
||||
id: avatar
|
||||
|
||||
|
||||
width: Math.round(0.8 * parent.width)
|
||||
height: Math.round(0.8 * parent.height)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
@ -11,28 +11,28 @@ Button
|
||||
{
|
||||
id: button
|
||||
property alias cursorShape: mouseArea.cursorShape
|
||||
property var iconSource: ""
|
||||
property alias iconSource: buttonIcon.source
|
||||
property alias textFont: buttonText.font
|
||||
property alias cornerRadius: backgroundRect.radius
|
||||
property var color: UM.Theme.getColor("primary")
|
||||
property var hoverColor: UM.Theme.getColor("primary_hover")
|
||||
property var disabledColor: color
|
||||
property var textColor: UM.Theme.getColor("button_text")
|
||||
property var textHoverColor: UM.Theme.getColor("button_text_hover")
|
||||
property var textDisabledColor: textColor
|
||||
property var textFont: UM.Theme.getFont("action_button")
|
||||
property var cornerRadius: 2 * screenScaleFactor
|
||||
|
||||
contentItem: Row
|
||||
{
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: buttonIcon
|
||||
source: button.iconSource
|
||||
width: 16 * screenScaleFactor
|
||||
height: 16 * screenScaleFactor
|
||||
source: ""
|
||||
height: Math.round(0.6 * parent.height)
|
||||
width: height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: button.hovered ? button.textHoverColor : button.textColor
|
||||
visible: button.iconSource != ""
|
||||
visible: source != ""
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
@ -41,8 +41,8 @@ Button
|
||||
id: buttonText
|
||||
text: button.text
|
||||
color: button.enabled ? (button.hovered ? button.textHoverColor : button.textColor): button.textDisabledColor
|
||||
font: button.textFont
|
||||
visible: button.text != ""
|
||||
font: UM.Theme.getFont("action_button")
|
||||
visible: text != ""
|
||||
renderType: Text.NativeRendering
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
@ -50,8 +50,9 @@ Button
|
||||
|
||||
background: Rectangle
|
||||
{
|
||||
id: backgroundRect
|
||||
color: button.enabled ? (button.hovered ? button.hoverColor : button.color) : button.disabledColor
|
||||
radius: cornerRadius
|
||||
radius: UM.Theme.getSize("action_button_radius").width
|
||||
}
|
||||
|
||||
MouseArea
|
||||
|
@ -490,6 +490,8 @@
|
||||
|
||||
"avatar_image": [6.8, 6.8],
|
||||
|
||||
"action_button_radius": [0.25, 0.25],
|
||||
|
||||
"drop_shadow_radius": [1.0, 1.0]
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user