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

List:       kde-devel
Subject:    [PATCH]: configurable kicker hide buttons (was Re: New QT tear-off menus)
From:       "Aaron J. Seigo" <aseigo () mountlinux ! com>
Date:       2001-03-31 2:42:52
[Download RAW message or body]

Hi...

> I've heard many people criticise the fact that the hide buttons are
> on by default and I haven't heard any reasons the default should
> be changed, so I've made them off by default now.

attatched are two patches that enhance the kicker kcontrol module and kicker 
itself to allow configuring wether the left/top or right/bottom hide buttons 
are on or off, independant of each other.

the kcontrol gives options for both, top/left, bottom/right, or none in a 
combo box. the top/bottom vs left/right text changes dynamically according to 
current settings in the kcontrol...

kickercore.patch applies to the kdebase/kicker/core/ directory, modifying 
panel.cpp and panel.h

kcmkicker.patch applies to the kdebase/kcontrol/kicker directory

they work for me, but of course feedback is more than welcome as i may have 
missed something somewhere =)

-- 
Aaron Seigo
["kickercore.patch" (text/plain)]

Index: panel.cpp
===================================================================
RCS file: /home/projects/kdecvs/cvsroot/kdebase/kicker/core/panel.cpp,v
retrieving revision 1.54
diff -r1.54 panel.cpp
78c78
<   , _showHBs(true)
---
>   , _showLeftHB(true)
191d190
<     _showHBs = config->readBoolEntry("ShowHideButtons", false);
192a192
>     _showLeftHB = config->readBoolEntry("ShowLeftHideButton", true);
308,309c308,309
< 	_ltHB->setPosition(Left);
< 	_ltHB->setFixedSize(_HBwidth, height());
---
>     	_ltHB->setPosition(Left);
>     	_ltHB->setFixedSize(_HBwidth, height());
312,313c312,313
< 	_ltHB->setPosition(Top);
< 	_ltHB->setFixedSize(width(), _HBwidth);
---
>     	_ltHB->setPosition(Top);
>     	_ltHB->setFixedSize(width(), _HBwidth);
316c316,318
<     if (_showHBs) {
---
>     _layout->addWidget( _ltHB );
> 
>     if (_showLeftHB) {
318d319
< 	_layout->addWidget( _ltHB );
321c322
< 	_ltHB->hide();
---
>     	_ltHB->hide();
354,355c355,356
< 	_rbHB->setPosition(Right);
< 	_rbHB->setFixedSize(_HBwidth, height());
---
>     	_rbHB->setPosition(Right);
>     	_rbHB->setFixedSize(_HBwidth, height());
358,359c359,360
< 	_rbHB->setPosition(Bottom);
< 	_rbHB->setFixedSize(width(), _HBwidth);
---
>     	_rbHB->setPosition(Bottom);
>     	_rbHB->setFixedSize(width(), _HBwidth);
361,366c362,366
<     if (_showHBs) {
< 	_rbHB->show();
< 	_layout->addWidget( _rbHB );
< 	if (!_showRightHB)
< 		_rbHB->hide();
< 
---
>     
>     _layout->addWidget( _rbHB );
>     
>     if (_showRightHB) {
>     	_rbHB->show();
369c369
< 	_rbHB->hide();
---
>     	_rbHB->hide();
426,429c426
< 	// SHOW
< 
< 	if (!_showRightHB)
< 		_rbHB->hide();
---
>         // SHOW
431c428,431
< 	if ( isVertical() ) {
---
>         if (!_showRightHB)
>             _rbHB->hide();
>         if (!_showLeftHB)
>             _ltHB->hide();
433c433
< 	    int strut = _ltHB->height();
---
>         if ( isVertical() ) {
435c435
< 	    if (_hideAnim) {
---
>             int strut = _ltHB->height();
437,451c437,439
< 		for (int i = geom.height()-strut; i>0;i-=PANEL_SPEED(i,geom.height()) ) {
< 		    move(geom.x(), left ? geom.y() + i : geom.y() - i);
< 
< 		    qApp->syncX();
< 		    qApp->processEvents();
< 		}
< 	    }
< 	}
< 	else {
< 	    int strut = _ltHB->width();
< 	    if(_hideAnim)
<             {
<                 for (int i = geom.width()-strut; i>0;i-=PANEL_SPEED(i,geom.width()) )
<                 {
<                     move(left ? geom.x() + i : geom.x() - i, geom.y());
---
>             if (_hideAnim) {
>                 for (int i = geom.height()-strut; i>0;i-=PANEL_SPEED(i,geom.height()) ) {
>                     move(geom.x(), left ? geom.y() + i : geom.y() - i);
457,458c445,459
< 	}
< 	move(geom.x(), geom.y());
---
>         }
>         else {
>             int strut = _ltHB->width();
>             if(_hideAnim)
>                 {
>                     for (int i = geom.width()-strut; i>0;i-=PANEL_SPEED(i,geom.width()) )
>                     {
>                         move(left ? geom.x() + i : geom.x() - i, geom.y());
> 
>                         qApp->syncX();
>                         qApp->processEvents();
>                     }
>                 }
>         }
>         move(geom.x(), geom.y());
460,462c461,463
< 	_userHidden = false;
< 	updateWindowManager();
< 	raise();
---
>         _userHidden = false;
>         updateWindowManager();
>         raise();
469c470
< 	// HIDE
---
>         // HIDE
471,486c472,503
< 	lower();
< 	_userHidden = true;
< 	// Don't bother autohiding when the user's done it already.
< 	_autohideTimer->stop();
< 
< 	if (!_showRightHB)
< 	_rbHB->show();
< 
< 	if ( isVertical() ) {
< 	    int strut = _ltHB->height();
< 	    if(_hideAnim) {
< 		for (int i = 0;
< 		     i < geom.height() - strut;
< 		     i += PANEL_SPEED(i,geom.height()))
<                 {
<                     move(geom.x(), left ? geom.y() - i : geom.y() + i);
---
>         lower();
>         _userHidden = true;
>         // Don't bother autohiding when the user's done it already.
>         _autohideTimer->stop();
> 
>         if (left && !_showRightHB)
>             _rbHB->show();
>         if (!_showLeftHB)
>             _ltHB->show();
> 
>         if ( isVertical() ) {
>             int strut = _ltHB->height();
>             if(_hideAnim) {
>                 for (int i = 0;
>                      i < geom.height() - strut;
>                      i += PANEL_SPEED(i,geom.height()))
>                     {
>                         move(geom.x(), left ? geom.y() - i : geom.y() + i);                  
> 
>                         qApp->syncX();
>                         qApp->processEvents();
>                     }
>             }
>             move(geom.x(), left ? strut + geom.top() - geom.height() : geom.bottom() - strut + 1);
>         }
>         else {
>             int strut = _ltHB->width();
>             if(_hideAnim) {
>                 for (int i = 0;
>                     i < geom.width() - strut;
>                     i += PANEL_SPEED(i,geom.width())) {
>                     move(left ? geom.x() - i : geom.x() + i, geom.y());
491,509c508,512
< 	    }
< 	    move(geom.x(), left ? strut + geom.top() - geom.height() : geom.bottom() - strut + 1);
< 	}
< 	else {
< 	    int strut = _ltHB->width();
< 	    if(_hideAnim) {
< 		for (int i = 0;
< 		     i < geom.width() - strut;
< 		     i += PANEL_SPEED(i,geom.width())) {
< 		    move(left ? geom.x() - i : geom.x() + i, geom.y());
< 
< 		    qApp->syncX();
< 		    qApp->processEvents();
< 		}
< 	    }
< 	    move(left ? strut + geom.left() - geom.width() : geom.right() - strut + 1, geom.y());
< 	}
<         _ltHB->show();
< 	updateWindowManager();
---
>             }
>             move(left ? strut + geom.left() - geom.width() : geom.right() - strut + 1, geom.y());
>         }
> 
>         updateWindowManager();
Index: panel.h
===================================================================
RCS file: /home/projects/kdecvs/cvsroot/kdebase/kicker/core/panel.h,v
retrieving revision 1.15
diff -r1.15 panel.h
119c119
<     bool _showHBs;
---
>     bool _showLeftHB;

["kcmkicker.patch" (text/plain)]

Index: lookandfeeltab.ui
===================================================================
RCS file: /home/projects/kdecvs/cvsroot/kdebase/kcontrol/kicker/lookandfeeltab.ui,v
retrieving revision 1.4
diff -u -r1.4 lookandfeeltab.ui
--- lookandfeeltab.ui	2000/12/03 10:25:49	1.4
+++ lookandfeeltab.ui	2001/03/31 02:28:52
@@ -12,7 +12,7 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>568</width>
+            <width>564</width>
             <height>480</height>
         </rect>
     </property>
@@ -36,16 +36,16 @@
                 <cstring>m_hideButtonGroup</cstring>
             </property>
             <property stdset="1">
-                <name>title</name>
-                <string>&amp;Hide Buttons</string>
-            </property>
-            <property stdset="1">
                 <name>sizePolicy</name>
                 <sizepolicy>
                     <hsizetype>1</hsizetype>
                     <vsizetype>4</vsizetype>
                 </sizepolicy>
             </property>
+            <property stdset="1">
+                <name>title</name>
+                <string>&amp;Hide Buttons</string>
+            </property>
             <hbox>
                 <property stdset="1">
                     <name>margin</name>
@@ -56,14 +56,48 @@
                     <number>6</number>
                 </property>
                 <widget>
-                    <class>QCheckBox</class>
+                    <class>QComboBox</class>
+                    <item>
+                        <property>
+                            <name>text</name>
+                            <string>Enable Both Hide Buttons</string>
+                        </property>
+                    </item>
+                    <item>
+                        <property>
+                            <name>text</name>
+                            <string>Enable Left Hide Button Only</string>
+                        </property>
+                    </item>
+                    <item>
+                        <property>
+                            <name>text</name>
+                            <string>Enable Right Hide Button Only</string>
+                        </property>
+                    </item>
+                    <item>
+                        <property>
+                            <name>text</name>
+                            <string>Disable Both Hide Buttons</string>
+                        </property>
+                    </item>
                     <property stdset="1">
                         <name>name</name>
                         <cstring>m_hideButtons</cstring>
                     </property>
                     <property stdset="1">
-                        <name>text</name>
-                        <string>&amp;Enable hide buttons</string>
+                        <name>sizePolicy</name>
+                        <sizepolicy>
+                            <hsizetype>1</hsizetype>
+                            <vsizetype>4</vsizetype>
+                        </sizepolicy>
+                    </property>
+                    <property stdset="1">
+                        <name>minimumSize</name>
+                        <size>
+                            <width>130</width>
+                            <height>22</height>
+                        </size>
                     </property>
                 </widget>
                 <widget>
@@ -88,16 +122,15 @@
                                 <cstring>m_hideButtonSlider</cstring>
                             </property>
                             <property stdset="1">
-                                <name>orientation</name>
-                                <enum>Horizontal</enum>
-                            </property>
-                            <property stdset="1">
-                                <name>tickmarks</name>
-                                <enum>Right</enum>
+                                <name>enabled</name>
+                                <bool>false</bool>
                             </property>
                             <property stdset="1">
-                                <name>tickInterval</name>
-                                <number>1</number>
+                                <name>sizePolicy</name>
+                                <sizepolicy>
+                                    <hsizetype>7</hsizetype>
+                                    <vsizetype>0</vsizetype>
+                                </sizepolicy>
                             </property>
                             <property stdset="1">
                                 <name>minValue</name>
@@ -108,15 +141,16 @@
                                 <number>24</number>
                             </property>
                             <property stdset="1">
-                                <name>sizePolicy</name>
-                                <sizepolicy>
-                                    <hsizetype>7</hsizetype>
-                                    <vsizetype>0</vsizetype>
-                                </sizepolicy>
+                                <name>orientation</name>
+                                <enum>Horizontal</enum>
                             </property>
                             <property stdset="1">
-                                <name>enabled</name>
-                                <bool>false</bool>
+                                <name>tickmarks</name>
+                                <enum>Right</enum>
+                            </property>
+                            <property stdset="1">
+                                <name>tickInterval</name>
+                                <number>1</number>
                             </property>
                         </widget>
                         <widget>
@@ -141,16 +175,16 @@
                                         <cstring>TextLabel3_2</cstring>
                                     </property>
                                     <property stdset="1">
-                                        <name>text</name>
-                                        <string>Small</string>
-                                    </property>
-                                    <property stdset="1">
                                         <name>sizePolicy</name>
                                         <sizepolicy>
                                             <hsizetype>1</hsizetype>
                                             <vsizetype>1</vsizetype>
                                         </sizepolicy>
                                     </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Small</string>
+                                    </property>
                                 </widget>
                                 <widget>
                                     <class>QLabel</class>
@@ -159,10 +193,6 @@
                                         <cstring>TextLabel5_3</cstring>
                                     </property>
                                     <property stdset="1">
-                                        <name>text</name>
-                                        <string>Medium</string>
-                                    </property>
-                                    <property stdset="1">
                                         <name>sizePolicy</name>
                                         <sizepolicy>
                                             <hsizetype>1</hsizetype>
@@ -170,6 +200,10 @@
                                         </sizepolicy>
                                     </property>
                                     <property stdset="1">
+                                        <name>text</name>
+                                        <string>Medium</string>
+                                    </property>
+                                    <property stdset="1">
                                         <name>alignment</name>
                                         <set>AlignCenter</set>
                                     </property>
@@ -184,10 +218,6 @@
                                         <cstring>TextLabel4_3</cstring>
                                     </property>
                                     <property stdset="1">
-                                        <name>text</name>
-                                        <string>Large</string>
-                                    </property>
-                                    <property stdset="1">
                                         <name>sizePolicy</name>
                                         <sizepolicy>
                                             <hsizetype>1</hsizetype>
@@ -195,6 +225,10 @@
                                         </sizepolicy>
                                     </property>
                                     <property stdset="1">
+                                        <name>text</name>
+                                        <string>Large</string>
+                                    </property>
+                                    <property stdset="1">
                                         <name>alignment</name>
                                         <set>AlignVCenter|AlignRight</set>
                                     </property>
@@ -215,24 +249,24 @@
                 <cstring>m_manualHideGroup</cstring>
             </property>
             <property stdset="1">
-                <name>title</name>
-                <string>&amp;Manual Hide Animation</string>
-            </property>
-            <property stdset="1">
-                <name>frameShadow</name>
-                <enum>Sunken</enum>
+                <name>sizePolicy</name>
+                <sizepolicy>
+                    <hsizetype>1</hsizetype>
+                    <vsizetype>4</vsizetype>
+                </sizepolicy>
             </property>
             <property stdset="1">
                 <name>frameShape</name>
                 <enum>Box</enum>
             </property>
             <property stdset="1">
-                <name>sizePolicy</name>
-                <sizepolicy>
-                    <hsizetype>1</hsizetype>
-                    <vsizetype>4</vsizetype>
-                </sizepolicy>
+                <name>frameShadow</name>
+                <enum>Sunken</enum>
             </property>
+            <property stdset="1">
+                <name>title</name>
+                <string>&amp;Manual Hide Animation</string>
+            </property>
             <hbox>
                 <property stdset="1">
                     <name>margin</name>
@@ -249,16 +283,16 @@
                         <cstring>m_manualHideAnimation</cstring>
                     </property>
                     <property stdset="1">
-                        <name>text</name>
-                        <string>E&amp;nable manual hide animation</string>
-                    </property>
-                    <property stdset="1">
                         <name>sizePolicy</name>
                         <sizepolicy>
                             <hsizetype>1</hsizetype>
                             <vsizetype>1</vsizetype>
                         </sizepolicy>
                     </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>E&amp;nable manual hide animation</string>
+                    </property>
                 </widget>
                 <widget>
                     <class>QLayoutWidget</class>
@@ -282,16 +316,15 @@
                                 <cstring>m_manualHideSlider</cstring>
                             </property>
                             <property stdset="1">
-                                <name>orientation</name>
-                                <enum>Horizontal</enum>
-                            </property>
-                            <property stdset="1">
-                                <name>tickmarks</name>
-                                <enum>Right</enum>
+                                <name>enabled</name>
+                                <bool>false</bool>
                             </property>
                             <property stdset="1">
-                                <name>tickInterval</name>
-                                <number>10</number>
+                                <name>sizePolicy</name>
+                                <sizepolicy>
+                                    <hsizetype>7</hsizetype>
+                                    <vsizetype>0</vsizetype>
+                                </sizepolicy>
                             </property>
                             <property stdset="1">
                                 <name>minValue</name>
@@ -302,15 +335,16 @@
                                 <number>200</number>
                             </property>
                             <property stdset="1">
-                                <name>sizePolicy</name>
-                                <sizepolicy>
-                                    <hsizetype>7</hsizetype>
-                                    <vsizetype>0</vsizetype>
-                                </sizepolicy>
+                                <name>orientation</name>
+                                <enum>Horizontal</enum>
                             </property>
                             <property stdset="1">
-                                <name>enabled</name>
-                                <bool>false</bool>
+                                <name>tickmarks</name>
+                                <enum>Right</enum>
+                            </property>
+                            <property stdset="1">
+                                <name>tickInterval</name>
+                                <number>10</number>
                             </property>
                         </widget>
                         <widget>
@@ -335,16 +369,16 @@
                                         <cstring>TextLabel3</cstring>
                                     </property>
                                     <property stdset="1">
-                                        <name>text</name>
-                                        <string>Slow</string>
-                                    </property>
-                                    <property stdset="1">
                                         <name>sizePolicy</name>
                                         <sizepolicy>
                                             <hsizetype>1</hsizetype>
                                             <vsizetype>1</vsizetype>
                                         </sizepolicy>
                                     </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Slow</string>
+                                    </property>
                                 </widget>
                                 <widget>
                                     <class>QLabel</class>
@@ -353,10 +387,6 @@
                                         <cstring>TextLabel5</cstring>
                                     </property>
                                     <property stdset="1">
-                                        <name>text</name>
-                                        <string>Medium</string>
-                                    </property>
-                                    <property stdset="1">
                                         <name>sizePolicy</name>
                                         <sizepolicy>
                                             <hsizetype>1</hsizetype>
@@ -364,6 +394,10 @@
                                         </sizepolicy>
                                     </property>
                                     <property stdset="1">
+                                        <name>text</name>
+                                        <string>Medium</string>
+                                    </property>
+                                    <property stdset="1">
                                         <name>alignment</name>
                                         <set>AlignCenter</set>
                                     </property>
@@ -378,10 +412,6 @@
                                         <cstring>TextLabel4</cstring>
                                     </property>
                                     <property stdset="1">
-                                        <name>text</name>
-                                        <string>Fast</string>
-                                    </property>
-                                    <property stdset="1">
                                         <name>sizePolicy</name>
                                         <sizepolicy>
                                             <hsizetype>1</hsizetype>
@@ -389,6 +419,10 @@
                                         </sizepolicy>
                                     </property>
                                     <property stdset="1">
+                                        <name>text</name>
+                                        <string>Fast</string>
+                                    </property>
+                                    <property stdset="1">
                                         <name>alignment</name>
                                         <set>AlignVCenter|AlignRight</set>
                                     </property>
@@ -428,16 +462,16 @@
                         <cstring>m_autoHideAnimation</cstring>
                     </property>
                     <property stdset="1">
-                        <name>text</name>
-                        <string>Ena&amp;ble automatic hide animation</string>
-                    </property>
-                    <property stdset="1">
                         <name>sizePolicy</name>
                         <sizepolicy>
                             <hsizetype>1</hsizetype>
                             <vsizetype>1</vsizetype>
                         </sizepolicy>
                     </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Ena&amp;ble automatic hide animation</string>
+                    </property>
                 </widget>
                 <widget>
                     <class>QLayoutWidget</class>
@@ -461,16 +495,8 @@
                                 <cstring>m_autoHideSlider</cstring>
                             </property>
                             <property stdset="1">
-                                <name>orientation</name>
-                                <enum>Horizontal</enum>
-                            </property>
-                            <property stdset="1">
-                                <name>tickmarks</name>
-                                <enum>Right</enum>
-                            </property>
-                            <property stdset="1">
-                                <name>tickInterval</name>
-                                <number>10</number>
+                                <name>enabled</name>
+                                <bool>false</bool>
                             </property>
                             <property stdset="1">
                                 <name>minValue</name>
@@ -481,9 +507,17 @@
                                 <number>100</number>
                             </property>
                             <property stdset="1">
-                                <name>enabled</name>
-                                <bool>false</bool>
+                                <name>orientation</name>
+                                <enum>Horizontal</enum>
                             </property>
+                            <property stdset="1">
+                                <name>tickmarks</name>
+                                <enum>Right</enum>
+                            </property>
+                            <property stdset="1">
+                                <name>tickInterval</name>
+                                <number>10</number>
+                            </property>
                         </widget>
                         <widget>
                             <class>QLayoutWidget</class>
@@ -507,16 +541,16 @@
                                         <cstring>TextLabel3_2_2</cstring>
                                     </property>
                                     <property stdset="1">
-                                        <name>text</name>
-                                        <string>Slow</string>
-                                    </property>
-                                    <property stdset="1">
                                         <name>sizePolicy</name>
                                         <sizepolicy>
                                             <hsizetype>1</hsizetype>
                                             <vsizetype>1</vsizetype>
                                         </sizepolicy>
                                     </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Slow</string>
+                                    </property>
                                 </widget>
                                 <widget>
                                     <class>QLabel</class>
@@ -525,10 +559,6 @@
                                         <cstring>TextLabel5_2_2</cstring>
                                     </property>
                                     <property stdset="1">
-                                        <name>text</name>
-                                        <string>Medium</string>
-                                    </property>
-                                    <property stdset="1">
                                         <name>sizePolicy</name>
                                         <sizepolicy>
                                             <hsizetype>1</hsizetype>
@@ -536,6 +566,10 @@
                                         </sizepolicy>
                                     </property>
                                     <property stdset="1">
+                                        <name>text</name>
+                                        <string>Medium</string>
+                                    </property>
+                                    <property stdset="1">
                                         <name>alignment</name>
                                         <set>AlignCenter</set>
                                     </property>
@@ -550,10 +584,6 @@
                                         <cstring>TextLabel4_2_2</cstring>
                                     </property>
                                     <property stdset="1">
-                                        <name>text</name>
-                                        <string>Fast</string>
-                                    </property>
-                                    <property stdset="1">
                                         <name>sizePolicy</name>
                                         <sizepolicy>
                                             <hsizetype>1</hsizetype>
@@ -561,6 +591,10 @@
                                         </sizepolicy>
                                     </property>
                                     <property stdset="1">
+                                        <name>text</name>
+                                        <string>Fast</string>
+                                    </property>
+                                    <property stdset="1">
                                         <name>alignment</name>
                                         <set>AlignVCenter|AlignRight</set>
                                     </property>
@@ -581,16 +615,16 @@
                 <cstring>m_backgroundGroup</cstring>
             </property>
             <property stdset="1">
-                <name>title</name>
-                <string>Background &amp;Image</string>
-            </property>
-            <property stdset="1">
                 <name>sizePolicy</name>
                 <sizepolicy>
                     <hsizetype>1</hsizetype>
                     <vsizetype>4</vsizetype>
                 </sizepolicy>
             </property>
+            <property stdset="1">
+                <name>title</name>
+                <string>Background &amp;Image</string>
+            </property>
             <vbox>
                 <property stdset="1">
                     <name>margin</name>
@@ -680,13 +714,13 @@
                                                 <cstring>m_backgroundButton</cstring>
                                             </property>
                                             <property stdset="1">
-                                                <name>text</name>
-                                                <string>Bro&amp;wse</string>
-                                            </property>
-                                            <property stdset="1">
                                                 <name>enabled</name>
                                                 <bool>false</bool>
                                             </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>Bro&amp;wse</string>
+                                            </property>
                                         </widget>
                                     </hbox>
                                 </widget>
@@ -699,10 +733,17 @@
                                 <cstring>m_backgroundLabel</cstring>
                             </property>
                             <property stdset="1">
-                                <name>scaledContents</name>
-                                <bool>true</bool>
+                                <name>enabled</name>
+                                <bool>false</bool>
                             </property>
                             <property stdset="1">
+                                <name>sizePolicy</name>
+                                <sizepolicy>
+                                    <hsizetype>0</hsizetype>
+                                    <vsizetype>0</vsizetype>
+                                </sizepolicy>
+                            </property>
+                            <property stdset="1">
                                 <name>minimumSize</name>
                                 <size>
                                     <width>50</width>
@@ -717,13 +758,6 @@
                                 </size>
                             </property>
                             <property stdset="1">
-                                <name>sizePolicy</name>
-                                <sizepolicy>
-                                    <hsizetype>0</hsizetype>
-                                    <vsizetype>0</vsizetype>
-                                </sizepolicy>
-                            </property>
-                            <property stdset="1">
                                 <name>frameShape</name>
                                 <enum>StyledPanel</enum>
                             </property>
@@ -732,8 +766,8 @@
                                 <enum>Raised</enum>
                             </property>
                             <property stdset="1">
-                                <name>enabled</name>
-                                <bool>false</bool>
+                                <name>scaledContents</name>
+                                <bool>true</bool>
                             </property>
                             <property stdset="1">
                                 <name>alignment</name>
@@ -770,24 +804,11 @@
                     <height>20</height>
                 </size>
             </property>
-            <property>
-                <name>sizeHint</name>
-                <size>
-                    <width>20</width>
-                    <height>20</height>
-                </size>
-            </property>
         </spacer>
     </vbox>
 </widget>
 <connections>
     <connection>
-        <sender>m_hideButtons</sender>
-        <signal>toggled(bool)</signal>
-        <receiver>m_hideButtonSlider</receiver>
-        <slot>setEnabled(bool)</slot>
-    </connection>
-    <connection>
         <sender>m_manualHideAnimation</sender>
         <signal>toggled(bool)</signal>
         <receiver>m_manualHideSlider</receiver>
@@ -817,9 +838,15 @@
         <receiver>m_autoHideSlider</receiver>
         <slot>setEnabled(bool)</slot>
     </connection>
+    <connection>
+        <sender>m_hideButtons</sender>
+        <signal>activated(int)</signal>
+        <receiver>LookAndFeelTabBase</receiver>
+        <slot>hideButtonsSet(int)</slot>
+    </connection>
+    <slot access="protected">hideButtonsSet(int)</slot>
 </connections>
 <tabstops>
-    <tabstop>m_hideButtons</tabstop>
     <tabstop>m_hideButtonSlider</tabstop>
     <tabstop>m_manualHideAnimation</tabstop>
     <tabstop>m_manualHideSlider</tabstop>
Index: lookandfeeltab_impl.cpp
===================================================================
RCS file: /home/projects/kdecvs/cvsroot/kdebase/kcontrol/kicker/lookandfeeltab_impl.cpp,v
retrieving revision 1.7
diff -u -r1.7 lookandfeeltab_impl.cpp
--- lookandfeeltab_impl.cpp	2001/03/29 07:18:21	1.7
+++ lookandfeeltab_impl.cpp	2001/03/31 02:28:52
@@ -25,6 +25,7 @@
 #include <qslider.h>
 
 #include <kconfig.h>
+#include <kcombobox.h>
 #include <kglobal.h>
 #include <klocale.h>
 #include <klineedit.h>
@@ -32,6 +33,7 @@
 #include <kmessagebox.h>
 #include <kimageio.h>
 
+#include "main.h"
 #include "lookandfeeltab_impl.h"
 #include "lookandfeeltab_impl.moc"
 
@@ -39,15 +41,16 @@
 extern int kickerconfig_screen_number;
 
 
-LookAndFeelTab::LookAndFeelTab( QWidget *parent, const char* name )
+LookAndFeelTab::LookAndFeelTab( KickerConfig *parent, const char* name )
   : LookAndFeelTabBase (parent, name)
 {
+    kconf = parent;
     // connections
     connect(m_manualHideAnimation, SIGNAL(clicked()), SIGNAL(changed()));
     connect(m_manualHideSlider, SIGNAL(valueChanged(int)), SIGNAL(changed()));
     connect(m_autoHideAnimation, SIGNAL(clicked()), SIGNAL(changed()));
     connect(m_autoHideSlider, SIGNAL(valueChanged(int)), SIGNAL(changed()));
-    connect(m_hideButtons, SIGNAL(clicked()), SIGNAL(changed()));
+    connect(m_hideButtons, SIGNAL(activated(int)), SIGNAL(changed()));
     connect(m_hideButtonSlider, SIGNAL(valueChanged(int)), SIGNAL(changed()));
     connect(m_backgroundImage, SIGNAL(clicked()), SIGNAL(changed()));
     connect(m_backgroundButton, SIGNAL(clicked()), SLOT(browse_theme()));
@@ -167,11 +170,21 @@
     m_manualHideAnimation->setChecked(hideanim);
     m_autoHideAnimation->setChecked(autohideanim);
 
-    bool showHBs = c->readBoolEntry("ShowHideButtons", true);
-    m_hideButtons->setChecked(showHBs);
+    bool showLHB = c->readBoolEntry("ShowLeftHideButton", true);    
+    bool showRHB = c->readBoolEntry("ShowRightHideButton", true);
+    
+    if (showLHB)
+        if (showRHB)
+            m_hideButtons->setCurrentItem(0);
+        else
+            m_hideButtons->setCurrentItem(1);
+    else if (showRHB)
+        m_hideButtons->setCurrentItem(2);
+    else
+        m_hideButtons->setCurrentItem(3);
 
     m_hideButtonSlider->setValue(c->readNumEntry("HideButtonSize", 14));
-    m_hideButtonSlider->setEnabled(showHBs);
+    m_hideButtonSlider->setEnabled(showLHB || showRHB);
 
     delete c;
 }
@@ -193,7 +206,17 @@
     c->writeEntry("AutoHideAnimation", m_autoHideAnimation->isChecked());
     c->writeEntry("HideAnimationSpeed", m_manualHideSlider->value());
     c->writeEntry("AutoHideAnimationSpeed", m_autoHideSlider->value());
-    c->writeEntry("ShowHideButtons", m_hideButtons->isChecked());
+    
+    if (m_hideButtons->currentItem() == 0 || m_hideButtons->currentItem() == 1)
+        c->writeEntry("ShowLeftHideButton", "true");
+    else
+        c->writeEntry("ShowLeftHideButton", "false");
+    
+    if (m_hideButtons->currentItem() == 0 || m_hideButtons->currentItem() == 2)
+        c->writeEntry("ShowRightHideButton", "true");
+    else
+        c->writeEntry("ShowRightHideButton", "false");
+    
     c->writeEntry("HideButtonSize", m_hideButtonSlider->value());
     c->sync();
 
@@ -221,6 +244,35 @@
     m_manualHideSlider->setValue(100);
     m_autoHideSlider->setValue(25);
 
-    m_hideButtons->setChecked(true);
+    m_hideButtons->setCurrentItem(2);
     m_hideButtonSlider->setValue(14);
+}
+
+void LookAndFeelTab::hideButtonsSet(int index)
+{
+    if (index < 3)
+    {
+        m_hideButtonSlider->setEnabled(true);
+    }
+    else
+    {
+        m_hideButtonSlider->setEnabled(false);
+    }
+}
+
+void LookAndFeelTab::show()
+{
+    if (kconf->horizontal())
+    {
+        m_hideButtons->changeItem(i18n("Enable Left Hide Button Only"), 1);
+        m_hideButtons->changeItem(i18n("Enable Right Hide Button Only"), 2);
+    }
+    else
+    {
+        qDebug("vertical");
+            m_hideButtons->changeItem(i18n("Enable Top Hide Button Only"), 1);
+            m_hideButtons->changeItem(i18n("Enable Bottom Hide Button Only"), 2);
+    }
+    
+    QWidget::show();
 }
Index: lookandfeeltab_impl.h
===================================================================
RCS file: /home/projects/kdecvs/cvsroot/kdebase/kcontrol/kicker/lookandfeeltab_impl.h,v
retrieving revision 1.1
diff -u -r1.1 lookandfeeltab_impl.h
--- lookandfeeltab_impl.h	2000/12/02 15:35:42	1.1
+++ lookandfeeltab_impl.h	2001/03/31 02:28:52
@@ -28,21 +28,24 @@
     Q_OBJECT
 
 public:
-    LookAndFeelTab( QWidget *parent=0, const char* name=0 );
+    LookAndFeelTab( KickerConfig *parent=0, const char* name=0 );
 
     void load();
     void save();
     void defaults();
+    void show();
 
 signals:
     void changed();
 
 protected slots:
     void browse_theme();
-
+    void hideButtonsSet(int index);
+    
 private:
     QString theme;
     QPixmap theme_preview;
+    KickerConfig* kconf;
 };
 
 #endif
Index: main.cpp
===================================================================
RCS file: /home/projects/kdecvs/cvsroot/kdebase/kcontrol/kicker/main.cpp,v
retrieving revision 1.15
diff -u -r1.15 main.cpp
--- main.cpp	2001/02/06 18:32:06	1.15
+++ main.cpp	2001/03/31 02:28:52
@@ -135,6 +135,12 @@
                 " manipulation of the panel's buttons and applets.");
 }
 
+bool KickerConfig::horizontal()
+{
+    return (generaltab->m_topButton->isChecked() || 
+            generaltab->m_bottomButton->isChecked());
+}
+
 extern "C"
 {
     KCModule *create_kicker(QWidget *parent, const char *name)
Index: main.h
===================================================================
RCS file: /home/projects/kdecvs/cvsroot/kdebase/kcontrol/kicker/main.h,v
retrieving revision 1.7
diff -u -r1.7 main.h
--- main.h	2000/12/02 15:35:42	1.7
+++ main.h	2001/03/31 02:28:52
@@ -38,7 +38,8 @@
     void save();
     void defaults();
     QString quickHelp() const;
-
+    bool horizontal();
+    
 public slots:
     void configChanged();
 

>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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