mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 00:34:22 +02:00
Small fix to buttons color
This commit is contained in:
parent
784f669998
commit
82d6d3ff01
2 changed files with 35 additions and 11 deletions
|
@ -16,7 +16,10 @@ import "../styles-uit"
|
|||
|
||||
Original.Button {
|
||||
id: button
|
||||
|
||||
property int color: 0
|
||||
property int colorScheme: hifi.colorShemes.light
|
||||
|
||||
width: 120
|
||||
height: 28
|
||||
|
||||
|
@ -24,27 +27,43 @@ Original.Button {
|
|||
|
||||
background: Rectangle {
|
||||
radius: hifi.buttons.radius
|
||||
|
||||
gradient: Gradient {
|
||||
GradientStop {
|
||||
position: 0.2
|
||||
color: enabled
|
||||
? (!pressed && button.color != hifi.buttons.black || (!hovered || pressed) && button.color == hifi.buttons.black
|
||||
? hifi.buttons.colorStart[button.color] : hifi.buttons.colorFinish[button.color])
|
||||
: hifi.buttons.colorStart[hifi.buttons.white]
|
||||
color: {
|
||||
if (!enabled) {
|
||||
hifi.buttons.disabledColorStart[button.colorScheme]
|
||||
} else if (pressed) {
|
||||
hifi.buttons.pressedColor[button.color]
|
||||
} else if (hovered) {
|
||||
hifi.buttons.hoveredColor[button.color]
|
||||
} else {
|
||||
hifi.buttons.colorStart[button.color]
|
||||
}
|
||||
}
|
||||
}
|
||||
GradientStop {
|
||||
position: 1.0
|
||||
color: enabled
|
||||
? ((!hovered || pressed) && button.color != hifi.buttons.black || !pressed && button.color == hifi.buttons.black
|
||||
? hifi.buttons.colorFinish[button.color] : hifi.buttons.colorStart[button.color])
|
||||
: hifi.buttons.colorFinish[hifi.buttons.white]
|
||||
color: {
|
||||
if (!enabled) {
|
||||
hifi.buttons.disabledColorFinish[button.colorScheme]
|
||||
} else if (pressed) {
|
||||
hifi.buttons.pressedColor[button.color]
|
||||
} else if (hovered) {
|
||||
hifi.buttons.hoveredColor[button.color]
|
||||
} else {
|
||||
hifi.buttons.colorFinish[button.color]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
label: RalewayBold {
|
||||
font.capitalization: Font.AllUppercase
|
||||
color: enabled ? hifi.buttons.textColor[button.color] : hifi.colors.lightGrayText
|
||||
color: enabled ? hifi.buttons.textColor[button.color]
|
||||
: hifi.buttons.disabledTextColor[button.colorScheme]
|
||||
size: hifi.fontSizes.buttonLabel
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
|
|
@ -159,8 +159,13 @@ Item {
|
|||
readonly property int red: 2
|
||||
readonly property int black: 3
|
||||
readonly property var textColor: [ colors.darkGray, colors.white, colors.white, colors.white ]
|
||||
readonly property var colorStart: [ "#ffffff", "#00b4ef", "#d42043", "#343434" ]
|
||||
readonly property var colorFinish: [ "#afafaf", "#1080b8", "#94132e", "#000000" ]
|
||||
readonly property var colorStart: [ colors.white, colors.primaryHighlight, "#d42043", "#343434" ]
|
||||
readonly property var colorFinish: [ colors.lightGrayText, colors.blueAccent, "#94132e", colors.black ]
|
||||
readonly property var hoveredColor: [ colorStart[white], colorStart[blue], colorStart[red], colorFinish[black] ]
|
||||
readonly property var pressedColor: [ colorFinish[white], colorFinish[blue], colorFinish[red], colorStart[black] ]
|
||||
readonly property var disabledColorStart: [ colorStart[white], colors.baseGrayHighlight]
|
||||
readonly property var disabledColorFinish: [ colorFinish[white], colors.baseGrayShadow]
|
||||
readonly property var disabledTextColor: [ colors.lightGrayText, colors.baseGrayShadow]
|
||||
readonly property int radius: 5
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue