diff --git a/kcmkwin/kwinrules/ruleswidget.cpp b/kcmkwin/kwinrules/ruleswidget.cpp index 3798777640..6600e14c39 100644 --- a/kcmkwin/kwinrules/ruleswidget.cpp +++ b/kcmkwin/kwinrules/ruleswidget.cpp @@ -21,8 +21,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -102,6 +104,7 @@ RulesWidget::RulesWidget(QWidget* parent) SETUP(above, set); SETUP(below, set); SETUP(noborder, set); + SETUP(decocolor, force); SETUP(skiptaskbar, set); SETUP(skippager, set); SETUP(skipswitcher, set); @@ -152,6 +155,9 @@ RulesWidget::RulesWidget(QWidget* parent) activity->addItem(i18n("All Activities"), QString::fromLatin1(NULL_UUID)); #undef NULL_UUID #endif + + KColorSchemeManager *schemes = new KColorSchemeManager(this); + decocolor->setModel(schemes->model()); } #undef SETUP @@ -181,6 +187,7 @@ UPDATE_ENABLE_SLOT(placement) UPDATE_ENABLE_SLOT(above) UPDATE_ENABLE_SLOT(below) UPDATE_ENABLE_SLOT(noborder) +UPDATE_ENABLE_SLOT(decocolor) UPDATE_ENABLE_SLOT(skiptaskbar) UPDATE_ENABLE_SLOT(skippager) UPDATE_ENABLE_SLOT(skipswitcher) @@ -456,6 +463,21 @@ void RulesWidget::setRules(Rules* rules) CHECKBOX_SET_RULE(above,); CHECKBOX_SET_RULE(below,); CHECKBOX_SET_RULE(noborder,); + auto decoColorToCombo = [this](const QString &value) { + for (int i = 0; i < decocolor->count(); ++i) { + if (decocolor->itemData(i).toString() == value) { + return i; + } + } + // search for Oxygen + for (int i = 0; i < decocolor->count(); ++i) { + if (QFileInfo(decocolor->itemData(i).toString()).baseName() == QStringLiteral("Oxygen")) { + return i; + } + } + return 0; + }; + COMBOBOX_FORCE_RULE(decocolor, decoColorToCombo); CHECKBOX_SET_RULE(skiptaskbar,); CHECKBOX_SET_RULE(skippager,); CHECKBOX_SET_RULE(skipswitcher,); @@ -555,6 +577,10 @@ Rules* RulesWidget::rules() const CHECKBOX_SET_RULE(above,); CHECKBOX_SET_RULE(below,); CHECKBOX_SET_RULE(noborder,); + auto comboToDecocolor = [this](int index) -> QString { + return QFileInfo(decocolor->itemData(index).toString()).baseName(); + }; + COMBOBOX_FORCE_RULE(decocolor, comboToDecocolor); CHECKBOX_SET_RULE(skiptaskbar,); CHECKBOX_SET_RULE(skippager,); CHECKBOX_SET_RULE(skipswitcher,); diff --git a/kcmkwin/kwinrules/ruleswidget.h b/kcmkwin/kwinrules/ruleswidget.h index 8bc4d6d7e1..78ea28c513 100644 --- a/kcmkwin/kwinrules/ruleswidget.h +++ b/kcmkwin/kwinrules/ruleswidget.h @@ -73,6 +73,7 @@ private Q_SLOTS: void updateEnableabove(); void updateEnablebelow(); void updateEnablenoborder(); + void updateEnabledecocolor(); void updateEnableskiptaskbar(); void updateEnableskippager(); void updateEnableskipswitcher(); diff --git a/kcmkwin/kwinrules/ruleswidgetbase.ui b/kcmkwin/kwinrules/ruleswidgetbase.ui index a2faad9814..ecf0d99b84 100644 --- a/kcmkwin/kwinrules/ruleswidgetbase.ui +++ b/kcmkwin/kwinrules/ruleswidgetbase.ui @@ -24,7 +24,7 @@ - De&scription: + &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -106,7 +106,7 @@ - Window &role: + Window ro&le: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -1902,7 +1902,36 @@ like your complete screen area. Appearance && &Fixes - + + + + false + + + + + + + false + + + + Do Not Affect + + + + + Force + + + + + Force Temporarily + + + + + Block compositing @@ -1953,21 +1982,21 @@ like your complete screen area. - + Qt::Horizontal - + A&ctive opacity - + Qt::Horizontal @@ -1980,29 +2009,7 @@ like your complete screen area. - - - - false - - - - Do Not Affect - - - - - Force - - - - - Force Temporarily - - - - - + false @@ -2018,14 +2025,14 @@ like your complete screen area. - + I&nactive opacity - + false @@ -2047,7 +2054,7 @@ like your complete screen area. - + false @@ -2063,7 +2070,7 @@ like your complete screen area. - + Qt::Vertical @@ -2079,7 +2086,7 @@ like your complete screen area. - + Windows may prevent to get the focus (activate) when being clicked. @@ -2091,7 +2098,7 @@ from getting focused on a mouse click. - + false @@ -2113,14 +2120,14 @@ from getting focused on a mouse click. - - - - false + + + + Qt::Horizontal - + When used, a window will receive @@ -2140,7 +2147,7 @@ while it's active! - + false @@ -2162,35 +2169,35 @@ while it's active! - - - - Qt::Horizontal - - - - - - - false - - - - + &Closeable - + Window &type - + + + + false + + + + + + + Qt::Horizontal + + + + false @@ -2212,7 +2219,7 @@ while it's active! - + false @@ -2264,7 +2271,7 @@ while it's active! - + Qt::Vertical @@ -2280,21 +2287,21 @@ while it's active! - - + + Qt::Horizontal - + false - + Qt::Vertical @@ -2307,14 +2314,14 @@ while it's active! - + false - + Qt::Horizontal @@ -2327,13 +2334,6 @@ while it's active! - - - - Qt::Horizontal - - - @@ -2341,7 +2341,7 @@ while it's active! - + false @@ -2363,51 +2363,7 @@ while it's active! - - - - false - - - - Do Not Affect - - - - - Force - - - - - Force Temporarily - - - - - - - - false - - - - Do Not Affect - - - - - Force - - - - - Force Temporarily - - - - - + false @@ -2439,7 +2395,51 @@ while it's active! - + + + + false + + + + Do Not Affect + + + + + Force + + + + + Force Temporarily + + + + + + + + false + + + + Do Not Affect + + + + + Force + + + + + Force Temporarily + + + + + KWin tries to prevent windows from taking the focus @@ -2453,6 +2453,42 @@ but this may sometimes fail or superact. + + + + Titlebar color &scheme + + + + + + + false + + + + + + + false + + + + Do Not Affect + + + + + Force + + + + + Force Temporarily + + + + @@ -2461,14 +2497,9 @@ but this may sometimes fail or superact. - KComboBox - QComboBox -
kcombobox.h
-
- - KLineEdit - QLineEdit -
klineedit.h
+ KRestrictedLine + KLineEdit +
krestrictedline.h
KPushButton @@ -2476,9 +2507,14 @@ but this may sometimes fail or superact.
kpushbutton.h
- KRestrictedLine - KLineEdit -
krestrictedline.h
+ KLineEdit + QLineEdit +
klineedit.h
+
+ + KComboBox + QComboBox +
kcombobox.h
YesNoBox