[gtk+/wip/otte/gadget: 12/22] notebook: Refactor internal function
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/gadget: 12/22] notebook: Refactor internal function
- Date: Sun, 11 Oct 2015 19:34:06 +0000 (UTC)
commit 2996b3b515493f4ee17d45a58a09ae3846f560a2
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 7 12:11:09 2015 +0200
notebook: Refactor internal function
Don't return the state anymore as the function doesn't even look at the
state. Instead, make the callers that need the state query it manually.
gtk/gtknotebook.c | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 3c1f015..02e6846 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1967,21 +1967,15 @@ add_tab_position_style_class (GtkStyleContext *context,
}
}
-static GtkStateFlags
+static void
notebook_save_context_for_tab (GtkNotebook *notebook,
GtkNotebookPage *page,
GtkStyleContext *context)
{
- GtkStateFlags state;
-
if (page)
gtk_style_context_save_to_node (context, page->cssnode);
else
gtk_style_context_save (context);
-
- state = gtk_style_context_get_state (context);
-
- return state;
}
static void
@@ -2030,7 +2024,6 @@ gtk_notebook_get_preferred_tabs_size (GtkNotebook *notebook,
if (gtk_widget_get_visible (page->child))
{
GtkBorder tab_padding;
- GtkStateFlags state;
vis_pages++;
@@ -2041,8 +2034,8 @@ gtk_notebook_get_preferred_tabs_size (GtkNotebook *notebook,
&child_requisition, NULL);
/* Get border/padding for tab */
- state = notebook_save_context_for_tab (notebook, page, context);
- gtk_style_context_get_padding (context, state, &tab_padding);
+ notebook_save_context_for_tab (notebook, page, context);
+ gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &tab_padding);
gtk_style_context_restore (context);
page->requisition.width = child_requisition.width +
@@ -6402,7 +6395,6 @@ gtk_notebook_page_allocate (GtkNotebook *notebook,
gboolean tab_allocation_changed;
gboolean was_visible = page->tab_allocated_visible;
GtkBorder tab_padding;
- GtkStateFlags state;
if (!page->tab_label ||
!gtk_widget_get_visible (page->tab_label) ||
@@ -6414,9 +6406,9 @@ gtk_notebook_page_allocate (GtkNotebook *notebook,
context = gtk_widget_get_style_context (widget);
- state = notebook_save_context_for_tab (notebook, page, context);
+ notebook_save_context_for_tab (notebook, page, context);
- gtk_style_context_get_padding (context, state, &tab_padding);
+ gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &tab_padding);
gtk_widget_get_preferred_size (page->tab_label, &tab_requisition, NULL);
gtk_widget_style_get (widget,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]