summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-06-16 10:08:46 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2009-06-16 10:33:22 (GMT)
commit64b1e9b360045b6ed2794d17b4fd07bc2ca8a47e (patch)
treec4b6e041f5ca1ba216db4e8844b606c787adb45c /src
parentfa3d44f7f4dfbf2c6d49af4635231534700d90f4 (diff)
downloadQt-64b1e9b360045b6ed2794d17b4fd07bc2ca8a47e.zip
Qt-64b1e9b360045b6ed2794d17b4fd07bc2ca8a47e.tar.gz
Qt-64b1e9b360045b6ed2794d17b4fd07bc2ca8a47e.tar.bz2
Improved styling of expander arrows with Gtk+
The current implementation was based on the GtkExpander widget. However we do not have such a widget and the primary use case is for expanders inside item views. Hence it makes sense to base it on gtktreeview instead. As I can not reproduce the crash with any recent versions of cleanice I will remove the workaround as well. omment and edit as applicable ]---| Task-number: 256146 Reviewed-by: Thorbjørn
Diffstat (limited to 'src')
-rw-r--r--src/gui/styles/qgtkstyle.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index 0e54af8..84ec4af 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -789,24 +789,21 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
case PE_IndicatorBranch:
if (option->state & State_Children) {
QRect rect = option->rect;
- rect = QRect(0, 0, 10, 10);
+ rect = QRect(0, 0, 12, 12);
rect.moveCenter(option->rect.center());
rect.translate(2, 0);
GtkExpanderStyle openState = GTK_EXPANDER_EXPANDED;
GtkExpanderStyle closedState = GTK_EXPANDER_COLLAPSED;
- GtkWidget *gtkExpander = QGtk::gtkWidget(QLS("GtkExpander"));
- guint expanderSize;
- QGtk::gtk_widget_style_get(gtkExpander, "expander-size", &expanderSize, NULL);
- // Note CleanIce will crash unless a GtkExpander is provided
- // but providing the expander will enforce the expander-size, which we
- // don't neccessarily have room for
+ GtkWidget *gtkTreeView = QGtk::gtkWidget(QLS("GtkTreeView"));
+
GtkStateType state = GTK_STATE_NORMAL;
if (!(option->state & State_Enabled))
state = GTK_STATE_INSENSITIVE;
else if (option->state & State_MouseOver)
state = GTK_STATE_PRELIGHT;
- gtkPainter.paintExpander(expanderSize <= 10 ? gtkExpander : NULL, "expander", rect, state,
- option->state & State_Open ? openState : closedState , gtkExpander->style);
+
+ gtkPainter.paintExpander(gtkTreeView, "treeview", rect, state,
+ option->state & State_Open ? openState : closedState , gtkTreeView->style);
}
break;
case PE_PanelItemViewItem: