mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 03:55:56 +08:00
Finish styling mode switch buttons
This commit is contained in:
parent
4f77b2ea6d
commit
1686f951c9
@ -168,6 +168,8 @@ Rectangle
|
||||
|
||||
Button
|
||||
{
|
||||
id: control
|
||||
|
||||
height: settingsModeSelection.height
|
||||
width: Math.floor(0.5 * parent.width)
|
||||
|
||||
@ -196,20 +198,22 @@ Rectangle
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Text
|
||||
{
|
||||
text: model.text
|
||||
color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") : control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
||||
font: control.font
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
background: Rectangle
|
||||
{
|
||||
border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width
|
||||
border.color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active_border") : control.hovered ? UM.Theme.getColor("action_button_hovered_border"): UM.Theme.getColor("action_button_border")
|
||||
|
||||
// for some reason, QtQuick decided to use the color of the background property as text color for the contentItem, so here it is
|
||||
color: (control.checked || control.pressed) ? UM.Theme.getColor("action_button_active") : control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
||||
}
|
||||
|
||||
contentItem: Text
|
||||
{
|
||||
text: model.text
|
||||
font: UM.Theme.getFont("default")
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user