[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdebase
From:       Krzysztof Lichota <lichota () mimuw ! edu ! pl>
Date:       2007-02-23 16:59:47
Message-ID: 1172249987.649037.21208.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 636638 by klichota:

Implemented often-requested changing of font colors for taskbar.

Details here:
http://lists.kde.org/?l=kde-devel&m=117145563500995&w=2

FEATURE: 118460
GUI:



 M  +16 -0     kcontrol/taskbar/kcmtaskbar.cpp  
 M  +1 -0      kcontrol/taskbar/kcmtaskbar.h  
 M  +146 -0    kcontrol/taskbar/kcmtaskbarui.ui  
 M  +20 -0     kicker/taskbar/taskbar.kcfg  
 M  +17 -1     kicker/taskbar/taskcontainer.cpp  


--- branches/KDE/3.5/kdebase/kcontrol/taskbar/kcmtaskbar.cpp #636637:636638
@@ -30,6 +30,8 @@
 #include <kdialog.h>
 #include <kgenericfactory.h>
 #include <kwin.h>
+#include <kcolorbutton.h>
+#include <qlabel.h>
 
 #define protected public
 #include "kcmtaskbarui.h"
@@ -152,7 +154,9 @@
 
     connect(m_widget->kcfg_GroupTasks, SIGNAL(activated(int)),
             this, SLOT(slotUpdateComboBox()));
+    connect(m_widget->kcfg_UseCustomColors, SIGNAL(stateChanged(int)), this, \
SLOT(slotUpdateCustomColors()));  
+    slotUpdateCustomColors();
     updateAppearanceCombo();
 
     if (KWin::numberOfDesktops() < 2)
@@ -183,6 +187,18 @@
     QTimer::singleShot(0, this, SLOT(notChanged()));
 }
 
+void TaskbarConfig::slotUpdateCustomColors()
+{
+    m_widget->kcfg_ActiveTaskTextColor->setEnabled(m_widget->kcfg_UseCustomColors->isChecked());
 +    m_widget->activeTaskTextColorLabel->setEnabled(m_widget->kcfg_UseCustomColors->isChecked());
 +    
+    m_widget->kcfg_InactiveTaskTextColor->setEnabled(m_widget->kcfg_UseCustomColors->isChecked());
 +    m_widget->inactiveTaskTextColorLabel->setEnabled(m_widget->kcfg_UseCustomColors->isChecked());
 +    
+    m_widget->kcfg_TaskBackgroundColor->setEnabled(m_widget->kcfg_UseCustomColors->isChecked());
 +    m_widget->taskBackgroundColorLabel->setEnabled(m_widget->kcfg_UseCustomColors->isChecked());
 +}
+
 void TaskbarConfig::slotUpdateComboBox()
 {
     int pos = TaskBarSettings::ActivateRaiseOrMinimize;
--- branches/KDE/3.5/kdebase/kcontrol/taskbar/kcmtaskbar.h #636637:636638
@@ -64,6 +64,7 @@
     void slotUpdateComboBox();
     void appearanceChanged(int);
     void notChanged();
+    void slotUpdateCustomColors();
 
 private:
     TaskbarAppearance::List m_appearances;
--- branches/KDE/3.5/kdebase/kcontrol/taskbar/kcmtaskbarui.ui #636637:636638
@@ -177,6 +177,141 @@
                         <cstring>appearance</cstring>
                     </property>
                 </widget>
+                <widget class="QCheckBox" row="9" column="0" rowspan="1" \
colspan="2"> +                    <property name="name">
+                        <cstring>kcfg_UseCustomColors</cstring>
+                    </property>
+                    <property name="enabled">
+                        <bool>true</bool>
+                    </property>
+                    <property name="text">
+                        <string>Use &amp;custom colors</string>
+                    </property>
+                    <property name="accel">
+                        <string>Alt+C</string>
+                    </property>
+                    <property name="checked">
+                        <bool>true</bool>
+                    </property>
+                </widget>
+                <widget class="QLayoutWidget" row="10" column="0" rowspan="1" \
colspan="3"> +                    <property name="name">
+                        <cstring>layout9</cstring>
+                    </property>
+                    <grid>
+                        <property name="name">
+                            <cstring>unnamed</cstring>
+                        </property>
+                        <spacer row="1" column="2">
+                            <property name="name">
+                                <cstring>spacer11_2</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>191</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget class="KColorButton" row="0" column="1">
+                            <property name="name">
+                                <cstring>kcfg_InactiveTaskTextColor</cstring>
+                            </property>
+                            <property name="text">
+                                <string></string>
+                            </property>
+                        </widget>
+                        <spacer row="0" column="2">
+                            <property name="name">
+                                <cstring>spacer11</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>191</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget class="KColorButton" row="2" column="1">
+                            <property name="name">
+                                <cstring>kcfg_TaskBackgroundColor</cstring>
+                            </property>
+                            <property name="text">
+                                <string></string>
+                            </property>
+                        </widget>
+                        <widget class="QLabel" row="2" column="0">
+                            <property name="name">
+                                <cstring>taskBackgroundColorLabel</cstring>
+                            </property>
+                            <property name="text">
+                                <string>&amp;Background color:</string>
+                            </property>
+                            <property name="buddy" stdset="0">
+                                <cstring>kcfg_TaskBackgroundColor</cstring>
+                            </property>
+                        </widget>
+                        <widget class="KColorButton" row="1" column="1">
+                            <property name="name">
+                                <cstring>kcfg_ActiveTaskTextColor</cstring>
+                            </property>
+                            <property name="text">
+                                <string></string>
+                            </property>
+                        </widget>
+                        <widget class="QLabel" row="0" column="0">
+                            <property name="name">
+                                <cstring>inactiveTaskTextColorLabel</cstring>
+                            </property>
+                            <property name="text">
+                                <string>Inacti&amp;ve task text color:</string>
+                            </property>
+                            <property name="buddy" stdset="0">
+                                <cstring>kcfg_InactiveTaskTextColor</cstring>
+                            </property>
+                        </widget>
+                        <widget class="QLabel" row="1" column="0">
+                            <property name="name">
+                                <cstring>activeTaskTextColorLabel</cstring>
+                            </property>
+                            <property name="text">
+                                <string>Active task te&amp;xt color:</string>
+                            </property>
+                            <property name="buddy" stdset="0">
+                                <cstring>kcfg_ActiveTaskTextColor</cstring>
+                            </property>
+                        </widget>
+                        <spacer row="2" column="2">
+                            <property name="name">
+                                <cstring>spacer12</cstring>
+                            </property>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
+                            </property>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>191</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                    </grid>
+                </widget>
                 <spacer row="1" column="0">
                     <property name="name">
                         <cstring>spacer2</cstring>
@@ -323,10 +458,16 @@
     <tabstop>kcfg_ShowAllWindows</tabstop>
     <tabstop>kcfg_SortByDesktop</tabstop>
     <tabstop>showAllScreens</tabstop>
+    <tabstop>kcfg_SortByApp</tabstop>
     <tabstop>kcfg_ShowOnlyIconified</tabstop>
     <tabstop>kcfg_ShowIcon</tabstop>
     <tabstop>kcfg_ShowWindowListBtn</tabstop>
     <tabstop>kcfg_GroupTasks</tabstop>
+    <tabstop>appearance</tabstop>
+    <tabstop>kcfg_UseCustomColors</tabstop>
+    <tabstop>kcfg_InactiveTaskTextColor</tabstop>
+    <tabstop>kcfg_ActiveTaskTextColor</tabstop>
+    <tabstop>kcfg_TaskBackgroundColor</tabstop>
     <tabstop>kcfg_LeftButtonAction</tabstop>
     <tabstop>kcfg_MiddleButtonAction</tabstop>
     <tabstop>kcfg_RightButtonAction</tabstop>
@@ -336,4 +477,9 @@
 </includes>
 <layoutdefaults spacing="3" margin="6"/>
 <layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+    <includehint>kcolorbutton.h</includehint>
+    <includehint>kcolorbutton.h</includehint>
+    <includehint>kcolorbutton.h</includehint>
+</includehints>
 </UI>
--- branches/KDE/3.5/kdebase/kicker/taskbar/taskbar.kcfg #636637:636638
@@ -149,5 +149,25 @@
             <label>Maximum width/height of the thumbnail in pixels</label>
             <whatsthis>A thumbnail is created by resizing the window. The scaling \
factor is determined by its largest dimension and this value. In doing so, the \
thumbnail's size will not exceed this value in any dimension.</whatsthis>  </entry>
+        <entry key="UseCustomColors" type="Bool" >
+            <default>false</default>
+            <label>Use custom colors for taskbar buttons text and background</label>
+            <whatsthis>Turning this option on will allow choosing your own colors \
for taskbar buttons text and background.</whatsthis> +        </entry>
+        <entry name="ActiveTaskTextColor" type="Color" >
+            <label>Color to use for active task button text</label>
+            <default code="true">QColor()</default>
+            <whatsthis>This color is used for displaying text on taskbar button for \
task which is active at the moment.</whatsthis> +        </entry>
+        <entry name="InactiveTaskTextColor" type="Color" >
+            <label>Color to use for inactive tasks button text</label>
+            <default code="true">QColor()</default>
+            <whatsthis>This color is used for displaying text on taskbar button for \
tasks other than active.</whatsthis> +        </entry>
+        <entry name="TaskBackgroundColor" type="Color" >
+            <label>Color to use for taskbar buttons background</label>
+            <default code="true">QColor()</default>
+            <whatsthis>This color is used for displaying background of taskbar \
buttons.</whatsthis> +        </entry>
     </group>
 </kcfg>
--- branches/KDE/3.5/kdebase/kicker/taskbar/taskcontainer.cpp #636637:636638
@@ -544,6 +544,15 @@
     font.setBold(active);
 
     QColorGroup colors = palette().active();
+    
+    if (TaskBarSettings::useCustomColors())
+    {
+        colors.setColor( QColorGroup::Button, \
TaskBarSettings::taskBackgroundColor()); +        colors.setColor( \
QColorGroup::Background, TaskBarSettings::taskBackgroundColor() ); +        \
colors.setColor( QColorGroup::ButtonText, TaskBarSettings::inactiveTaskTextColor() ); \
+        colors.setColor( QColorGroup::Text, TaskBarSettings::inactiveTaskTextColor() \
); +    }
+    
     if (demandsAttention)
     {
         if (!drawButton)
@@ -682,7 +691,14 @@
         }
         else // hack for the dotNET style and others
         {
-            textPen = p->pen();
+            if (TaskBarSettings::useCustomColors())
+            {
+                textPen = QPen(TaskBarSettings::activeTaskTextColor());
+            }
+            else
+            {
+                textPen = p->pen();
+            }
         }
 
         int availableWidth = width() - (br.x() * 2) - textPos;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic