summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qgtkstyle.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-03-05 13:42:11 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-03-05 13:42:11 +0100
commit5e8ae03578ecd0538a774505f2f7e2fc626b0ab7 (patch)
tree3b6f704df4d55d0ed2a5a706acf785541a74a45e /src/widgets/styles/qgtkstyle.cpp
parent7a5fea113ec6088135b0b6a0fc4297e0ef362bc5 (diff)
parentbe3fb9afe50361e4b35d02d28ef30851335b17b6 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: configure qmake/generators/mac/pbuilder_pbx.cpp src/corelib/kernel/qtimerinfo_unix.cpp src/plugins/platforms/cocoa/qcocoabackingstore.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/xcb/qglxintegration.cpp Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
Diffstat (limited to 'src/widgets/styles/qgtkstyle.cpp')
-rw-r--r--src/widgets/styles/qgtkstyle.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp
index 6d2c88bfea..9ebab8d52d 100644
--- a/src/widgets/styles/qgtkstyle.cpp
+++ b/src/widgets/styles/qgtkstyle.cpp
@@ -1881,8 +1881,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
GtkShadowType shadow = (option->state & State_Sunken || option->state & State_On ) ?
GTK_SHADOW_IN : GTK_SHADOW_OUT;
- const QHashableLatin1Literal comboBoxPath = comboBox->editable && QGtkStylePrivate::gtk_combo_box_entry_new ?
- QHashableLatin1Literal("GtkComboBoxEntry") : QHashableLatin1Literal("GtkComboBox");
+ const QHashableLatin1Literal comboBoxPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry") : QHashableLatin1Literal("GtkComboBox");
// We use the gtk widget to position arrows and separators for us
GtkWidget *gtkCombo = d->gtkWidget(comboBoxPath);
@@ -1890,8 +1889,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
d->gtk_widget_set_direction(gtkCombo, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
d->gtk_widget_size_allocate(gtkCombo, &geometry);
- QHashableLatin1Literal buttonPath = comboBox->editable && QGtkStylePrivate::gtk_combo_box_entry_new ?
- QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton") : QHashableLatin1Literal("GtkComboBox.GtkToggleButton");
+ QHashableLatin1Literal buttonPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton")
+ : QHashableLatin1Literal("GtkComboBox.GtkToggleButton");
GtkWidget *gtkToggleButton = d->gtkWidget(buttonPath);
d->gtk_widget_set_direction(gtkToggleButton, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
if (gtkToggleButton && (appears_as_list || comboBox->editable)) {
@@ -1900,8 +1899,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
// Draw the combo box as a line edit with a button next to it
if (comboBox->editable || appears_as_list) {
GtkStateType frameState = (state == GTK_STATE_PRELIGHT) ? GTK_STATE_NORMAL : state;
- QHashableLatin1Literal entryPath = comboBox->editable && QGtkStylePrivate::gtk_combo_box_entry_new ? QHashableLatin1Literal("GtkComboBoxEntry.GtkEntry")
- : comboBox->editable ? QHashableLatin1Literal("GtkComboBox.GtkEntry") : QHashableLatin1Literal("GtkComboBox.GtkFrame");
+ QHashableLatin1Literal entryPath = comboBox->editable ? QHashableLatin1Literal("GtkComboBoxEntry.GtkEntry") : QHashableLatin1Literal("GtkComboBox.GtkFrame");
GtkWidget *gtkEntry = d->gtkWidget(entryPath);
d->gtk_widget_set_direction(gtkEntry, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
QRect frameRect = option->rect;
@@ -1969,7 +1967,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
// Draw the separator between label and arrows
- QHashableLatin1Literal vSeparatorPath = comboBox->editable && QGtkStylePrivate::gtk_combo_box_entry_new
+ QHashableLatin1Literal vSeparatorPath = comboBox->editable
? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkHBox.GtkVSeparator")
: QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkHBox.GtkVSeparator");
@@ -2006,7 +2004,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
state = GTK_STATE_NORMAL;
QHashableLatin1Literal arrowPath("");
- if (comboBox->editable && QGtkStylePrivate::gtk_combo_box_entry_new) {
+ if (comboBox->editable) {
if (appears_as_list)
arrowPath = QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkArrow");
else
@@ -2044,7 +2042,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
if (sunken) {
int xoff, yoff;
- const QHashableLatin1Literal toggleButtonPath = comboBox->editable && QGtkStylePrivate::gtk_combo_box_entry_new
+ const QHashableLatin1Literal toggleButtonPath = comboBox->editable
? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton")
: QHashableLatin1Literal("GtkComboBox.GtkToggleButton");
@@ -3812,15 +3810,19 @@ QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComple
case CC_ComboBox:
if (const QStyleOptionComboBox *box = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
// We employ the gtk widget to position arrows and separators for us
- GtkWidget *gtkCombo = box->editable && QGtkStylePrivate::gtk_combo_box_entry_new ?
- d->gtkWidget("GtkComboBoxEntry") : d->gtkWidget("GtkComboBox");
+ GtkWidget *gtkCombo = box->editable ? d->gtkWidget("GtkComboBoxEntry")
+ : d->gtkWidget("GtkComboBox");
d->gtk_widget_set_direction(gtkCombo, (option->direction == Qt::RightToLeft) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
GtkAllocation geometry = {0, 0, qMax(0, option->rect.width()), qMax(0, option->rect.height())};
d->gtk_widget_size_allocate(gtkCombo, &geometry);
int appears_as_list = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, option, widget);
- QHashableLatin1Literal arrowPath = box->editable && QGtkStylePrivate::gtk_combo_box_entry_new ?
- QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton") : box->editable || appears_as_list ?
- QHashableLatin1Literal("GtkComboBox.GtkToggleButton") : QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow");
+ QHashableLatin1Literal arrowPath("GtkComboBoxEntry.GtkToggleButton");
+ if (!box->editable) {
+ if (appears_as_list)
+ arrowPath = "GtkComboBox.GtkToggleButton";
+ else
+ arrowPath = "GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow";
+ }
GtkWidget *arrowWidget = d->gtkWidget(arrowPath);
if (!arrowWidget)