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
Plasma Breeze visual style
Commits
dd3b1893
Commit
dd3b1893
authored
Sep 21, 2020
by
Jan Blackquill
🌈
Committed by
Nate Graham
Sep 21, 2020
Browse files
[kstyle]: Make buttons use KColorScheme::Button for hover and focus colours
BUG: 426651 (cherry picked from commit
659e3d35
)
parent
5b7f4970
Changes
2
Hide whitespace changes
Inline
Side-by-side
kstyle/breezehelper.cpp
View file @
dd3b1893
...
...
@@ -41,6 +41,8 @@ namespace Breeze
{
_viewFocusBrush
=
KStatefulBrush
(
KColorScheme
::
View
,
KColorScheme
::
FocusColor
);
_viewHoverBrush
=
KStatefulBrush
(
KColorScheme
::
View
,
KColorScheme
::
HoverColor
);
_buttonFocusBrush
=
KStatefulBrush
(
KColorScheme
::
Button
,
KColorScheme
::
FocusColor
);
_buttonHoverBrush
=
KStatefulBrush
(
KColorScheme
::
Button
,
KColorScheme
::
HoverColor
);
_viewNegativeTextBrush
=
KStatefulBrush
(
KColorScheme
::
View
,
KColorScheme
::
NegativeText
);
_viewNeutralTextBrush
=
KStatefulBrush
(
KColorScheme
::
View
,
KColorScheme
::
NeutralText
);
...
...
@@ -97,11 +99,11 @@ namespace Breeze
//____________________________________________________________________
QColor
Helper
::
buttonFocusOutlineColor
(
const
QPalette
&
palette
)
const
{
return
KColorUtils
::
mix
(
f
ocusColor
(
palette
),
palette
.
color
(
QPalette
::
ButtonText
),
0.15
);
}
{
return
KColorUtils
::
mix
(
buttonF
ocusColor
(
palette
),
palette
.
color
(
QPalette
::
ButtonText
),
0.15
);
}
//____________________________________________________________________
QColor
Helper
::
buttonHoverOutlineColor
(
const
QPalette
&
palette
)
const
{
return
KColorUtils
::
mix
(
h
overColor
(
palette
),
palette
.
color
(
QPalette
::
ButtonText
),
0.15
);
}
{
return
KColorUtils
::
mix
(
buttonH
overColor
(
palette
),
palette
.
color
(
QPalette
::
ButtonText
),
0.15
);
}
//____________________________________________________________________
QColor
Helper
::
sidePanelOutlineColor
(
const
QPalette
&
palette
,
bool
hasFocus
,
qreal
opacity
,
AnimationMode
mode
)
const
...
...
@@ -190,7 +192,7 @@ namespace Breeze
}
else
{
const
QColor
hover
(
h
overColor
(
palette
)
);
const
QColor
hover
(
buttonH
overColor
(
palette
)
);
outline
=
KColorUtils
::
mix
(
outline
,
hover
,
opacity
);
}
...
...
@@ -198,7 +200,7 @@ namespace Breeze
}
else
if
(
mouseOver
)
{
if
(
hasFocus
)
outline
=
buttonHoverOutlineColor
(
palette
);
else
outline
=
h
overColor
(
palette
);
else
outline
=
buttonH
overColor
(
palette
);
}
else
if
(
mode
==
AnimationFocus
)
{
...
...
@@ -226,22 +228,22 @@ namespace Breeze
if
(
mode
==
AnimationHover
)
{
const
QColor
focus
(
f
ocusColor
(
palette
)
);
const
QColor
hover
(
h
overColor
(
palette
)
);
const
QColor
focus
(
buttonF
ocusColor
(
palette
)
);
const
QColor
hover
(
buttonH
overColor
(
palette
)
);
if
(
hasFocus
)
background
=
KColorUtils
::
mix
(
focus
,
hover
,
opacity
);
}
else
if
(
mouseOver
&&
hasFocus
)
{
background
=
h
overColor
(
palette
);
background
=
buttonH
overColor
(
palette
);
}
else
if
(
mode
==
AnimationFocus
)
{
const
QColor
focus
(
f
ocusColor
(
palette
)
);
const
QColor
focus
(
buttonF
ocusColor
(
palette
)
);
background
=
KColorUtils
::
mix
(
background
,
focus
,
opacity
);
}
else
if
(
hasFocus
)
{
background
=
f
ocusColor
(
palette
);
background
=
buttonF
ocusColor
(
palette
);
}
...
...
@@ -254,8 +256,8 @@ namespace Breeze
{
QColor
outline
;
const
QColor
hoverColor
(
this
->
h
overColor
(
palette
)
);
const
QColor
focusColor
(
this
->
f
ocusColor
(
palette
)
);
const
QColor
hoverColor
(
buttonH
overColor
(
palette
)
);
const
QColor
focusColor
(
buttonF
ocusColor
(
palette
)
);
const
QColor
sunkenColor
=
alphaColor
(
palette
.
color
(
QPalette
::
WindowText
),
0.2
);
// hover takes precedence over focus
...
...
kstyle/breezehelper.h
View file @
dd3b1893
...
...
@@ -55,6 +55,14 @@ namespace Breeze
QColor
focusColor
(
const
QPalette
&
palette
)
const
{
return
_viewFocusBrush
.
brush
(
palette
).
color
();
}
//* mouse over color for buttons
QColor
buttonHoverColor
(
const
QPalette
&
palette
)
const
{
return
_buttonHoverBrush
.
brush
(
palette
).
color
();
}
//* focus color for buttons
QColor
buttonFocusColor
(
const
QPalette
&
palette
)
const
{
return
_buttonFocusBrush
.
brush
(
palette
).
color
();
}
//* negative text color (used for close button)
QColor
negativeText
(
const
QPalette
&
palette
)
const
{
return
_viewNegativeTextBrush
.
brush
(
palette
).
color
();
}
...
...
@@ -291,6 +299,8 @@ namespace Breeze
//@{
KStatefulBrush
_viewFocusBrush
;
KStatefulBrush
_viewHoverBrush
;
KStatefulBrush
_buttonFocusBrush
;
KStatefulBrush
_buttonHoverBrush
;
KStatefulBrush
_viewNegativeTextBrush
;
KStatefulBrush
_viewNeutralTextBrush
;
//@}
...
...
Write
Preview
Markdown
is supported
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