author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/styles | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
-rw-r--r-- | noncore/styles/liquid/config.in | 2 | ||||
-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 27 | ||||
-rw-r--r-- | noncore/styles/liquid/liquid.pro | 6 | ||||
-rw-r--r-- | noncore/styles/theme/othemebase.cpp | 27 |
4 files changed, 31 insertions, 31 deletions
diff --git a/noncore/styles/liquid/config.in b/noncore/styles/liquid/config.in index 23f8637..cffdb39 100644 --- a/noncore/styles/liquid/config.in +++ b/noncore/styles/liquid/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config LIQUID | 1 | config LIQUID |
2 | boolean "opie-liquid (Mosfet's well known Liquid GUI style from KDE)" | 2 | boolean "opie-liquid (Mosfet's well known Liquid GUI style from KDE)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBQTAUX | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBQTAUX && LIBOPIE2CORE |
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp index bac882c..51814e7 100644 --- a/noncore/styles/liquid/liquid.cpp +++ b/noncore/styles/liquid/liquid.cpp | |||
@@ -2,55 +2,60 @@ | |||
2 | * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved. | 2 | * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved. |
3 | */ | 3 | */ |
4 | 4 | ||
5 | // | 5 | // |
6 | // (c) 2002 Robert 'sandman' Griebl | 6 | // (c) 2002 Robert 'sandman' Griebl |
7 | // | 7 | // |
8 | 8 | ||
9 | 9 | ||
10 | #ifndef INCLUDE_MENUITEM_DEF | 10 | #ifndef INCLUDE_MENUITEM_DEF |
11 | #define INCLUDE_MENUITEM_DEF | 11 | #define INCLUDE_MENUITEM_DEF |
12 | #endif | 12 | #endif |
13 | 13 | ||
14 | #include <qmenudata.h> | ||
15 | #include "liquid.h" | 14 | #include "liquid.h" |
16 | //#include "liquiddeco.h" | 15 | #include "effects.h" |
17 | #include <qapplication.h> | 16 | #include "htmlmasks.h" |
17 | #include "embeddata.h" | ||
18 | |||
19 | /* OPIE */ | ||
20 | #include <opie2/odebug.h> | ||
18 | #include <qpe/config.h> | 21 | #include <qpe/config.h> |
19 | #include "effects.h" | 22 | using namespace Opie::Core; |
23 | |||
24 | /* QT */ | ||
25 | #include <qmenudata.h> | ||
26 | #include <qapplication.h> | ||
20 | #include <qpalette.h> | 27 | #include <qpalette.h> |
21 | #include <qbitmap.h> | 28 | #include <qbitmap.h> |
22 | #include <qtabbar.h> | 29 | #include <qtabbar.h> |
23 | #include <qpopupmenu.h> | 30 | #include <qpopupmenu.h> |
24 | #include <qobjectlist.h> | 31 | #include <qobjectlist.h> |
25 | #include <qimage.h> | 32 | #include <qimage.h> |
26 | #include <qtimer.h> | 33 | #include <qtimer.h> |
27 | #include <qpixmapcache.h> | 34 | #include <qpixmapcache.h> |
28 | #include <qradiobutton.h> | 35 | #include <qradiobutton.h> |
29 | #include <qcombobox.h> | 36 | #include <qcombobox.h> |
30 | #include <qdrawutil.h> | 37 | #include <qdrawutil.h> |
31 | #include <qwidgetlist.h> | 38 | #include <qwidgetlist.h> |
32 | #include <qtoolbutton.h> | 39 | #include <qtoolbutton.h> |
33 | #include <qheader.h> | 40 | #include <qheader.h> |
34 | #include <unistd.h> | ||
35 | #include <qmenubar.h> | 41 | #include <qmenubar.h> |
36 | #include <qprogressbar.h> | 42 | #include <qprogressbar.h> |
37 | #include <qlineedit.h> | 43 | #include <qlineedit.h> |
38 | #include <qlistbox.h> | 44 | #include <qlistbox.h> |
39 | 45 | ||
46 | /* STD */ | ||
47 | #include <unistd.h> | ||
40 | #include <stdio.h> | 48 | #include <stdio.h> |
41 | 49 | ||
42 | #include "htmlmasks.h" | ||
43 | #include "embeddata.h" | ||
44 | |||
45 | 50 | ||
46 | typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *, | 51 | typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *, |
47 | QColorGroup &, bool, bool); | 52 | QColorGroup &, bool, bool); |
48 | 53 | ||
49 | QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl impl); | 54 | QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl impl); |
50 | 55 | ||
51 | void TransMenuHandler::stripePixmap(QPixmap &pix, const QColor &color) | 56 | void TransMenuHandler::stripePixmap(QPixmap &pix, const QColor &color) |
52 | { | 57 | { |
53 | QImage img(pix.convertToImage()); | 58 | QImage img(pix.convertToImage()); |
54 | QImageEffect::fade(img, 0.9, color); | 59 | QImageEffect::fade(img, 0.9, color); |
55 | int x, y; | 60 | int x, y; |
56 | int r, g, b; | 61 | int r, g, b; |
@@ -140,25 +145,25 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev) | |||
140 | for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { | 145 | for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { |
141 | QWidget *wid = (QWidget *) it.current ( ); | 146 | QWidget *wid = (QWidget *) it.current ( ); |
142 | 147 | ||
143 | wid-> setBackgroundPixmap(*pix); | 148 | wid-> setBackgroundPixmap(*pix); |
144 | wid-> setBackgroundOrigin(QWidget::ParentOrigin); | 149 | wid-> setBackgroundOrigin(QWidget::ParentOrigin); |
145 | } | 150 | } |
146 | delete ol; | 151 | delete ol; |
147 | } | 152 | } |
148 | } | 153 | } |
149 | else if(ev->type() == QEvent::Hide){ | 154 | else if(ev->type() == QEvent::Hide){ |
150 | if(type == TransStippleBg || type == TransStippleBtn || | 155 | if(type == TransStippleBg || type == TransStippleBtn || |
151 | type == Custom){ | 156 | type == Custom){ |
152 | // qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); | 157 | // owarn << "Deleting menu pixmap, width " << pixDict.find(p->winId())->width() << "" << oendl; |
153 | 158 | ||
154 | pixDict.remove(p->winId()); | 159 | pixDict.remove(p->winId()); |
155 | if ( !p->inherits("QPopupMenu")) | 160 | if ( !p->inherits("QPopupMenu")) |
156 | p->setBackgroundMode(QWidget::PaletteBackground); | 161 | p->setBackgroundMode(QWidget::PaletteBackground); |
157 | 162 | ||
158 | QObjectList *ol = p-> queryList("QWidget"); | 163 | QObjectList *ol = p-> queryList("QWidget"); |
159 | for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { | 164 | for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { |
160 | QWidget *wid = (QWidget *) it.current ( ); | 165 | QWidget *wid = (QWidget *) it.current ( ); |
161 | 166 | ||
162 | wid-> setBackgroundMode( QWidget::PaletteBackground ); | 167 | wid-> setBackgroundMode( QWidget::PaletteBackground ); |
163 | } | 168 | } |
164 | delete ol; | 169 | delete ol; |
@@ -485,25 +490,25 @@ void LiquidStyle::drawRoundButton(QPainter *painter, const QColor &c, | |||
485 | 490 | ||
486 | 491 | ||
487 | 492 | ||
488 | } | 493 | } |
489 | 494 | ||
490 | 495 | ||
491 | QPixmap* LiquidStyle::processEmbedded(const char *label, int h, int s, int v, | 496 | QPixmap* LiquidStyle::processEmbedded(const char *label, int h, int s, int v, |
492 | bool blend) | 497 | bool blend) |
493 | { | 498 | { |
494 | QImage img(qembed_findImage(label)); | 499 | QImage img(qembed_findImage(label)); |
495 | img.detach(); | 500 | img.detach(); |
496 | if(img.isNull()){ // shouldn't happen, been tested | 501 | if(img.isNull()){ // shouldn't happen, been tested |
497 | qWarning("Invalid embedded label %s", label); | 502 | owarn << "Invalid embedded label " << label << "" << oendl; |
498 | return(NULL); | 503 | return(NULL); |
499 | } | 504 | } |
500 | if(img.depth() != 32) | 505 | if(img.depth() != 32) |
501 | img = img.convertDepth(32); | 506 | img = img.convertDepth(32); |
502 | unsigned int *data = (unsigned int *)img.bits(); | 507 | unsigned int *data = (unsigned int *)img.bits(); |
503 | int total = img.width()*img.height(); | 508 | int total = img.width()*img.height(); |
504 | int current; | 509 | int current; |
505 | QColor c; | 510 | QColor c; |
506 | int oldH, oldS, oldV; | 511 | int oldH, oldS, oldV; |
507 | int alpha; | 512 | int alpha; |
508 | if(v < 235) | 513 | if(v < 235) |
509 | v += 20; | 514 | v += 20; |
@@ -851,25 +856,25 @@ void LiquidStyle::polish(QWidget *w) | |||
851 | } | 856 | } |
852 | w-> installEventFilter ( this ); | 857 | w-> installEventFilter ( this ); |
853 | } | 858 | } |
854 | if(w-> inherits("QToolBarSeparator")&&w->parent()->inherits("QToolBar")) { | 859 | if(w-> inherits("QToolBarSeparator")&&w->parent()->inherits("QToolBar")) { |
855 | ((QFrame *) w)-> setFrameShape ( QFrame::NoFrame ); | 860 | ((QFrame *) w)-> setFrameShape ( QFrame::NoFrame ); |
856 | } | 861 | } |
857 | if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ | 862 | if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ |
858 | return; | 863 | return; |
859 | } | 864 | } |
860 | 865 | ||
861 | if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> | 866 | if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> |
862 | palette().active().brush(QColorGroup::Background).pixmap()){ | 867 | palette().active().brush(QColorGroup::Background).pixmap()){ |
863 | qWarning("No parent pixmap for child widget %s", w->className()); | 868 | owarn << "No parent pixmap for child widget " << w->className() << "" << oendl; |
864 | return; | 869 | return; |
865 | } | 870 | } |
866 | if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) && | 871 | if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) && |
867 | !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) { | 872 | !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) { |
868 | if(w->backgroundMode() == QWidget::PaletteBackground || | 873 | if(w->backgroundMode() == QWidget::PaletteBackground || |
869 | w->backgroundMode() == QWidget::PaletteButton){ | 874 | w->backgroundMode() == QWidget::PaletteButton){ |
870 | w->setBackgroundMode(w->parentWidget()->backgroundMode( )/*QWidget::X11ParentRelative*/); | 875 | w->setBackgroundMode(w->parentWidget()->backgroundMode( )/*QWidget::X11ParentRelative*/); |
871 | w->setBackgroundOrigin(QWidget::ParentOrigin); | 876 | w->setBackgroundOrigin(QWidget::ParentOrigin); |
872 | // w->setBackgroundMode(QWidget::NoBackground); | 877 | // w->setBackgroundMode(QWidget::NoBackground); |
873 | } | 878 | } |
874 | } | 879 | } |
875 | if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) | 880 | if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) |
diff --git a/noncore/styles/liquid/liquid.pro b/noncore/styles/liquid/liquid.pro index 7fe2829..767007f 100644 --- a/noncore/styles/liquid/liquid.pro +++ b/noncore/styles/liquid/liquid.pro | |||
@@ -1,19 +1,19 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG = qt plugin embedded warn_on | 2 | CONFIG = qt plugin embedded warn_on |
3 | SOURCES = liquid.cpp \ | 3 | SOURCES = liquid.cpp \ |
4 | effects.cpp \ | 4 | effects.cpp \ |
5 | liquidset.cpp \ | 5 | liquidset.cpp \ |
6 | plugin.cpp | 6 | plugin.cpp |
7 | 7 | ||
8 | HEADERS = liquid.h \ | 8 | HEADERS = liquid.h \ |
9 | effects.h \ | 9 | effects.h \ |
10 | liquidset.h \ | 10 | liquidset.h \ |
11 | plugin.h | 11 | plugin.h |
12 | 12 | ||
13 | LIBS += -lqpe -lqtaux2 | 13 | LIBS += -lqpe -lqtaux2 -lopiecore2 |
14 | INCLUDEPATH += $(OPIEDIR)/include | 14 | INCLUDEPATH += $(OPIEDIR)/include |
15 | DESTDIR = $(OPIEDIR)/plugins/styles | 15 | DESTDIR = $(OPIEDIR)/plugins/styles |
16 | TARGET = liquid | 16 | TARGET = liquid |
17 | VERSION = 1.0.0 | 17 | VERSION = 1.0.1 |
18 | 18 | ||
19 | include ( $(OPIEDIR)/include.pro ) | 19 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/styles/theme/othemebase.cpp b/noncore/styles/theme/othemebase.cpp index 62b3a11..7ce4e5a 100644 --- a/noncore/styles/theme/othemebase.cpp +++ b/noncore/styles/theme/othemebase.cpp | |||
@@ -6,42 +6,44 @@ | |||
6 | License version 2 as published by the Free Software Foundation. | 6 | License version 2 as published by the Free Software Foundation. |
7 | 7 | ||
8 | This library is distributed in the hope that it will be useful, | 8 | This library is distributed in the hope that it will be useful, |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 | Library General Public License for more details. | 11 | Library General Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU Library General Public License | 13 | You should have received a copy of the GNU Library General Public License |
14 | along with this library; see the file COPYING.LIB. If not, write to | 14 | along with this library; see the file COPYING.LIB. If not, write to |
15 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 15 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
16 | Boston, MA 02111-1307, USA. | 16 | Boston, MA 02111-1307, USA. |
17 | */ | 17 | */ |
18 | |||
18 | #include "othemebase.h" | 19 | #include "othemebase.h" |
19 | #include "ogfxeffect.h" | 20 | #include "ogfxeffect.h" |
21 | |||
22 | /* OPIE */ | ||
23 | #include <opie2/odebug.h> | ||
20 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
21 | //#include <kdebug.h> | 25 | #include <qpe/config.h> |
22 | //#include <klocale.h> | 26 | using namespace Opie::Core; |
23 | #include <qpe/config.h> | 27 | |
24 | //#include <kglobal.h> | 28 | /* QT */ |
25 | //#include <kglobalsettings.h> | ||
26 | //#include <kstddirs.h> | ||
27 | #include <qfile.h> | 29 | #include <qfile.h> |
28 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
29 | #include <qdir.h> | 31 | #include <qdir.h> |
30 | #include <qpainter.h> | 32 | #include <qpainter.h> |
31 | #include <qbitmap.h> | 33 | #include <qbitmap.h> |
32 | #include <stdlib.h> | ||
33 | #include <qstringlist.h> | 34 | #include <qstringlist.h> |
34 | 35 | ||
35 | #include <stdio.h> | 36 | /* STD */ |
37 | #include <stdlib.h> | ||
36 | 38 | ||
37 | 39 | ||
38 | template class QIntCache<OThemePixmap> | 40 | template class QIntCache<OThemePixmap> |
39 | ; | 41 | ; |
40 | 42 | ||
41 | static const char *widgetEntries[] = | 43 | static const char *widgetEntries[] = |
42 | { // unsunken widgets (see header) | 44 | { // unsunken widgets (see header) |
43 | "PushButton", "ComboBox", "HSBarSlider", "VSBarSlider", "Bevel", "ToolButton", | 45 | "PushButton", "ComboBox", "HSBarSlider", "VSBarSlider", "Bevel", "ToolButton", |
44 | "ScrollButton", "HScrollDeco", "VScrollDeco", "ComboDeco", "MenuItem", "Tab", | 46 | "ScrollButton", "HScrollDeco", "VScrollDeco", "ComboDeco", "MenuItem", "Tab", |
45 | "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", | 47 | "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", |
46 | // sunken widgets | 48 | // sunken widgets |
47 | "PushButtonDown", "ComboBoxDown", "HSBarSliderDown", "VSBarSliderDown", | 49 | "PushButtonDown", "ComboBoxDown", "HSBarSliderDown", "VSBarSliderDown", |
@@ -253,58 +255,51 @@ void OThemeBase::readConfig( Qt::GUIStyle /*style*/ ) | |||
253 | QString pixnames[ WIDGETS ]; // used for duplicate check | 255 | QString pixnames[ WIDGETS ]; // used for duplicate check |
254 | QString brdnames[ WIDGETS ]; | 256 | QString brdnames[ WIDGETS ]; |
255 | bool loaded[ WIDGETS ]; // used for preloading for CopyWidget | 257 | bool loaded[ WIDGETS ]; // used for preloading for CopyWidget |
256 | 258 | ||
257 | if ( configFileName.isEmpty() ) { | 259 | if ( configFileName.isEmpty() ) { |
258 | Config cfg ( "qpe" ); | 260 | Config cfg ( "qpe" ); |
259 | cfg. setGroup ( "Appearance" ); | 261 | cfg. setGroup ( "Appearance" ); |
260 | 262 | ||
261 | configFileName = cfg. readEntry ( "Theme", "default" ); | 263 | configFileName = cfg. readEntry ( "Theme", "default" ); |
262 | } | 264 | } |
263 | Config config( configFilePath + "/themes/" + configFileName + ".themerc" , Config::File ); | 265 | Config config( configFilePath + "/themes/" + configFileName + ".themerc" , Config::File ); |
264 | 266 | ||
265 | //printf ( "Opened config file: %s\n", ( configFilePath + "/themes/" + configFileName + ".themerc" ). ascii()); | ||
266 | |||
267 | // Are we initalized? | 267 | // Are we initalized? |
268 | applyMiscResourceGroup( &config ); | 268 | applyMiscResourceGroup( &config ); |
269 | for ( i = 0; i < INHERIT_ITEMS; ++i ) { | 269 | for ( i = 0; i < INHERIT_ITEMS; ++i ) { |
270 | applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); | 270 | applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); |
271 | // printf ( "%d [%s]: copy=%s, pix=%s, brd=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1() ); | ||
272 | } | 271 | } |
273 | for ( ; i < INHERIT_ITEMS*2; ++i ) { | 272 | for ( ; i < INHERIT_ITEMS*2; ++i ) { |
274 | if ( config.hasGroup( QString( widgetEntries[ i ] ) ) ) { | 273 | if ( config.hasGroup( QString( widgetEntries[ i ] ) ) ) { |
275 | applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); | 274 | applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); |
276 | // printf ( "%d [%s]: copy=%s, pix=%s, brd=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1() ); | ||
277 | } | 275 | } |
278 | else { | 276 | else { |
279 | copyfrom [ i ] = widgetEntries[ i - INHERIT_ITEMS ]; | 277 | copyfrom [ i ] = widgetEntries[ i - INHERIT_ITEMS ]; |
280 | // printf ( "%d [%s]: copy=%s\n", i, widgetEntries [i], copyfrom [i].latin1()); | ||
281 | } | 278 | } |
282 | } | 279 | } |
283 | for ( ; i < WIDGETS; ++i ) { | 280 | for ( ; i < WIDGETS; ++i ) { |
284 | applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); | 281 | applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); |
285 | // printf ( "%d [%s]: copy=%s, pix=%s, brd=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1() ); | ||
286 | } | 282 | } |
287 | 283 | ||
288 | // initalize defaults that may not be read | 284 | // initalize defaults that may not be read |
289 | for ( i = 0; i < WIDGETS; ++i ) | 285 | for ( i = 0; i < WIDGETS; ++i ) |
290 | loaded[ i ] = false; | 286 | loaded[ i ] = false; |
291 | btnXShift = btnYShift = focus3DOffset = 0; | 287 | btnXShift = btnYShift = focus3DOffset = 0; |
292 | aTabLine = iTabLine = true; | 288 | aTabLine = iTabLine = true; |
293 | roundedButton = roundedCombo = roundedSlider = focus3D = false; | 289 | roundedButton = roundedCombo = roundedSlider = focus3D = false; |
294 | splitterWidth = 10; | 290 | splitterWidth = 10; |
295 | 291 | ||
296 | for ( i = 0; i < WIDGETS; ++i ) { | 292 | for ( i = 0; i < WIDGETS; ++i ) { |
297 | readResourceGroup( i, copyfrom, pixnames, brdnames, loaded ); | 293 | readResourceGroup( i, copyfrom, pixnames, brdnames, loaded ); |
298 | // printf ( "%d [%s]: copy=%s, pix=%s, brd=%s, colors=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1(), (colors[i]?colors[i]->background().name().latin1():"<none)" )); | ||
299 | } | 294 | } |
300 | 295 | ||
301 | // misc items | 296 | // misc items |
302 | readMiscResourceGroup(); | 297 | readMiscResourceGroup(); |
303 | 298 | ||
304 | // Handle preblend items | 299 | // Handle preblend items |
305 | for ( i = 0; i < PREBLEND_ITEMS; ++i ) { | 300 | for ( i = 0; i < PREBLEND_ITEMS; ++i ) { |
306 | if ( pixmaps[ preBlend[ i ] ] != NULL && blends[ preBlend[ i ] ] != 0.0 ) | 301 | if ( pixmaps[ preBlend[ i ] ] != NULL && blends[ preBlend[ i ] ] != 0.0 ) |
307 | blend( preBlend[ i ] ); | 302 | blend( preBlend[ i ] ); |
308 | } | 303 | } |
309 | } | 304 | } |
310 | 305 | ||
@@ -398,25 +393,25 @@ OThemePixmap* OThemeBase::loadPixmap( QString &name ) | |||
398 | OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget ) | 393 | OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget ) |
399 | { | 394 | { |
400 | if ( scaleHints[ widget ] == FullScale ) { | 395 | if ( scaleHints[ widget ] == FullScale ) { |
401 | if ( !pixmaps[ widget ] || pixmaps[ widget ] ->width() != w || | 396 | if ( !pixmaps[ widget ] || pixmaps[ widget ] ->width() != w || |
402 | pixmaps[ widget ] ->height() != h ) { | 397 | pixmaps[ widget ] ->height() != h ) { |
403 | OThemePixmap * cachePix = cache->pixmap( w, h, widget ); | 398 | OThemePixmap * cachePix = cache->pixmap( w, h, widget ); |
404 | if ( cachePix ) { | 399 | if ( cachePix ) { |
405 | cachePix = new OThemePixmap( *cachePix ); | 400 | cachePix = new OThemePixmap( *cachePix ); |
406 | if ( pixmaps[ widget ] ) | 401 | if ( pixmaps[ widget ] ) |
407 | cache->insert( pixmaps[ widget ], OThemeCache::FullScale, | 402 | cache->insert( pixmaps[ widget ], OThemeCache::FullScale, |
408 | widget ); | 403 | widget ); |
409 | else | 404 | else |
410 | qDebug( "We would have inserted a null pixmap!\n" ); | 405 | odebug << "We would have inserted a null pixmap!\n" << oendl; |
411 | pixmaps[ widget ] = cachePix; | 406 | pixmaps[ widget ] = cachePix; |
412 | } | 407 | } |
413 | else { | 408 | else { |
414 | cache->insert( pixmaps[ widget ], OThemeCache::FullScale, widget ); | 409 | cache->insert( pixmaps[ widget ], OThemeCache::FullScale, widget ); |
415 | QImage tmpImg = images[ widget ] ->smoothScale( w, h ); | 410 | QImage tmpImg = images[ widget ] ->smoothScale( w, h ); |
416 | pixmaps[ widget ] = new OThemePixmap; | 411 | pixmaps[ widget ] = new OThemePixmap; |
417 | pixmaps[ widget ] ->convertFromImage( tmpImg ); | 412 | pixmaps[ widget ] ->convertFromImage( tmpImg ); |
418 | if ( blends[ widget ] != 0.0 ) | 413 | if ( blends[ widget ] != 0.0 ) |
419 | blend( widget ); | 414 | blend( widget ); |
420 | } | 415 | } |
421 | } | 416 | } |
422 | } | 417 | } |