Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Breeze Style for QQC2
Commits
c0acf067
Commit
c0acf067
authored
Feb 16, 2021
by
Noah Davis
🌵
Browse files
[ButtonBackground] only animate colors going to normal state
parent
4d8642b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
style/impl/ButtonBackground.qml
View file @
c0acf067
...
...
@@ -22,6 +22,15 @@ Kirigami.ShadowedRectangle {
property
real
leftRadius
:
!
isInButtonGroup
||
(
isLastInButtonGroup
&&
zeroOrLessSpacing
)
?
radius
:
0
property
real
rightRadius
:
!
isInButtonGroup
||
(
isFirstInButtonGroup
&&
zeroOrLessSpacing
)
?
radius
:
0
property
color
flatColor
:
Qt
.
rgba
(
Kirigami
.
Theme
.
backgroundColor
.
r
,
Kirigami
.
Theme
.
backgroundColor
.
g
,
Kirigami
.
Theme
.
backgroundColor
.
b
,
0
)
property
bool
highlightBackground
:
control
.
down
||
control
.
checked
property
bool
highlightBorder
:
control
.
enabled
&&
control
.
down
||
control
.
checked
||
control
.
highlighted
||
control
.
visualFocus
||
control
.
hovered
radius
:
Kirigami
.
Units
.
smallRadius
corners
{
topLeftRadius
:
leftRadius
...
...
@@ -36,14 +45,10 @@ Kirigami.ShadowedRectangle {
visible
:
!
control
.
flat
||
control
.
editable
||
control
.
down
||
control
.
checked
||
control
.
highlighted
||
control
.
visualFocus
||
control
.
hovered
color
:
{
if
(
control
.
down
||
control
.
checked
)
{
if
(
highlightBackground
)
{
Kirigami
.
Theme
.
alternateBackgroundColor
}
else
if
(
control
.
flat
)
{
return
Qt
.
rgba
(
control
.
palette
.
button
.
r
,
control
.
palette
.
button
.
g
,
control
.
palette
.
button
.
b
,
0
)
return
flatColor
}
else
{
control
.
palette
.
button
}
...
...
@@ -51,10 +56,8 @@ Kirigami.ShadowedRectangle {
border
{
color
:
{
if
(
control
.
enabled
&&
control
.
down
||
control
.
checked
||
control
.
highlighted
||
control
.
visualFocus
||
control
.
hovered
)
{
if
(
highlightBorder
)
{
return
Kirigami
.
Theme
.
focusColor
// } else if (control.flat) {
//return "transparent"
}
else
{
return
Kirigami
.
Theme
.
separatorColor
}
...
...
@@ -63,12 +66,14 @@ Kirigami.ShadowedRectangle {
}
Behavior
on
color
{
enabled
:
highlightBackground
ColorAnimation
{
duration
:
Kirigami
.
Units
.
shortDuration
easing.type
:
Easing
.
OutCubic
}
}
Behavior
on
border.color
{
enabled
:
highlightBorder
ColorAnimation
{
duration
:
Kirigami
.
Units
.
shortDuration
easing.type
:
Easing
.
OutCubic
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment