[gnome-themes-standard] expander: only apply the padding hack for regular treeview expanders
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-themes-standard] expander: only apply the padding hack for regular treeview expanders
- Date: Fri, 12 Aug 2011 13:08:09 +0000 (UTC)
commit 60ed7bb0a89010aa330c2efd3e2395a0c331c26b
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Fri Aug 12 15:05:58 2011 +0200
expander: only apply the padding hack for regular treeview expanders
What we do here is really bad.
src/adwaita_engine.c | 24 +++++++++++++++---------
themes/Adwaita/gtk-3.0/gtk-widgets.css | 4 ++--
2 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/src/adwaita_engine.c b/src/adwaita_engine.c
index 9fc9049..a8d45ea 100644
--- a/src/adwaita_engine.c
+++ b/src/adwaita_engine.c
@@ -494,18 +494,24 @@ adwaita_engine_render_expander (GtkThemingEngine *engine,
gdouble side, offset;
gint line_width;
GtkBorder border;
-
- /* draw the expander as if it was 11px instead of the allocated 17px,
- * so that we can have a bit of padding between the view edge and the
- * expander itself.
- */
- x += 3;
- y += 3;
- width -= 6;
- height -= 6;
+ const GtkWidgetPath *path = gtk_theming_engine_get_path (engine);
side = floor (MIN (width, height));
+ if (gtk_widget_path_is_type (path, GTK_TYPE_TREE_VIEW) &&
+ (side == 17))
+ {
+ /* HACK: draw the expander as if it was 11px instead of the allocated 17px,
+ * so that we can have a bit of padding between the view edge and the
+ * expander itself.
+ */
+ x += 3;
+ y += 3;
+ width -= 6;
+ height -= 6;
+ side -= 6;
+ }
+
x += width / 2 - side / 2;
y += height / 2 - side / 2;
diff --git a/themes/Adwaita/gtk-3.0/gtk-widgets.css b/themes/Adwaita/gtk-3.0/gtk-widgets.css
index 8f86d0f..2aca634 100644
--- a/themes/Adwaita/gtk-3.0/gtk-widgets.css
+++ b/themes/Adwaita/gtk-3.0/gtk-widgets.css
@@ -21,8 +21,8 @@
-GtkScrolledWindow-scrollbar-spacing: 0;
-GtkScrolledWindow-scrollbars-within-bevel: 1;
- -GtkToolItemGroup-expander-size: 17;
- -GtkExpander-expander-size: 17;
+ -GtkToolItemGroup-expander-size: 11;
+ -GtkExpander-expander-size: 11;
-GtkMenu-horizontal-padding: 0;
-GtkMenu-vertical-padding: 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]