@ -39,13 +39,6 @@ KCM.GridViewKCM {
restoreMode: Binding . RestoreBinding
}
Binding {
target: kcm
property: "applyAccentColorFromWallpaper"
value: wallpaperAccentBox . checked
restoreMode: Binding . RestoreBinding
}
KCM . SettingStateBinding {
configObject: kcm . colorsSettings
settingName: "colorScheme"
@ -149,10 +142,10 @@ KCM.GridViewKCM {
Kirigami.FormData.label: i18n ( "Use accent color:" )
text: i18n ( "From current color scheme" )
checked: Qt . colorEqual ( kcm . accentColor , "transparent" ) && ! kcm . applyAccentColorFromWallpaper
checked: Qt . colorEqual ( kcm . accentColor , "transparent" )
onToggled: {
if ( enabl ed) {
if ( check ed) {
kcm . accentColor = "transparent"
}
}
@ -164,8 +157,8 @@ KCM.GridViewKCM {
checked: kcm . applyAccentColorFromWallpaper
onToggled: {
if ( enabl ed) {
kcm . applyWallpaperAccentColor ( ) ;
if ( check ed) {
kcm . applyAccentColorFromWallpaper = true ;
}
}
}
@ -177,23 +170,10 @@ KCM.GridViewKCM {
checked: ! Qt . colorEqual ( kcm . accentColor , "transparent" ) && ! kcm . applyAccentColorFromWallpaper
onToggled: {
if ( enabl ed) {
if ( check ed) {
kcm . accentColor = colorRepeater . model [ 0 ]
}
}
/ * T h i s r e q u i r e d w h e n s o m e o n e d i r e c t l y c l i c k s o n e o f t h e a c c e n t c o l o r b u t t o n s o r t h e c o l o r p i c k e r i n s t e a d
* of first checking this button . Failing to call this function in those situations will leave this button unchecked
* which was the previous behaviour .
* NOTE: Currently user is able to dicrectly toggle the accentColor buttons or the color picker . If in future the situation
* becomes such that the user must toggle this button first then just remove all the occurrences of this function
* /
function restartBindingWithCheckedAsTrue ( ) {
if ( ! accentBox . checked ) {
accentBox . checked = true
accentBox . checked = Qt . binding ( ( ) = > ! Qt . colorEqual ( kcm . accentColor , "transparent" ) && ! kcm . applyAccentColorFromWallpaper )
}
}
}
RowLayout {
@ -257,7 +237,6 @@ KCM.GridViewKCM {
checked: Qt . colorEqual ( kcm . accentColor , modelData )
onToggled: {
accentBox . restartBindingWithCheckedAsTrue ( )
kcm . accentColor = modelData
checked = Qt . binding ( ( ) = > Qt . colorEqual ( kcm . accentColor , modelData ) ) ;
}
@ -278,7 +257,6 @@ KCM.GridViewKCM {
modality: Qt . ApplicationModal
color: kcm . accentColor
onAccepted: {
accentBox . restartBindingWithCheckedAsTrue ( )
kcm . accentColor = colorDialog . color
}
}
@ -286,8 +264,8 @@ KCM.GridViewKCM {
ColorRadioButton {
id: customColorIndicator
readonly property bool isCustomColor: ! wallpaperAccentBox . checked
&& root . accentColor
readonly property bool isCustomColor: ! kcm . applyAccentColorFromWallpaper
&& ! Qt . colorEqual ( kcm . accentColor , "transparent" )
&& ! colorRepeater . model . some ( color = > Qt . colorEqual ( color , root . accentColor ) )
/ * T h e q t b i n d i n g w i l l k e e p t h e b i n d i n g a l i v e a s w e l l a s u n c h e c k t h e b u t t o n