summaryrefslogtreecommitdiff
authorsandman <sandman>2002-07-01 23:39:51 (UTC)
committer sandman <sandman>2002-07-01 23:39:51 (UTC)
commit329ea43b68180058bcd8e9d2af4d09d9c03c55a3 (patch) (side-by-side diff)
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()
Config config ( "qpe" );
- config. setGroup ( "MosfetMenus" );
+ config. setGroup ( "Liquid-Style" );
@@ -712,2 +712,9 @@ void LiquidStyle::polish(QPalette &appPal)
Config config ( "qpe" );
+ config. setGroup ( "Liquid-Style" );
+ int contrast = config. readNumEntry ( "StippleContrast", 5 );
+ if ( contrast < 0 )
+ contrast = 0;
+ else if ( contrast > 10 )
+ contrast = 10;
+
QPalette pal = QApplication::palette();
@@ -783,5 +790,5 @@ void LiquidStyle::polish(QPalette &appPal)
for(i=0; i < 32; i+=4){
- painter.setPen(c.dark(105));
+ painter.setPen(c.dark(100 + contrast));
painter.drawLine(0, i, 32, i);
- painter.setPen(c.dark(103));
+ painter.setPen(c.dark(100 + 3 * contrast / 5 ) );
painter.drawLine(0, i+1, 32, i+1);
@@ -991,3 +998,7 @@ void LiquidStyle::polish(QApplication *app)
- QApplication::qwsSetDecoration ( new LiquidDecoration ( ));
+ Config config ( "qpe" );
+ config. setGroup ( "Liquid-Style" );
+
+ if ( config. readBoolEntry ( "WinDecoration", true ))
+ QApplication::qwsSetDecoration ( new LiquidDecoration ( ));
}
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 )
if ( titleWidth > 0 ) {
- QBrush titleBrush;
- QPen titlePen;
- QPen titleLines;
- int titleLeft = titleHeight + 4;
-
- titleLeft = rect.left() + 5;
painter->setPen( cg.midlight() );
@@ -117,12 +111,12 @@ void LiquidDecoration::paint( QPainter *painter, const QWidget *widget )
- t.setLeft( t.left() + 4 );
- t.setRight( t.right() - 2 );
+ t .setLeft ( t. left ( ) + 4 );
+ t .setRight ( t. right ( ) - 2 );
- QFont f( QApplication::font() );
- f.setWeight( QFont::Bold );
+ QFont f ( QApplication::font ( ));
+ f. setWeight ( QFont::Bold );
- painter-> setFont( f );
+ painter-> setFont ( f );
QColor textcol = cg.color( isActive ? QColorGroup::HighlightedText : QColorGroup::Text );
- QColor shadecol = ( qGray ( textcol. rgb ( ) ) > 128 ) ? textcol. dark ( 130 ) : textcol.light( 200 );
+ QColor shadecol = ( qGray ( textcol. rgb ( ) ) > 128 ) ? textcol. dark ( 230 ) : textcol.light( 300 );
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 )
+ pal. setColor ( QPalette::Normal, QColorGroup::Button, col );
pal. setColor ( QPalette::Active, QColorGroup::Button, col );
@@ -49,2 +50,6 @@ static void changeButtonColor ( QWidget *btn, const QColor &col )
pal. setColor ( QPalette::Inactive, QColorGroup::Button, col );
+ pal. setColor ( QPalette::Normal, QColorGroup::Background, col );
+ pal. setColor ( QPalette::Active, QColorGroup::Background, col );
+ pal. setColor ( QPalette::Disabled, QColorGroup::Background, col );
+ pal. setColor ( QPalette::Inactive, QColorGroup::Background, col );
@@ -60,9 +65,11 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl )
Config config ( "qpe" );
- config. setGroup ( "MosfetMenus" );
+ config. setGroup ( "Liquid-Style" );
- m_type = config. readNumEntry ( "Type", TransStippleBg );
- m_menucol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( )));
- m_textcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( )));
- int opacity = config. readNumEntry ( "Opacity", 10 );
- m_shadow = config. readBoolEntry ( "ShadowText", true );
+ m_type = config. readNumEntry ( "Type", TransStippleBg );
+ m_menucol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( )));
+ m_textcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( )));
+ int opacity = config. readNumEntry ( "Opacity", 10 );
+ m_shadow = config. readBoolEntry ( "ShadowText", true );
+ m_deco = config. readBoolEntry ( "WinDecoration", true );
+ int contrast = config. readNumEntry ( "StippleContrast", 5 );
@@ -140,3 +147,3 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl )
- QCheckBox *shadow = new QCheckBox ( tr( "Use shadowed text" ), this );
+ QCheckBox *shadow = new QCheckBox ( tr( "Use shadowed menu text" ), this );
shadow-> setChecked ( m_shadow );
@@ -144,3 +151,23 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl )
+ vbox-> addSpacing ( 4 );
+
+ QCheckBox *windeco = new QCheckBox ( tr( "Draw liquid window title bars" ), this );
+ windeco-> setChecked ( m_deco );
+ vbox-> addWidget ( windeco );
+
+ vbox-> addSpacing ( 4 );
+
+ QHBoxLayout *hbox = new QHBoxLayout ( vbox );
+
+ hbox-> addWidget ( new QLabel ( tr( "Stipple contrast" ), this ));
+
+ m_contsld = new QSlider ( Horizontal, this );
+ m_contsld-> setRange ( 0, 10 );
+ m_contsld-> setValue ( contrast );
+ m_contsld-> setTickmarks ( QSlider::Below );
+ hbox-> addWidget ( m_contsld, 10 );
+
vbox-> addStretch ( 10 );
+
+ changeType ( m_type );
@@ -148,2 +175,3 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl )
connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) );
+ connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) );
}
@@ -166,3 +194,3 @@ void LiquidSet::changeMenuColor ( const QColor &col )
{
- m_menubtn-> setPalette ( col );
+ changeButtonColor ( m_menubtn, col );
m_menucol = col;
@@ -172,3 +200,3 @@ void LiquidSet::changeTextColor ( const QColor &col )
{
- m_textbtn-> setPalette ( col );
+ changeButtonColor ( m_textbtn, col );
m_textcol = col;
@@ -181,2 +209,7 @@ void LiquidSet::changeShadow ( bool b )
+void LiquidSet::changeDeco ( bool b )
+{
+ m_deco = b;
+}
+
@@ -185,3 +218,3 @@ void LiquidSet::accept ( )
Config config ( "qpe" );
- config. setGroup ( "MosfetMenus" );
+ config. setGroup ( "Liquid-Style" );
@@ -192,2 +225,4 @@ void LiquidSet::accept ( )
config. writeEntry ( "ShadowText", m_shadow );
+ config. writeEntry ( "WinDecoration", m_deco );
+ config. writeEntry ( "StippleContrast", m_contsld-> value ( ));
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:
void changeShadow ( bool b );
+ void changeDeco ( bool b );
@@ -30,4 +31,6 @@ private:
bool m_shadow;
+ bool m_deco;
QSlider * m_opacsld;
+ QSlider * m_contsld;
QLabel * m_menulbl;