diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-11-25 11:21:21 -0800 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-11-25 11:21:21 -0800 |
commit | a78b18c565526b1c792ccb185ff2c385f517595e (patch) | |
tree | 3d1242d2a72b0a55e63e75c6b64e40511387fa44 | |
parent | eba317228fd36c67513e2a46f5d1b57328db7033 (diff) | |
download | gtk+-a78b18c565526b1c792ccb185ff2c385f517595e.tar.gz |
Revert part of "gtknotebook: Optimize GtkStyleContext usage"
This reverts part of commit c71e2131345c929753a0128c780d679ce0c4ce6a.
This part was unfinished and was pushed simply to avoid the warnings.
-rw-r--r-- | gtk/gtknotebook.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 916ef585cd..2635d1c9ec 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -6249,7 +6249,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook, if (page != priv->cur_page) { - GtkBorder padding = {}; + GtkBorder active_padding, normal_padding, padding; /* The active tab is by definition at least the same height as the inactive one. * The padding we're building is the offset between the two tab states, @@ -6261,11 +6261,16 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook *notebook, gtk_style_context_save (context); notebook_tab_prepare_style_context (notebook, page, context, TRUE); - /* gtk_style_context_get_padding (context, GTK_STATE_FLAG_ACTIVE, &active_padding); */ - /* gtk_style_context_get_padding (context, GTK_STATE_FLAG_NORMAL, &normal_padding); */ + gtk_style_context_get_padding (context, GTK_STATE_FLAG_ACTIVE, &active_padding); + gtk_style_context_get_padding (context, GTK_STATE_FLAG_NORMAL, &normal_padding); gtk_style_context_restore (context); + padding.top = MAX (0, active_padding.top - normal_padding.top); + padding.right = MAX (0, active_padding.right - normal_padding.right); + padding.bottom = MAX (0, active_padding.bottom - normal_padding.bottom); + padding.left = MAX (0, active_padding.left - normal_padding.left); + switch (tab_pos) { case GTK_POS_TOP: |