On Friday 07 February 2003 18:34, Norberto Bensa wrote:
> Errrrrr... The patch breaks my own personal (attached) skin :'-(
>
> Oh BTW, my skin (based on icq-ncb) doesn't have the 'group-button' problem,
> and another glitches I found in icq-ncb, everything caused by the same bug.
> But I though the real problem was a bug in the skin, not in the qt-gui
> code.

After re-reading the SKINS.HOWTO i found that Norberto is right. I fixed an 
error in skin.cpp that was no error. instead the icq-ncb skin is broken.

attached you'll find a new re-designed patch, it also fixes the problem in 
icq-ncb (which is by default shipped with licq).

hope i have more luck this time :)

Norberto: Could you please verify that this one now works for you?

bye,
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 20:44:43 -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 20:44:43 -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 20:44:43 -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,7 +406,6 @@ void SkinBrowserPreviewArea::paintEvent(
 	p.end();
 }
 
-
 /*	\brief Renders the dynamic skin preview
  *
  *	This method renders a skin preview in realtime. This is accomplished 
@@ -482,8 +487,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 +509,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)
 	{
@@ -520,6 +526,13 @@ QPixmap SkinBrowserDlg::renderSkin(const
 	lblStatus->setText("Online");
 	lblStatus->setPrependPixmap(CMainWindow::iconForStatus(ICQ_STATUS_ONLINE));
 
+	// 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");
+	
 	// Userview
 	CUserView userView(NULL, &w);
 	userView.setGeometry(skin->frame.border.left, skin->frame.border.top,
@@ -535,20 +548,16 @@ QPixmap SkinBrowserDlg::renderSkin(const
 	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;
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 20:44:43 -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: msg02029/pgp00000.pgp
Description: signature

Reply via email to