summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid/liquid.cpp
authorsandman <sandman>2002-06-27 20:23:25 (UTC)
committer sandman <sandman>2002-06-27 20:23:25 (UTC)
commitc9871ef295afed6bc4f4cc5451f46bf3b6e8d462 (patch) (unidiff)
tree2fa3264c0a847100d1368df6e1eae2dd5b7a47ac /noncore/styles/liquid/liquid.cpp
parent9cd1aef30015628e06e8f24b9b7e91acb631b52b (diff)
downloadopie-c9871ef295afed6bc4f4cc5451f46bf3b6e8d462.zip
opie-c9871ef295afed6bc4f4cc5451f46bf3b6e8d462.tar.gz
opie-c9871ef295afed6bc4f4cc5451f46bf3b6e8d462.tar.bz2
Enhanced liquid style:
1) All WType_Popup's now get a transparent background (volume-applet) 2) Settings/Liquid Settings - a new app that acts like the KDE Control Panel page for Liquid
Diffstat (limited to 'noncore/styles/liquid/liquid.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/liquid.cpp57
1 files changed, 53 insertions, 4 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp
index 5f014ad..4653639 100644
--- a/noncore/styles/liquid/liquid.cpp
+++ b/noncore/styles/liquid/liquid.cpp
@@ -85,2 +85,7 @@ void TransMenuHandler::reloadSettings()
85 opacity = config. readNumEntry("Opacity", 10); 85 opacity = config. readNumEntry("Opacity", 10);
86 if ( opacity < -20 )
87 opacity = 20;
88 else if ( opacity > 20 )
89 opacity = 20;
90
86 shadowText = config. readBoolEntry("ShadowText", true); 91 shadowText = config. readBoolEntry("ShadowText", true);
@@ -90,3 +95,3 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev)
90{ 95{
91 QPopupMenu *p = (QPopupMenu *)obj; 96 QWidget *p = (QWidget *)obj;
92 97
@@ -120,3 +125,17 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev)
120 } 125 }
121 pixDict.insert(p->winId(), pix); 126
127 if (p->inherits("QPopupMenu"))
128 pixDict.insert(p->winId(), pix);
129 else {
130 p->setBackgroundPixmap(*pix);
131
132 QObjectList *ol = p-> queryList("QWidget");
133 for ( QObjectListIt it( *ol ); it. current ( ); ++it ) {
134 QWidget *wid = (QWidget *) it.current ( );
135
136 wid-> setBackgroundPixmap(*pix);
137 wid-> setBackgroundOrigin(QWidget::ParentOrigin);
138 }
139 delete ol;
140 }
122 } 141 }
@@ -127,3 +146,25 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev)
127// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); 146// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width());
128 pixDict.remove(p->winId()); 147
148 if (p->inherits("QPopupMenu"))
149 pixDict.remove(p->winId());
150 else {
151 p->setBackgroundMode(QWidget::PaletteBackground);
152
153 QObjectList *ol = p-> queryList("QWidget");
154 for ( QObjectListIt it( *ol ); it. current ( ); ++it ) {
155 QWidget *wid = (QWidget *) it.current ( );
156
157 wid-> setBackgroundMode( QWidget::PaletteBackground );
158 }
159 delete ol;
160 }
161 }
162 }
163 else if(ev->type() == QEvent::Paint){
164 if(type == TransStippleBg || type == TransStippleBtn ||
165 type == Custom){
166// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width());
167
168 if (!p->inherits("QPopupMenu"))
169 p->erase();
129 } 170 }
@@ -798,3 +839,7 @@ void LiquidStyle::polish(QWidget *w)
798 w->setBackgroundMode(QWidget::NoBackground); 839 w->setBackgroundMode(QWidget::NoBackground);
799 840 else if(w-> testWFlags(Qt::WType_Popup)) {
841 printf("install popup: %s\n", w-> className ( ));
842 w->installEventFilter(menuHandler);
843 }
844
800 if(w->isTopLevel()){ 845 if(w->isTopLevel()){
@@ -802,2 +847,3 @@ void LiquidStyle::polish(QWidget *w)
802 } 847 }
848
803 849
@@ -888,2 +934,5 @@ void LiquidStyle::unPolish(QWidget *w)
888 w->setBackgroundMode(QWidget::PaletteButton); 934 w->setBackgroundMode(QWidget::PaletteButton);
935 else if(w-> testWFlags(Qt::WType_Popup)) {
936 w->removeEventFilter(menuHandler);
937 }
889 938