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) (side-by-side diff)
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()
opacity = config. readNumEntry("Opacity", 10);
+ if ( opacity < -20 )
+ opacity = 20;
+ else if ( opacity > 20 )
+ opacity = 20;
+
shadowText = config. readBoolEntry("ShadowText", true);
@@ -90,3 +95,3 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev)
{
- QPopupMenu *p = (QPopupMenu *)obj;
+ QWidget *p = (QWidget *)obj;
@@ -120,3 +125,17 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev)
}
- pixDict.insert(p->winId(), pix);
+
+ if (p->inherits("QPopupMenu"))
+ pixDict.insert(p->winId(), pix);
+ else {
+ p->setBackgroundPixmap(*pix);
+
+ QObjectList *ol = p-> queryList("QWidget");
+ for ( QObjectListIt it( *ol ); it. current ( ); ++it ) {
+ QWidget *wid = (QWidget *) it.current ( );
+
+ wid-> setBackgroundPixmap(*pix);
+ wid-> setBackgroundOrigin(QWidget::ParentOrigin);
+ }
+ delete ol;
+ }
}
@@ -127,3 +146,25 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev)
// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width());
- pixDict.remove(p->winId());
+
+ if (p->inherits("QPopupMenu"))
+ pixDict.remove(p->winId());
+ else {
+ p->setBackgroundMode(QWidget::PaletteBackground);
+
+ QObjectList *ol = p-> queryList("QWidget");
+ for ( QObjectListIt it( *ol ); it. current ( ); ++it ) {
+ QWidget *wid = (QWidget *) it.current ( );
+
+ wid-> setBackgroundMode( QWidget::PaletteBackground );
+ }
+ delete ol;
+ }
+ }
+ }
+ else if(ev->type() == QEvent::Paint){
+ if(type == TransStippleBg || type == TransStippleBtn ||
+ type == Custom){
+// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width());
+
+ if (!p->inherits("QPopupMenu"))
+ p->erase();
}
@@ -798,3 +839,7 @@ void LiquidStyle::polish(QWidget *w)
w->setBackgroundMode(QWidget::NoBackground);
-
+ else if(w-> testWFlags(Qt::WType_Popup)) {
+ printf("install popup: %s\n", w-> className ( ));
+ w->installEventFilter(menuHandler);
+ }
+
if(w->isTopLevel()){
@@ -802,2 +847,3 @@ void LiquidStyle::polish(QWidget *w)
}
+
@@ -888,2 +934,5 @@ void LiquidStyle::unPolish(QWidget *w)
w->setBackgroundMode(QWidget::PaletteButton);
+ else if(w-> testWFlags(Qt::WType_Popup)) {
+ w->removeEventFilter(menuHandler);
+ }