summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Boles <dboles.src@gmail.com>2018-07-09 17:28:49 +0000
committerDaniel Boles <dboles.src@gmail.com>2018-07-09 17:28:49 +0000
commit7030e08f9c7b5670b43efd9f17ebfc8228e15bf3 (patch)
treeda5583f05a948c330947a4a58ea6571da4421211
parent2cc6a3ee5cf7fe710f612f9e7e42803fed31164b (diff)
parentbada3dbac60598d7a01d4408d406dc00be8d248d (diff)
downloadgtk+-7030e08f9c7b5670b43efd9f17ebfc8228e15bf3.tar.gz
Merge branch 'master' into 'master'
HighContrast: Restore expander size Closes #1046 See merge request GNOME/gtk!167
-rw-r--r--gtk/gtktreeview.c25
-rw-r--r--gtk/theme/Adwaita/_common.scss3
-rw-r--r--gtk/theme/Adwaita/gtk-contained-dark.css2
-rw-r--r--gtk/theme/Adwaita/gtk-contained.css2
-rw-r--r--gtk/theme/HighContrast/_common.scss7
-rw-r--r--gtk/theme/HighContrast/gtk-contained-inverse.css4
-rw-r--r--gtk/theme/HighContrast/gtk-contained.css4
7 files changed, 35 insertions, 12 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index c437ac75e4..785332448a 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -262,9 +262,7 @@ typedef enum {
#define TREE_WINDOW_Y_TO_RBTREE_Y(tree_view,y) ((y) + tree_view->priv->dy)
#define RBTREE_Y_TO_TREE_WINDOW_Y(tree_view,y) ((y) - tree_view->priv->dy)
-/* Size of the expander arrow */
-#define _TREE_VIEW_EXPANDER_SIZE 16
-/* Vertical separator width. Must be an eben number. */
+/* Vertical separator width. Must be an even number. */
#define _TREE_VIEW_VERTICAL_SEPARATOR 2
/* Horizontal separator width. Must be an even number. */
#define _TREE_VIEW_HORIZONTAL_SEPARATOR 4
@@ -2714,7 +2712,26 @@ row_is_separator (GtkTreeView *tree_view,
static int
gtk_tree_view_get_expander_size (GtkTreeView *tree_view)
{
- return _TREE_VIEW_EXPANDER_SIZE + (_TREE_VIEW_HORIZONTAL_SEPARATOR / 2);
+ GtkStyleContext *context;
+ GtkCssStyle *style;
+ int min_width;
+ int min_height;
+ int expander_size;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
+ gtk_style_context_save (context);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
+
+ style = gtk_style_context_lookup_style (context);
+ min_width = _gtk_css_number_value_get
+ (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_MIN_WIDTH), 100);
+ min_height = _gtk_css_number_value_get
+ (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_MIN_HEIGHT), 100);
+
+ gtk_style_context_restore (context);
+
+ expander_size = MAX (min_width, min_height);
+ return expander_size + (_TREE_VIEW_HORIZONTAL_SEPARATOR / 2);
}
static void
diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss
index f9c6cec55b..bc0cf94196 100644
--- a/gtk/theme/Adwaita/_common.scss
+++ b/gtk/theme/Adwaita/_common.scss
@@ -1783,6 +1783,9 @@ treeview.view {
}
&.expander {
+ // GtkTreeView uses the larger of the expander’s min-width and min-height
+ min-width: 16px;
+ min-height: 16px;
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css
index 281d317c0c..b490fdb614 100644
--- a/gtk/theme/Adwaita/gtk-contained-dark.css
+++ b/gtk/theme/Adwaita/gtk-contained-dark.css
@@ -726,7 +726,7 @@ treeview.view:drop(active).after { border-top-style: none; }
treeview.view:drop(active).before { border-bottom-style: none; }
-treeview.view.expander { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); color: #bdbebf; }
+treeview.view.expander { min-width: 16px; min-height: 16px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); color: #bdbebf; }
treeview.view.expander:dir(rtl) { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic-rtl"); }
diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css
index f562db8947..66e888bd56 100644
--- a/gtk/theme/Adwaita/gtk-contained.css
+++ b/gtk/theme/Adwaita/gtk-contained.css
@@ -734,7 +734,7 @@ treeview.view:drop(active).after { border-top-style: none; }
treeview.view:drop(active).before { border-bottom-style: none; }
-treeview.view.expander { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); color: #4d4d4d; }
+treeview.view.expander { min-width: 16px; min-height: 16px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); color: #4d4d4d; }
treeview.view.expander:dir(rtl) { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic-rtl"); }
diff --git a/gtk/theme/HighContrast/_common.scss b/gtk/theme/HighContrast/_common.scss
index dba4775e5d..a20e685eaf 100644
--- a/gtk/theme/HighContrast/_common.scss
+++ b/gtk/theme/HighContrast/_common.scss
@@ -1367,6 +1367,9 @@ treeview.view {
}
&.expander {
+ // GtkTreeView uses the larger of the expander’s min-width and min-height
+ min-width: 24px;
+ min-height: 24px;
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
color: mix($fg_color, $base_color, 70%);
@@ -2791,8 +2794,8 @@ row.activatable {
expander {
title > arrow {
- min-width: 16px;
- min-height: 16px;
+ min-width: 24px;
+ min-height: 24px;
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
diff --git a/gtk/theme/HighContrast/gtk-contained-inverse.css b/gtk/theme/HighContrast/gtk-contained-inverse.css
index 8d5e0ee435..22c62e44ee 100644
--- a/gtk/theme/HighContrast/gtk-contained-inverse.css
+++ b/gtk/theme/HighContrast/gtk-contained-inverse.css
@@ -572,7 +572,7 @@ treeview.view:backdrop { color: #fff; border-left-color: gray; border-top: #000;
treeview.view.dnd { border-style: solid none; border-width: 1px; border-color: #eeeeee; }
-treeview.view.expander { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); color: #b8b8b8; }
+treeview.view.expander { min-width: 24px; min-height: 24px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); color: #b8b8b8; }
treeview.view.expander:dir(rtl) { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic-rtl"); }
@@ -1246,7 +1246,7 @@ row:hover, row.activatable:hover { transition: none; }
.app-notification border, .app-notification.frame border { border-width: 0; }
/************* Expanders * */
-expander title > arrow { min-width: 16px; min-height: 16px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
+expander title > arrow { min-width: 24px; min-height: 24px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
expander title > arrow:dir(rtl) { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic-rtl"); }
diff --git a/gtk/theme/HighContrast/gtk-contained.css b/gtk/theme/HighContrast/gtk-contained.css
index 498c11487d..343d9c2179 100644
--- a/gtk/theme/HighContrast/gtk-contained.css
+++ b/gtk/theme/HighContrast/gtk-contained.css
@@ -576,7 +576,7 @@ treeview.view:backdrop { color: #000; border-left-color: gray; border-top: #fff;
treeview.view.dnd { border-style: solid none; border-width: 1px; border-color: black; }
-treeview.view.expander { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); color: #4d4d4d; }
+treeview.view.expander { min-width: 24px; min-height: 24px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); color: #4d4d4d; }
treeview.view.expander:dir(rtl) { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic-rtl"); }
@@ -1252,7 +1252,7 @@ row:hover, row.activatable:hover { transition: none; }
.app-notification border, .app-notification.frame border { border-width: 0; }
/************* Expanders * */
-expander title > arrow { min-width: 16px; min-height: 16px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
+expander title > arrow { min-width: 24px; min-height: 24px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
expander title > arrow:dir(rtl) { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic-rtl"); }