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

List:       kde-commits
Subject:    extragear/utils/yakuake
From:       Eike Hein <hein () kde ! org>
Date:       2008-08-11 16:57:54
Message-ID: 1218473874.034698.16633.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 845436 by hein:

Added a setting to fill with the configurable background color at a given
opacity before painting the skin elements. In effect, this allows some con-
trol over the opacity and color tint of translucent areas of the skin.


 M  +4 -0      ChangeLog  
 M  +109 -7    app/config/appearancesettings.ui  
 M  +7 -0      app/config/yakuake.kcfg  
 M  +14 -0     app/mainwindow.cpp  
 M  +0 -11     app/tabbar.cpp  
 M  +0 -11     app/titlebar.cpp  


--- trunk/extragear/utils/yakuake/ChangeLog #845435:845436
@@ -7,6 +7,9 @@
 * Fixed a bug that made it impossible to move a session located at the
   start or end of the tab bar back after moving it left/right using the
   keyboard shortcuts.
+* Added a setting to fill with the configurable background color at a given
+  opacity before painting the skin elements. In effect, this allows some con-
+  trol over the opacity and color tint of translucent areas of the skin.
 
 
 Changes in 2.9.3:
@@ -25,6 +28,7 @@
 * Fixed tab label not immediately being updated upon creating a new session
   when "Show title bar contents in tab labels" is enabled.
 
+
 Changes in 2.9.2:
 * The item background in the skin list is now determined by the style en-
   gine if on KDE 4.1 (including pre-release versions) and hence Qt 4.4.
--- trunk/extragear/utils/yakuake/app/config/appearancesettings.ui #845435:845436
@@ -5,11 +5,11 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>239</width>
-    <height>264</height>
+    <width>245</width>
+    <height>289</height>
    </rect>
   </property>
-  <layout class="QVBoxLayout" >
+  <layout class="QVBoxLayout" name="verticalLayout_2" >
    <property name="margin" >
     <number>0</number>
    </property>
@@ -18,11 +18,11 @@
      <property name="title" >
       <string comment="@title:group" >Window Background</string>
      </property>
-     <layout class="QVBoxLayout" >
+     <layout class="QVBoxLayout" name="verticalLayout" >
       <item>
        <layout class="QHBoxLayout" >
         <item>
-         <widget class="QLabel" name="label" >
+         <widget class="QLabel" name="backgroundColorLabel" >
           <property name="text" >
            <string comment="@label:chooser" >Background color:</string>
           </property>
@@ -52,11 +52,79 @@
       </item>
       <item>
        <widget class="QCheckBox" name="kcfg_Translucency" >
+        <property name="whatsThis" >
+         <string comment="@info:whatsthis" >Translucency requires support by the \
selected skin as well as your desktop environment. The default skin supports \
translucency.</string> +        </property>
         <property name="text" >
-         <string comment="@option:check" >Use translucent background if \
possible</string> +         <string comment="@option:check" >Use skin translucency if \
supported</string>  </property>
        </widget>
       </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout" >
+        <property name="leftMargin" >
+         <number>7</number>
+        </property>
+        <item>
+         <spacer name="spacer" >
+          <property name="orientation" >
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeType" >
+           <enum>QSizePolicy::Fixed</enum>
+          </property>
+          <property name="sizeHint" stdset="0" >
+           <size>
+            <width>20</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <widget class="QLabel" name="backgroundColorOpacityLabel" >
+          <property name="enabled" >
+           <bool>false</bool>
+          </property>
+          <property name="text" >
+           <string comment="@label:spinbox" >Background color opacity:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="kcfg_BackgroundColorOpacity" >
+          <property name="enabled" >
+           <bool>false</bool>
+          </property>
+          <property name="whatsThis" >
+           <string comment="@info:whatsthis" >When using translucency, the \
background color will be filled in using the given opacity before the skin elements \
are painted on top of the background. This allows influencing the opacity and color \
tint of translucent areas of the skin.</string> +          </property>
+          <property name="suffix" >
+           <string comment="@label Spinbox unit suffix" >%</string>
+          </property>
+          <property name="maximum" >
+           <number>100</number>
+          </property>
+          <property name="value" >
+           <number>50</number>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="spacer_2" >
+          <property name="orientation" >
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0" >
+           <size>
+            <width>64</width>
+            <height>17</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
      </layout>
     </widget>
    </item>
@@ -123,11 +191,45 @@
  <tabstops>
   <tabstop>kcfg_BackgroundColor</tabstop>
   <tabstop>kcfg_Translucency</tabstop>
+  <tabstop>kcfg_BackgroundColorOpacity</tabstop>
   <tabstop>skinList</tabstop>
   <tabstop>installButton</tabstop>
   <tabstop>removeButton</tabstop>
   <tabstop>kcfg_Skin</tabstop>
  </tabstops>
  <resources/>
- <connections/>
+ <connections>
+  <connection>
+   <sender>kcfg_Translucency</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>kcfg_BackgroundColorOpacity</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>152</x>
+     <y>76</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>192</x>
+     <y>106</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>kcfg_Translucency</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>backgroundColorOpacityLabel</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>152</x>
+     <y>76</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>95</x>
+     <y>106</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
 </ui>
--- trunk/extragear/utils/yakuake/app/config/yakuake.kcfg #845435:845436
@@ -85,6 +85,13 @@
       <whatsthis context="@info:whatsthis">Background color used if XComposite ARGB \
translucency is disabled.</whatsthis>  <default>#000000</default>
     </entry>
+    <entry name="BackgroundColorOpacity" type="Int">
+      <label context="@label">Background color opacity</label>
+      <whatsthis context="@info:whatsthis">The opacity of the background color fill \
when using translucency.</whatsthis> +      <default>50</default>
+      <min>0</min>
+      <max>100</max>
+    </entry>
   </group>
   <group name="Animation">
     <entry name="Frames" type="Int">
--- trunk/extragear/utils/yakuake/app/mainwindow.cpp #845435:845436
@@ -647,6 +647,20 @@
 {
     QPainter painter(this);
 
+    if (useTranslucency())
+    {
+        painter.setCompositionMode(QPainter::CompositionMode_Source);
+        painter.fillRect(rect(), Qt::transparent);
+        painter.setOpacity(qreal(Settings::backgroundColorOpacity()) / 100);
+        painter.fillRect(rect(), Settings::backgroundColor());
+        painter.setOpacity(1.0);
+    }
+    else
+    {
+        painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
+        painter.fillRect(rect(), Settings::backgroundColor());
+    }
+
     QRect leftBorder(0, 0, m_skin->borderWidth(), height() - m_titleBar->height());
     painter.fillRect(leftBorder, m_skin->borderColor());
 
--- trunk/extragear/utils/yakuake/app/tabbar.cpp #845435:845436
@@ -179,17 +179,6 @@
     QPainter painter(this);
     painter.setPen(m_skin->tabBarTextColor());
 
-    if (m_mainWindow->useTranslucency())
-    {
-        painter.setCompositionMode(QPainter::CompositionMode_Source);
-        painter.fillRect(rect(), Qt::transparent);
-    }
-    else
-    {
-        painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
-        painter.fillRect(rect(), Settings::backgroundColor());
-    }
-
     QString title;
     int sessionId;
     bool selected;
--- trunk/extragear/utils/yakuake/app/titlebar.cpp #845435:845436
@@ -98,17 +98,6 @@
     QPainter painter(this);
     painter.setPen(m_skin->titleBarTextColor());
 
-    if (m_mainWindow->useTranslucency())
-    {
-        painter.setCompositionMode(QPainter::CompositionMode_Source);
-        painter.fillRect(rect(), Qt::transparent);
-    }
-    else
-    {
-        painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
-        painter.fillRect(rect(), Settings::backgroundColor());
-    }
-
     const QPixmap& backgroundImage = m_skin->titleBarBackgroundImage();
     const QPixmap& leftCornerImage = m_skin->titleBarLeftCornerImage();
     const QPixmap& rightCornerImage = m_skin->titleBarRightCornerImage();


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

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