-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 14 | ||||
-rw-r--r-- | noncore/styles/liquid/plugin.cpp | 2 |
2 files changed, 3 insertions, 13 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp index 4653639..2b6eaa4 100644 --- a/noncore/styles/liquid/liquid.cpp +++ b/noncore/styles/liquid/liquid.cpp | |||
@@ -147,41 +147,32 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev) | |||
147 | 147 | ||
148 | if (p->inherits("QPopupMenu")) | 148 | if (p->inherits("QPopupMenu")) |
149 | pixDict.remove(p->winId()); | 149 | pixDict.remove(p->winId()); |
150 | else { | 150 | else { |
151 | p->setBackgroundMode(QWidget::PaletteBackground); | 151 | p->setBackgroundMode(QWidget::PaletteBackground); |
152 | 152 | ||
153 | QObjectList *ol = p-> queryList("QWidget"); | 153 | QObjectList *ol = p-> queryList("QWidget"); |
154 | for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { | 154 | for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { |
155 | QWidget *wid = (QWidget *) it.current ( ); | 155 | QWidget *wid = (QWidget *) it.current ( ); |
156 | 156 | ||
157 | wid-> setBackgroundMode( QWidget::PaletteBackground ); | 157 | wid-> setBackgroundMode( QWidget::PaletteBackground ); |
158 | } | 158 | } |
159 | delete ol; | 159 | delete ol; |
160 | } | 160 | } |
161 | } | 161 | } |
162 | } | 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(); | ||
170 | } | ||
171 | } | ||
172 | return(false); | 163 | return(false); |
173 | } | 164 | } |
174 | 165 | ||
175 | 166 | ||
176 | LiquidStyle::LiquidStyle() | 167 | LiquidStyle::LiquidStyle() |
177 | :QWindowsStyle() | 168 | :QWindowsStyle() |
178 | { | 169 | { |
179 | setName ( "LiquidStyle" ); | 170 | setName ( "LiquidStyle" ); |
180 | 171 | ||
181 | btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); | 172 | btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); |
182 | btnMaskBmp.setMask(btnMaskBmp); | 173 | btnMaskBmp.setMask(btnMaskBmp); |
183 | htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); | 174 | htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); |
184 | htmlBtnMaskBmp.setMask(htmlBtnMaskBmp); | 175 | htmlBtnMaskBmp.setMask(htmlBtnMaskBmp); |
185 | headerHoverID = -1; | 176 | headerHoverID = -1; |
186 | highlightWidget = NULL; | 177 | highlightWidget = NULL; |
187 | setButtonDefaultIndicatorWidth(0); | 178 | setButtonDefaultIndicatorWidth(0); |
@@ -824,34 +815,33 @@ void LiquidStyle::polish(QPalette &appPal) | |||
824 | else if(w->inherits("QPushButton")){ | 815 | else if(w->inherits("QPushButton")){ |
825 | applyCustomAttributes((QPushButton *)w); | 816 | applyCustomAttributes((QPushButton *)w); |
826 | } | 817 | } |
827 | } | 818 | } |
828 | 819 | ||
829 | } | 820 | } |
830 | 821 | ||
831 | void LiquidStyle::polish(QWidget *w) | 822 | void LiquidStyle::polish(QWidget *w) |
832 | { | 823 | { |
833 | if(w->inherits("QMenuBar")){ | 824 | if(w->inherits("QMenuBar")){ |
834 | //((QFrame*)w)->setLineWidth(0); | 825 | //((QFrame*)w)->setLineWidth(0); |
835 | w->setBackgroundMode(QWidget::PaletteBackground); | 826 | w->setBackgroundMode(QWidget::PaletteBackground); |
836 | return; | 827 | return; |
837 | } | 828 | } |
838 | if(w->inherits("QPopupMenu")) | 829 | if(w->inherits("QPopupMenu")) |
839 | w->setBackgroundMode(QWidget::NoBackground); | 830 | w->setBackgroundMode(QWidget::NoBackground); |
840 | else if(w-> testWFlags(Qt::WType_Popup)) { | 831 | else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { |
841 | printf("install popup: %s\n", w-> className ( )); | ||
842 | w->installEventFilter(menuHandler); | 832 | w->installEventFilter(menuHandler); |
843 | } | 833 | } |
844 | 834 | ||
845 | if(w->isTopLevel()){ | 835 | if(w->isTopLevel()){ |
846 | return; | 836 | return; |
847 | } | 837 | } |
848 | 838 | ||
849 | 839 | ||
850 | w-> setBackgroundOrigin ( QWidget::ParentOrigin ); | 840 | w-> setBackgroundOrigin ( QWidget::ParentOrigin ); |
851 | 841 | ||
852 | if(w->inherits("QComboBox") || | 842 | if(w->inherits("QComboBox") || |
853 | w->inherits("QLineEdit") || w->inherits("QRadioButton") || | 843 | w->inherits("QLineEdit") || w->inherits("QRadioButton") || |
854 | w->inherits("QCheckBox") || w->inherits("QScrollBar")) { | 844 | w->inherits("QCheckBox") || w->inherits("QScrollBar")) { |
855 | w->installEventFilter(this); | 845 | w->installEventFilter(this); |
856 | } | 846 | } |
857 | if(w->inherits("QLineEdit")){ | 847 | if(w->inherits("QLineEdit")){ |
@@ -919,33 +909,33 @@ void LiquidStyle::polish(QWidget *w) | |||
919 | w->setBackgroundMode(QWidget::PaletteBackground); | 909 | w->setBackgroundMode(QWidget::PaletteBackground); |
920 | return; | 910 | return; |
921 | } | 911 | } |
922 | 912 | ||
923 | } | 913 | } |
924 | 914 | ||
925 | void LiquidStyle::unPolish(QWidget *w) | 915 | void LiquidStyle::unPolish(QWidget *w) |
926 | { | 916 | { |
927 | if(w->inherits("QMenuBar")){ | 917 | if(w->inherits("QMenuBar")){ |
928 | ((QFrame *)w)->setLineWidth(1); | 918 | ((QFrame *)w)->setLineWidth(1); |
929 | w->setBackgroundMode(QWidget::PaletteBackground); | 919 | w->setBackgroundMode(QWidget::PaletteBackground); |
930 | return; | 920 | return; |
931 | } | 921 | } |
932 | 922 | ||
933 | if(w->inherits("QPopupMenu")) | 923 | if(w->inherits("QPopupMenu")) |
934 | w->setBackgroundMode(QWidget::PaletteButton); | 924 | w->setBackgroundMode(QWidget::PaletteButton); |
935 | else if(w-> testWFlags(Qt::WType_Popup)) { | 925 | else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { |
936 | w->removeEventFilter(menuHandler); | 926 | w->removeEventFilter(menuHandler); |
937 | } | 927 | } |
938 | 928 | ||
939 | if(w->isTopLevel()) | 929 | if(w->isTopLevel()) |
940 | return; | 930 | return; |
941 | 931 | ||
942 | // for viewport children, don't just check for NoBackground.... | 932 | // for viewport children, don't just check for NoBackground.... |
943 | bool isViewportChild = w->parent() && | 933 | bool isViewportChild = w->parent() && |
944 | ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) || | 934 | ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) || |
945 | (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0)); | 935 | (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0)); |
946 | 936 | ||
947 | w->setPalette(QApplication::palette()); | 937 | w->setPalette(QApplication::palette()); |
948 | if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){ | 938 | if(w->backgroundMode() == QWidget::X11ParentRelative || isViewportChild){ |
949 | if(w->inherits("QPushButton")) | 939 | if(w->inherits("QPushButton")) |
950 | w->setBackgroundMode(QWidget::PaletteButton); | 940 | w->setBackgroundMode(QWidget::PaletteButton); |
951 | else | 941 | else |
diff --git a/noncore/styles/liquid/plugin.cpp b/noncore/styles/liquid/plugin.cpp index fca7c06..d9aa8ef 100644 --- a/noncore/styles/liquid/plugin.cpp +++ b/noncore/styles/liquid/plugin.cpp | |||
@@ -12,18 +12,18 @@ QStyle* allocate ( ) | |||
12 | { | 12 | { |
13 | return new LiquidStyle ( ); | 13 | return new LiquidStyle ( ); |
14 | } | 14 | } |
15 | 15 | ||
16 | int minor_version ( ) | 16 | int minor_version ( ) |
17 | { | 17 | { |
18 | return 0; | 18 | return 0; |
19 | } | 19 | } |
20 | 20 | ||
21 | int major_version ( ) | 21 | int major_version ( ) |
22 | { | 22 | { |
23 | return 1; | 23 | return 1; |
24 | } | 24 | } |
25 | 25 | ||
26 | const char *description ( ) | 26 | const char *description ( ) |
27 | { | 27 | { |
28 | return "High performance liquid plugin"; | 28 | return "High Performance Liquid"; |
29 | } | 29 | } |