Ok,. what did jon said short time ago? "art is hard" hehe

here my last revision to my skinbrowser patch. forget all the ones before, 
this one is the one that i'd like to see in the cvs :)

thomas
Index: plugins/qt-gui/src/skin.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/skin.cpp,v
retrieving revision 1.11
diff -u -3 -p -r1.11 skin.cpp
--- plugins/qt-gui/src/skin.cpp	15 Oct 2002 18:06:55 -0000	1.11
+++ plugins/qt-gui/src/skin.cpp	7 Feb 2003 21:26:30 -0000
@@ -391,37 +391,3 @@ QRect CSkin::borderToRect(CShapeSkin *s,
 
    return (rect);
 }
-
-
-QRect CSkin::borderToRect(CShapeSkin *s, QPixmap *w)
-{
-   struct Rect *r = &s->rect;
-   QRect rect;
-
-   // X1
-   if (r->x1 >= 0)
-      rect.setX(r->x1);
-   else
-      rect.setX(w->width() + r->x1);
-
-   // Y1
-   if (r->y1 >= 0)
-      rect.setY(r->y1);
-   else
-      rect.setY(w->height() + r->y1);
-
-   // X2
-   if (r->x2 > 0)
-      rect.setWidth(r->x2 - rect.x() + 1);
-   else
-      rect.setWidth((w->width() + r->x2) - rect.x() + 1);
-
-   // Y2
-   if (r->y2 > 0)
-      rect.setHeight(r->y2 - rect.y() + 1);
-   else
-      rect.setHeight((w->height() + r->y2) - rect.y() + 1);
-
-   return (rect);
-}
-
Index: plugins/qt-gui/src/skin.h
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/skin.h,v
retrieving revision 1.5
diff -u -3 -p -r1.5 skin.h
--- plugins/qt-gui/src/skin.h	2 Mar 2000 18:00:54 -0000	1.5
+++ plugins/qt-gui/src/skin.h	7 Feb 2003 21:26:30 -0000
@@ -97,7 +97,6 @@ public:
    // Functions
    void AdjustForMenuBar(unsigned short n);
    QRect borderToRect(CShapeSkin *, QWidget *);
-   QRect borderToRect(CShapeSkin *, QPixmap *);
    int frameWidth(void);
    int frameHeight(void);
 
Index: plugins/qt-gui/src/skinbrowser.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/skinbrowser.cpp,v
retrieving revision 1.19
diff -u -3 -p -r1.19 skinbrowser.cpp
--- plugins/qt-gui/src/skinbrowser.cpp	18 Jan 2003 16:25:07 -0000	1.19
+++ plugins/qt-gui/src/skinbrowser.cpp	7 Feb 2003 21:26:31 -0000
@@ -18,12 +18,14 @@
 #include <qdir.h>
 #include <qframe.h>
 #include <qimage.h>
-#include <qpainter.h>
-#include <qpushbutton.h>
 #include <qlabel.h>
 #include <qlayout.h>
+#include <qpainter.h>
+#include <qpushbutton.h>
 #include <qpixmap.h>
+#include <qtoolbutton.h>
 #include <qvaluelist.h>
+#include <qwhatsthis.h>
 
 #include "editfile.h"
 #include "ewidgets.h"
@@ -71,12 +73,15 @@ SkinBrowserDlg::SkinBrowserDlg(CMainWind
 	// Skin and Icons Box
 	QLabel *lblSkin = new QLabel(tr("S&kins:"), boxSkin);
 	cmbSkin = new QComboBox(boxSkin);
+	QWhatsThis::add(cmbSkin, tr("Use this combo box to select one of the available skins"));
 	lblSkin->setBuddy(cmbSkin);
 	QLabel *lblIcon = new QLabel(tr("&Icons:"), boxSkin);
 	cmbIcon = new QComboBox(boxSkin);
+	QWhatsThis::add(cmbIcon, tr("Use this combo box to select one of the available icon sets"));
 	lblIcon->setBuddy(cmbIcon);
 	QLabel *lblExtIcon = new QLabel(tr("E&xtended Icons:"), boxSkin);
 	cmbExtIcon = new QComboBox(boxSkin);
+	QWhatsThis::add(cmbExtIcon, tr("Use this combo box to select one of the available extended icon sets"));
 	lblExtIcon->setBuddy(cmbExtIcon);
 
 	// Preview Box
@@ -117,6 +122,7 @@ SkinBrowserDlg::SkinBrowserDlg(CMainWind
 	btnOk->setDefault(true);
 	QPushButton *btnApply = new QPushButton(tr("&Apply"), frmButtons);
 	QPushButton *btnCancel = new QPushButton(tr("&Cancel"), frmButtons);
+	layButtons->addWidget(QWhatsThis::whatsThisButton(frmButtons), 0, AlignLeft);
 	layButtons->addWidget(btnEdit);
 	layButtons->addStretch();
 	layButtons->addSpacing(15);
@@ -400,11 +406,10 @@ void SkinBrowserPreviewArea::paintEvent(
 	p.end();
 }
 
-
 /*	\brief Renders the dynamic skin preview
  *
- *	This method renders a skin preview in realtime. This is accomplished 
- *	by creating a new Widget and applying the Skin &skinName to it. The 
+ *	This method renders a skin preview in realtime. This is accomplished
+ *	by creating a new Widget and applying the Skin &skinName to it. The
  *	widget is never shown, but instead using grabWidget() it is copied
  *	into a pixmap, which afterwards is returned to the caller.
  */
@@ -416,13 +421,13 @@ QPixmap SkinBrowserDlg::renderSkin(const
 	CSkin *skin = NULL;
 	QMenuBar *menu = NULL;
 	CEComboBox *cmbUserGroups = NULL;
-	
+
 	QWidget w;
 	w.setFixedWidth(188); // this is (75x130) * 2.5
 	w.setFixedHeight(325);
 
 	skin = new CSkin(skinName);
-  
+
 	// Background
 	QPixmap p;
 	if (skin->frame.pixmap != NULL)
@@ -442,6 +447,13 @@ QPixmap SkinBrowserDlg::renderSkin(const
 #endif
 	}
 
+	// Group Combo Box
+	cmbUserGroups = new CEComboBox(false, &w);
+	cmbUserGroups->setNamedBgColor(skin->cmbGroups.color.bg);
+	cmbUserGroups->setNamedFgColor(skin->cmbGroups.color.fg);
+	cmbUserGroups->setGeometry(skin->borderToRect(&skin->cmbGroups, &w));
+	cmbUserGroups->insertItem("All Users");
+
 	// The Menu Button
 	if (!skin->frame.hasMenuBar)
 	{
@@ -451,9 +463,9 @@ QPixmap SkinBrowserDlg::renderSkin(const
 		}
 		else
 		{
-			btnSystem = new CEButton(new QPixmap(skin->btnSys.pixmapUpFocus), 
-															new QPixmap(skin->btnSys.pixmapUpNoFocus), 
-															new QPixmap(skin->btnSys.pixmapDown), 
+			btnSystem = new CEButton(new QPixmap(skin->btnSys.pixmapUpFocus),
+															new QPixmap(skin->btnSys.pixmapUpNoFocus),
+															new QPixmap(skin->btnSys.pixmapDown),
 															&w);
 		}
 		btnSystem->setNamedFgColor(skin->btnSys.color.fg);
@@ -482,8 +494,9 @@ QPixmap SkinBrowserDlg::renderSkin(const
 		lblMsg->setBackgroundPixmap(QPixmap(skin->lblMsg.pixmap));
 	}
 #else
-		lblMsg->setBackgroundOrigin(w.WidgetOrigin);
+		lblMsg->setBackgroundOrigin(w.ParentOrigin);
 		lblMsg->setPaletteBackgroundPixmap(p);
+		lblMsg->setPixmap(QPixmap(skin->lblMsg.pixmap));
 	}
 	else if (skin->lblMsg.transparent && skin->frame.pixmap)
 	{
@@ -503,12 +516,12 @@ QPixmap SkinBrowserDlg::renderSkin(const
 	if (skin->lblStatus.pixmap != NULL)
 	{
 #if QT_VERSION < 300
-//		lblStatus->setBackgroundPixmap(QPixmap(skin->lblStatus.pixmap));
 		lblStatus->setBackgroundPixmap(p);
 	}
 #else
-		lblStatus->setBackgroundOrigin(w.WidgetOrigin);
+		lblStatus->setBackgroundOrigin(w.ParentOrigin);
 		lblStatus->setPaletteBackgroundPixmap(p);
+		lblStatus->setPixmap(QPixmap(skin->lblStatus.pixmap));
 	}
 	else if (skin->lblStatus.transparent && skin->frame.pixmap)
 	{
@@ -531,29 +544,25 @@ QPixmap SkinBrowserDlg::renderSkin(const
 	char * c_newuser    = mainwin->skin->colors.newuser;
 	char * c_background = mainwin->skin->colors.background;
 	char * c_gridlines  = mainwin->skin->colors.gridlines;
-	
+
 	userView.setColors(skin->colors.online, skin->colors.away,
 											skin->colors.offline, skin->colors.newuser,
 											skin->colors.background, skin->colors.gridlines);
+	if (skin->frame.transparent)
+	{
 #if QT_VERSION < 300
 	userView.setBackgroundPixmap(p);
 #else
 	userView.setBackgroundOrigin(w.ParentOrigin);
 	userView.setPaletteBackgroundPixmap(p);
 #endif
+	}
 	userView.show();
 
-	// Group Combo Box
-	cmbUserGroups = new CEComboBox(false, &w);
-	cmbUserGroups->setNamedBgColor(skin->cmbGroups.color.bg);
-	cmbUserGroups->setNamedFgColor(skin->cmbGroups.color.fg);
-	cmbUserGroups->setGeometry(skin->borderToRect(&skin->cmbGroups, &w));
-	cmbUserGroups->insertItem("All Users");
-
 	QPixmap tmp(QPixmap::grabWidget(&w));
 	QPixmap ret;
 	ret.convertFromImage(QImage(tmp.convertToImage().smoothScale(75, 130)));
-	
+
 	// Reset origin colors
 	userView.setColors(c_online, c_away, c_offline, c_newuser, c_background, c_gridlines);
 
Index: plugins/qt-gui/share/qt-gui/skin.icq-ncb/icq-ncb.skin
===================================================================
RCS file: /cvsroot/licq/qt-gui/share/qt-gui/skin.icq-ncb/icq-ncb.skin,v
retrieving revision 1.1
diff -u -3 -p -r1.1 icq-ncb.skin
--- plugins/qt-gui/share/qt-gui/skin.icq-ncb/icq-ncb.skin	29 Jun 2000 01:53:26 -0000	1.1
+++ plugins/qt-gui/share/qt-gui/skin.icq-ncb/icq-ncb.skin	7 Feb 2003 21:26:31 -0000
@@ -48,10 +48,10 @@ lblMsg.color.bg = default
 lblMsg.frameStyle = 51
 lblMsg.pixmap = none
 
-cmbGroups.rect.x1 = 0
-cmbGroups.rect.y1 = 0
-cmbGroups.rect.x2 = 0
-cmbGroups.rect.y2 = 0
+cmbGroups.rect.x1 = -1
+cmbGroups.rect.y1 = -1
+cmbGroups.rect.x2 = -1
+cmbGroups.rect.y2 = -1
 cmbGroups.color.fg = default
 cmbGroups.color.bg = default
 

Attachment: msg02030/pgp00000.pgp
Description: signature

Reply via email to