[kde-doc-english] [kde-workspace] kcontrol/colors: Add colour settings for active/inactive title bar blend colours

Jonathan Marten jjm at keelhaul.me.uk
Thu Apr 21 08:42:19 CEST 2011


Git commit b739e3953fd2755fc3a1781479eb0ccccb97b1dd by Jonathan Marten.
Committed on 21/04/2011 at 08:38.
Pushed by marten into branch 'master'.

Add colour settings for active/inactive title bar blend colours

These are still used by KDE2 and some other window decorations.

Use "Secondary" instead of "Blend" as suggested in review.
Also reorder the items so that the 3 "Active" settings come
together, followed by the 3 "Inactive" settings.

BUG:225837
REVIEW:100821
FIXED_IN:4.7.0
GUI:
I18N:

M  +26   -10   kcontrol/colors/colorscm.cpp     
M  +4    -2    kcontrol/colors/colorscm.h     
M  +21   -1    kcontrol/colors/colorsettings.ui     

http://commits.kde.org/kde-workspace/b739e3953fd2755fc3a1781479eb0ccccb97b1dd

diff --git a/kcontrol/colors/colorscm.cpp b/kcontrol/colors/colorscm.cpp
index 622ab8a..ba7697d 100644
--- a/kcontrol/colors/colorscm.cpp
+++ b/kcontrol/colors/colorscm.cpp
@@ -63,6 +63,8 @@ void KColorCm::WindecoColors::load(const KSharedConfigPtr &config)
     m_colors[ActiveForeground] = group.readEntry("activeForeground", QColor(255, 255, 255));
     m_colors[InactiveBackground] = group.readEntry("inactiveBackground", QColor(224, 223, 222));
     m_colors[InactiveForeground] = group.readEntry("inactiveForeground", QColor(75, 71, 67));
+    m_colors[ActiveBlend] = group.readEntry("activeBlend", m_colors[ActiveForeground]);
+    m_colors[InactiveBlend] = group.readEntry("inactiveBlend", m_colors[InactiveForeground]);
 }
 
 QColor KColorCm::WindecoColors::color(WindecoColors::Role role) const
@@ -372,8 +374,10 @@ void KColorCm::on_schemeImportButton_clicked()
             m_commonColorButtons[19]->setColor(g.readEntry("windowForeground", m_colorSchemes[KColorScheme::Tooltip].foreground().color()));
             m_commonColorButtons[20]->setColor(g.readEntry("activeBackground", m_wmColors.color(WindecoColors::ActiveBackground)));
             m_commonColorButtons[21]->setColor(g.readEntry("activeForeground", m_wmColors.color(WindecoColors::ActiveForeground)));
-            m_commonColorButtons[22]->setColor(g.readEntry("inactiveBackground", m_wmColors.color(WindecoColors::InactiveBackground)));
-            m_commonColorButtons[23]->setColor(g.readEntry("inactiveForeground", m_wmColors.color(WindecoColors::InactiveForeground)));
+            m_commonColorButtons[22]->setColor(g.readEntry("activeBlend", m_wmColors.color(WindecoColors::ActiveBlend)));
+            m_commonColorButtons[23]->setColor(g.readEntry("inactiveBackground", m_wmColors.color(WindecoColors::InactiveBackground)));
+            m_commonColorButtons[24]->setColor(g.readEntry("inactiveForeground", m_wmColors.color(WindecoColors::InactiveForeground)));
+            m_commonColorButtons[25]->setColor(g.readEntry("inactiveBlend", m_wmColors.color(WindecoColors::InactiveBlend)));
 
             colorSet->setCurrentIndex(1);
             m_backgroundButtons[KColorScheme::AlternateBackground]->setColor(g.readEntry("alternateBackground",
@@ -641,6 +645,8 @@ void KColorCm::updateFromColorSchemes()
     WMGroup.writeEntry("activeForeground", m_wmColors.color(WindecoColors::ActiveForeground));
     WMGroup.writeEntry("inactiveBackground", m_wmColors.color(WindecoColors::InactiveBackground));
     WMGroup.writeEntry("inactiveForeground", m_wmColors.color(WindecoColors::InactiveForeground));
+    WMGroup.writeEntry("activeBlend", m_wmColors.color(WindecoColors::ActiveBlend));
+    WMGroup.writeEntry("inactiveBlend", m_wmColors.color(WindecoColors::InactiveBlend));
 }
 
 void KColorCm::updateFromOptions()
@@ -732,7 +738,7 @@ void KColorCm::setupColorTable()
     commonColorTable->horizontalHeader()->setMinimumSectionSize(minWidth);
     commonColorTable->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents);
 
-    for (int i = 0; i < 24; ++i)
+    for (int i = 0; i < 26; ++i)
     {
         KColorButton * button = new KColorButton(this);
         commonColorTable->setRowHeight(i, button->sizeHint().height());
@@ -871,8 +877,10 @@ void KColorCm::updateColorTable()
 
         m_commonColorButtons[20]->setColor(m_wmColors.color(WindecoColors::ActiveBackground));
         m_commonColorButtons[21]->setColor(m_wmColors.color(WindecoColors::ActiveForeground));
-        m_commonColorButtons[22]->setColor(m_wmColors.color(WindecoColors::InactiveBackground));
-        m_commonColorButtons[23]->setColor(m_wmColors.color(WindecoColors::InactiveForeground));
+        m_commonColorButtons[22]->setColor(m_wmColors.color(WindecoColors::ActiveBlend));
+        m_commonColorButtons[23]->setColor(m_wmColors.color(WindecoColors::InactiveBackground));
+        m_commonColorButtons[24]->setColor(m_wmColors.color(WindecoColors::InactiveForeground));
+        m_commonColorButtons[25]->setColor(m_wmColors.color(WindecoColors::InactiveBlend));
 
         foreach (button, m_commonColorButtons)
         {
@@ -1046,21 +1054,29 @@ void KColorCm::changeColor(int row, const QColor &newColor)
                 KConfigGroup(m_config, "Colors:Tooltip").writeEntry("ForegroundNormal", newColor);
                 break;
             case 20:
-                // Active Window
+                // Active Title Background
                 KConfigGroup(m_config, "WM").writeEntry("activeBackground", newColor);
                 break;
             case 21:
-                // Active Window Text
+                // Active Title Text
                 KConfigGroup(m_config, "WM").writeEntry("activeForeground", newColor);
                 break;
             case 22:
-                // Inactive Window
-                KConfigGroup(m_config, "WM").writeEntry("inactiveBackground", newColor);
+                // Active Title Secondary
+                KConfigGroup(m_config, "WM").writeEntry("activeBlend", newColor);
                 break;
             case 23:
-                // Inactive Window Text
+                // Inactive Title Background
+                KConfigGroup(m_config, "WM").writeEntry("inactiveBackground", newColor);
+                break;
+            case 24:
+                // Inactive Title Text
                 KConfigGroup(m_config, "WM").writeEntry("inactiveForeground", newColor);
                 break;
+            case 25:
+                // Inactive Title Secondary
+                KConfigGroup(m_config, "WM").writeEntry("inactiveBlend", newColor);
+                break;
         }
         m_commonColorButtons[row]->blockSignals(true);
         m_commonColorButtons[row]->setColor(newColor);
diff --git a/kcontrol/colors/colorscm.h b/kcontrol/colors/colorscm.h
index 7627db8..c88567a 100644
--- a/kcontrol/colors/colorscm.h
+++ b/kcontrol/colors/colorscm.h
@@ -117,7 +117,9 @@ private:
                 ActiveForeground = 0,
                 ActiveBackground = 1,
                 InactiveForeground = 2,
-                InactiveBackground = 3
+                InactiveBackground = 3,
+                ActiveBlend = 4,
+                InactiveBlend = 5
             };
 
             WindecoColors() {}
@@ -127,7 +129,7 @@ private:
             void load(const KSharedConfigPtr&);
             QColor color(Role) const;
         private:
-            QColor m_colors[4];
+            QColor m_colors[6];
     };
 
     /** create a preview of a color scheme */
diff --git a/kcontrol/colors/colorsettings.ui b/kcontrol/colors/colorsettings.ui
index efd618b..9db7130 100644
--- a/kcontrol/colors/colorsettings.ui
+++ b/kcontrol/colors/colorsettings.ui
@@ -470,6 +470,16 @@
                <string>New Row</string>
               </property>
              </row>
+             <row>
+              <property name="text">
+               <string>New Row</string>
+              </property>
+             </row>
+             <row>
+              <property name="text">
+               <string>New Row</string>
+              </property>
+             </row>
              <column>
               <property name="text">
                <string>0</string>
@@ -592,14 +602,24 @@
              </item>
              <item row="22" column="0">
               <property name="text">
-               <string>Inactive Titlebar</string>
+               <string>Active Titlebar Secondary</string>
               </property>
              </item>
              <item row="23" column="0">
               <property name="text">
+               <string>Inactive Titlebar</string>
+              </property>
+             </item>
+             <item row="24" column="0">
+              <property name="text">
                <string>Inactive Titlebar Text</string>
               </property>
              </item>
+             <item row="25" column="0">
+              <property name="text">
+               <string>Inactive Titlebar Secondary</string>
+              </property>
+             </item>
             </widget>
            </item>
           </layout>


More information about the kde-doc-english mailing list