summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qgtkstyle_p.cpp24
-rw-r--r--src/gui/styles/qgtkstyle_p.h1
-rw-r--r--src/gui/styles/qplastiquestyle.cpp5
-rw-r--r--src/gui/styles/qs60style.cpp2
-rw-r--r--src/gui/styles/qstylehelper_p.h2
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp4
-rw-r--r--src/gui/styles/qwindowsxpstyle.cpp2
7 files changed, 21 insertions, 19 deletions
diff --git a/src/gui/styles/qgtkstyle_p.cpp b/src/gui/styles/qgtkstyle_p.cpp
index 4ed0fab..fdbe1f8 100644
--- a/src/gui/styles/qgtkstyle_p.cpp
+++ b/src/gui/styles/qgtkstyle_p.cpp
@@ -524,7 +524,9 @@ void QGtkStylePrivate::initGtkWidgets() const
QGtkStylePrivate::gtk_widget_realize(gtkWindow);
if (displayDepth == -1)
displayDepth = QGtkStylePrivate::gdk_drawable_get_depth(gtkWindow->window);
- gtkWidgetMap()->insert(QHashableLatin1Literal::fromData(strdup("GtkWindow")), gtkWindow);
+ QHashableLatin1Literal widgetPath = QHashableLatin1Literal::fromData(strdup("GtkWindow"));
+ removeWidgetFromMap(widgetPath);
+ gtkWidgetMap()->insert(widgetPath, gtkWindow);
// Make all other widgets. respect the text direction
@@ -576,6 +578,7 @@ void QGtkStylePrivate::initGtkWidgets() const
if (!strchr(it.key().data(), '.')) {
addAllSubWidgets(it.value());
}
+ free(const_cast<char *>(it.key().data()));
}
}
} else {
@@ -743,19 +746,24 @@ void QGtkStylePrivate::setupGtkWidget(GtkWidget* widget)
}
}
+void QGtkStylePrivate::removeWidgetFromMap(const QHashableLatin1Literal &path)
+{
+ WidgetMap *map = gtkWidgetMap();
+ WidgetMap::iterator it = map->find(path);
+ if (it != map->end()) {
+ free(const_cast<char *>(it.key().data()));
+ map->erase(it);
+ }
+}
+
void QGtkStylePrivate::addWidgetToMap(GtkWidget *widget)
{
if (Q_GTK_IS_WIDGET(widget)) {
gtk_widget_realize(widget);
QHashableLatin1Literal widgetPath = classPath(widget);
- WidgetMap *map = gtkWidgetMap();
- WidgetMap::iterator it = map->find(widgetPath);
- if (it != map->end()) {
- free(const_cast<char *>(it.key().data()));
- map->erase(it);
- }
- map->insert(widgetPath, widget);
+ removeWidgetFromMap(widgetPath);
+ gtkWidgetMap()->insert(widgetPath, widget);
#ifdef DUMP_GTK_WIDGET_TREE
qWarning("Inserted Gtk Widget: %s", widgetPath.data());
#endif
diff --git a/src/gui/styles/qgtkstyle_p.h b/src/gui/styles/qgtkstyle_p.h
index 68a04e9..4e1d07a 100644
--- a/src/gui/styles/qgtkstyle_p.h
+++ b/src/gui/styles/qgtkstyle_p.h
@@ -502,6 +502,7 @@ protected:
static void addWidgetToMap(GtkWidget* widget);
static void addAllSubWidgets(GtkWidget *widget, gpointer v = 0);
static void addWidget(GtkWidget *widget);
+ static void removeWidgetFromMap(const QHashableLatin1Literal &path);
virtual void init();
diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp
index 4690a71..8772294 100644
--- a/src/gui/styles/qplastiquestyle.cpp
+++ b/src/gui/styles/qplastiquestyle.cpp
@@ -1362,11 +1362,8 @@ void QPlastiqueStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
if (const QStyleOptionFrame *lineEdit = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
// Panel of a line edit inside combo box or spin box is drawn in CC_ComboBox and CC_SpinBox
if (widget) {
-#ifndef QT_NO_COMBOBOX
- if (qobject_cast<const QComboBox *>(widget->parentWidget()))
- break;
-#endif
#ifndef QT_NO_SPINBOX
+ // Spinbox doesn't need a separate palette for the lineedit
if (qobject_cast<const QAbstractSpinBox *>(widget->parentWidget()))
break;
#endif
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 3ec6e10..cf7e963 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2001,7 +2001,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
case CE_ShapedFrame:
if (const QTextEdit *textEdit = qobject_cast<const QTextEdit *>(widget)) {
const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(option);
- if (QS60StylePrivate::canDrawThemeBackground(frame->palette.base(), widget))
+ if (frame && QS60StylePrivate::canDrawThemeBackground(frame->palette.base(), widget))
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags);
else
QCommonStyle::drawControl(element, option, painter, widget);
diff --git a/src/gui/styles/qstylehelper_p.h b/src/gui/styles/qstylehelper_p.h
index 71fce55..3759929 100644
--- a/src/gui/styles/qstylehelper_p.h
+++ b/src/gui/styles/qstylehelper_p.h
@@ -108,7 +108,7 @@ template <typename T>
{
typedef HexString<T> type;
enum { ExactSize = true };
- static int size(const HexString<T> &str) { return sizeof(str.val) * 2; }
+ static int size(const HexString<T> &) { return sizeof(T) * 2; }
static inline void appendTo(const HexString<T> &str, QChar *&out) { str.write(out); }
};
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index bed5b09..d6d3f10 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -588,10 +588,6 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
if (QAbstractSpinBox *spinbox = qobject_cast<QAbstractSpinBox*>(widget->parentWidget()))
resolve_mask = spinbox->palette().resolve();
#endif // QT_NO_SPINBOX
-#ifndef QT_NO_COMBOBOX
- if (QComboBox *combobox = qobject_cast<QComboBox*>(widget->parentWidget()))
- resolve_mask = combobox->palette().resolve();
-#endif // QT_NO_COMBOBOX
}
if (resolve_mask & (1 << QPalette::Base)) {
// Base color is set for this widget, so use it
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp
index 7ab1218..f185c0d 100644
--- a/src/gui/styles/qwindowsxpstyle.cpp
+++ b/src/gui/styles/qwindowsxpstyle.cpp
@@ -2154,7 +2154,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
p->setPen(menuitem->palette.text().color());
p->setBrush(Qt::NoBrush);
if (checked)
- p->drawRect(vIconRect.adjusted(-1, -2, 1, 1));
+ p->drawRect(vIconRect.adjusted(-1, -1, 0, 0));
p->drawPixmap(vIconRect.topLeft(), pixmap);
// draw checkmark -------------------------------------------------