Hello, the new skinbrowser in licq has some problems, it renders some preview images very bad for some skins. partly this is due to the skinbrowser code, partly due to the skin class and partly due to the skins itself. most issues get fixed by the attached patch.
1. icq-ncb's preview image looks weird, only one big groups-button is seen in the thumbnail. well, the cause is the skin class, which makes the button consuming the whole space of the licq window. you normally do not notice this fact in the real licq window, because the other widgets get painted over the big button and thus it seems to be hidden, but it exists und the other widgets. when using the icq-ncb skin you are able to push the button, even if you do not see it, simply move the mouse to the most bottom pixel in your licq window and click there. the groups list will pop up. -> attached patch fixes this by interpreting a width of "0" correctly 2. the patch removes a unused method from the skin class. at least it's been a unnecessary code duplication. 3. i changed the order of creating some widgets in the skinbrowser to be in sync with the order used in mainwin. normally the order should not matter, but some skins by mistake rely on a special creation order of the widgets to hide widgets behind others (icq2000 hides the groups combo box behind the userview this way *damn*) 4. and while beeing at it i added a "what's this" help button and some corresponding entries. Hope it's ok and useful :) 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 5 Feb 2003 00:17:02 -0000 @@ -378,50 +378,16 @@ QRect CSkin::borderToRect(CShapeSkin *s, rect.setY(w->height() + r->y1); // X2 - if (r->x2 > 0) + 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) + if (r->y2 >= 0) rect.setHeight(r->y2 - rect.y() + 1); else rect.setHeight((w->height() + r->y2) - rect.y() + 1); 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 5 Feb 2003 00:17:02 -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 5 Feb 2003 00:17:03 -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;
msg02006/pgp00000.pgp
Description: signature