summaryrefslogtreecommitdiff
authorsandman <sandman>2002-07-01 23:39:51 (UTC)
committer sandman <sandman>2002-07-01 23:39:51 (UTC)
commit329ea43b68180058bcd8e9d2af4d09d9c03c55a3 (patch) (unidiff)
tree8cb75f0d18be170c2def7ce8968fcbddeb004e82
parent7191d788415f190680c8a699b2b7bb88ddf28917 (diff)
downloadopie-329ea43b68180058bcd8e9d2af4d09d9c03c55a3.zip
opie-329ea43b68180058bcd8e9d2af4d09d9c03c55a3.tar.gz
opie-329ea43b68180058bcd8e9d2af4d09d9c03c55a3.tar.bz2
Added two new settings to liquid-style / Liquid-Settings:
- en/disable the new window decoration - set the stipple contrast (from no stipple to twice the normal value)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/liquid.cpp19
-rw-r--r--noncore/styles/liquid/liquiddeco.cpp18
-rw-r--r--noncore/styles/liquid/settings/liquidset.cpp55
-rw-r--r--noncore/styles/liquid/settings/liquidset.h3
4 files changed, 69 insertions, 26 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp
index 313d52c..acf0a42 100644
--- a/noncore/styles/liquid/liquid.cpp
+++ b/noncore/styles/liquid/liquid.cpp
@@ -80,3 +80,3 @@ void TransMenuHandler::reloadSettings()
80 Config config ( "qpe" ); 80 Config config ( "qpe" );
81 config. setGroup ( "MosfetMenus" ); 81 config. setGroup ( "Liquid-Style" );
82 82
@@ -712,2 +712,9 @@ void LiquidStyle::polish(QPalette &appPal)
712 Config config ( "qpe" ); 712 Config config ( "qpe" );
713 config. setGroup ( "Liquid-Style" );
714 int contrast = config. readNumEntry ( "StippleContrast", 5 );
715 if ( contrast < 0 )
716 contrast = 0;
717 else if ( contrast > 10 )
718 contrast = 10;
719
713 QPalette pal = QApplication::palette(); 720 QPalette pal = QApplication::palette();
@@ -783,5 +790,5 @@ void LiquidStyle::polish(QPalette &appPal)
783 for(i=0; i < 32; i+=4){ 790 for(i=0; i < 32; i+=4){
784 painter.setPen(c.dark(105)); 791 painter.setPen(c.dark(100 + contrast));
785 painter.drawLine(0, i, 32, i); 792 painter.drawLine(0, i, 32, i);
786 painter.setPen(c.dark(103)); 793 painter.setPen(c.dark(100 + 3 * contrast / 5 ) );
787 painter.drawLine(0, i+1, 32, i+1); 794 painter.drawLine(0, i+1, 32, i+1);
@@ -991,3 +998,7 @@ void LiquidStyle::polish(QApplication *app)
991 998
992 QApplication::qwsSetDecoration ( new LiquidDecoration ( )); 999 Config config ( "qpe" );
1000 config. setGroup ( "Liquid-Style" );
1001
1002 if ( config. readBoolEntry ( "WinDecoration", true ))
1003 QApplication::qwsSetDecoration ( new LiquidDecoration ( ));
993} 1004}
diff --git a/noncore/styles/liquid/liquiddeco.cpp b/noncore/styles/liquid/liquiddeco.cpp
index 8eee1b1..5488c67 100644
--- a/noncore/styles/liquid/liquiddeco.cpp
+++ b/noncore/styles/liquid/liquiddeco.cpp
@@ -100,8 +100,2 @@ void LiquidDecoration::paint( QPainter *painter, const QWidget *widget )
100 if ( titleWidth > 0 ) { 100 if ( titleWidth > 0 ) {
101 QBrush titleBrush;
102 QPen titlePen;
103 QPen titleLines;
104 int titleLeft = titleHeight + 4;
105
106 titleLeft = rect.left() + 5;
107 painter->setPen( cg.midlight() ); 101 painter->setPen( cg.midlight() );
@@ -117,12 +111,12 @@ void LiquidDecoration::paint( QPainter *painter, const QWidget *widget )
117 111
118 t.setLeft( t.left() + 4 ); 112 t .setLeft ( t. left ( ) + 4 );
119 t.setRight( t.right() - 2 ); 113 t .setRight ( t. right ( ) - 2 );
120 114
121 QFont f( QApplication::font() ); 115 QFont f ( QApplication::font ( ));
122 f.setWeight( QFont::Bold ); 116 f. setWeight ( QFont::Bold );
123 117
124 painter-> setFont( f ); 118 painter-> setFont ( f );
125 119
126 QColor textcol = cg.color( isActive ? QColorGroup::HighlightedText : QColorGroup::Text ); 120 QColor textcol = cg.color( isActive ? QColorGroup::HighlightedText : QColorGroup::Text );
127 QColor shadecol = ( qGray ( textcol. rgb ( ) ) > 128 ) ? textcol. dark ( 130 ) : textcol.light( 200 ); 121 QColor shadecol = ( qGray ( textcol. rgb ( ) ) > 128 ) ? textcol. dark ( 230 ) : textcol.light( 300 );
128 122
diff --git a/noncore/styles/liquid/settings/liquidset.cpp b/noncore/styles/liquid/settings/liquidset.cpp
index 0ef5dbe..1479ac0 100644
--- a/noncore/styles/liquid/settings/liquidset.cpp
+++ b/noncore/styles/liquid/settings/liquidset.cpp
@@ -46,2 +46,3 @@ static void changeButtonColor ( QWidget *btn, const QColor &col )
46 46
47 pal. setColor ( QPalette::Normal, QColorGroup::Button, col );
47 pal. setColor ( QPalette::Active, QColorGroup::Button, col ); 48 pal. setColor ( QPalette::Active, QColorGroup::Button, col );
@@ -49,2 +50,6 @@ static void changeButtonColor ( QWidget *btn, const QColor &col )
49 pal. setColor ( QPalette::Inactive, QColorGroup::Button, col ); 50 pal. setColor ( QPalette::Inactive, QColorGroup::Button, col );
51 pal. setColor ( QPalette::Normal, QColorGroup::Background, col );
52 pal. setColor ( QPalette::Active, QColorGroup::Background, col );
53 pal. setColor ( QPalette::Disabled, QColorGroup::Background, col );
54 pal. setColor ( QPalette::Inactive, QColorGroup::Background, col );
50 55
@@ -60,9 +65,11 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl )
60 Config config ( "qpe" ); 65 Config config ( "qpe" );
61 config. setGroup ( "MosfetMenus" ); 66 config. setGroup ( "Liquid-Style" );
62 67
63 m_type = config. readNumEntry ( "Type", TransStippleBg ); 68 m_type = config. readNumEntry ( "Type", TransStippleBg );
64 m_menucol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( ))); 69 m_menucol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( )));
65 m_textcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( ))); 70 m_textcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( )));
66 int opacity = config. readNumEntry ( "Opacity", 10 ); 71 int opacity = config. readNumEntry ( "Opacity", 10 );
67 m_shadow = config. readBoolEntry ( "ShadowText", true ); 72 m_shadow = config. readBoolEntry ( "ShadowText", true );
73 m_deco = config. readBoolEntry ( "WinDecoration", true );
74 int contrast = config. readNumEntry ( "StippleContrast", 5 );
68 75
@@ -140,3 +147,3 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl )
140 147
141 QCheckBox *shadow = new QCheckBox ( tr( "Use shadowed text" ), this ); 148 QCheckBox *shadow = new QCheckBox ( tr( "Use shadowed menu text" ), this );
142 shadow-> setChecked ( m_shadow ); 149 shadow-> setChecked ( m_shadow );
@@ -144,3 +151,23 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl )
144 151
152 vbox-> addSpacing ( 4 );
153
154 QCheckBox *windeco = new QCheckBox ( tr( "Draw liquid window title bars" ), this );
155 windeco-> setChecked ( m_deco );
156 vbox-> addWidget ( windeco );
157
158 vbox-> addSpacing ( 4 );
159
160 QHBoxLayout *hbox = new QHBoxLayout ( vbox );
161
162 hbox-> addWidget ( new QLabel ( tr( "Stipple contrast" ), this ));
163
164 m_contsld = new QSlider ( Horizontal, this );
165 m_contsld-> setRange ( 0, 10 );
166 m_contsld-> setValue ( contrast );
167 m_contsld-> setTickmarks ( QSlider::Below );
168 hbox-> addWidget ( m_contsld, 10 );
169
145 vbox-> addStretch ( 10 ); 170 vbox-> addStretch ( 10 );
171
172 changeType ( m_type );
146 173
@@ -148,2 +175,3 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl )
148 connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); 175 connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) );
176 connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) );
149} 177}
@@ -166,3 +194,3 @@ void LiquidSet::changeMenuColor ( const QColor &col )
166{ 194{
167 m_menubtn-> setPalette ( col ); 195 changeButtonColor ( m_menubtn, col );
168 m_menucol = col; 196 m_menucol = col;
@@ -172,3 +200,3 @@ void LiquidSet::changeTextColor ( const QColor &col )
172{ 200{
173 m_textbtn-> setPalette ( col ); 201 changeButtonColor ( m_textbtn, col );
174 m_textcol = col; 202 m_textcol = col;
@@ -181,2 +209,7 @@ void LiquidSet::changeShadow ( bool b )
181 209
210void LiquidSet::changeDeco ( bool b )
211{
212 m_deco = b;
213}
214
182 215
@@ -185,3 +218,3 @@ void LiquidSet::accept ( )
185 Config config ( "qpe" ); 218 Config config ( "qpe" );
186 config. setGroup ( "MosfetMenus" ); 219 config. setGroup ( "Liquid-Style" );
187 220
@@ -192,2 +225,4 @@ void LiquidSet::accept ( )
192 config. writeEntry ( "ShadowText", m_shadow ); 225 config. writeEntry ( "ShadowText", m_shadow );
226 config. writeEntry ( "WinDecoration", m_deco );
227 config. writeEntry ( "StippleContrast", m_contsld-> value ( ));
193 config. write ( ); 228 config. write ( );
diff --git a/noncore/styles/liquid/settings/liquidset.h b/noncore/styles/liquid/settings/liquidset.h
index 944b1ec..a0f590a 100644
--- a/noncore/styles/liquid/settings/liquidset.h
+++ b/noncore/styles/liquid/settings/liquidset.h
@@ -21,2 +21,3 @@ public slots:
21 void changeShadow ( bool b ); 21 void changeShadow ( bool b );
22 void changeDeco ( bool b );
22 23
@@ -30,4 +31,6 @@ private:
30 bool m_shadow; 31 bool m_shadow;
32 bool m_deco;
31 33
32 QSlider * m_opacsld; 34 QSlider * m_opacsld;
35 QSlider * m_contsld;
33 QLabel * m_menulbl; 36 QLabel * m_menulbl;