[gimp] app: Add gimp_dockable_convert_tab_style()
- From: Martin Nordholts <martinn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: Add gimp_dockable_convert_tab_style()
- Date: Sun, 23 May 2010 08:53:49 +0000 (UTC)
commit 064c3f661aa58c008f355db4a147b4fc3d20f112
Author: Martin Nordholts <martinn src gnome org>
Date: Sat May 22 20:11:43 2010 +0200
app: Add gimp_dockable_convert_tab_style()
app/widgets/gimpdockable.c | 60 +++++++++++++++++++++++++-------------------
1 files changed, 34 insertions(+), 26 deletions(-)
---
diff --git a/app/widgets/gimpdockable.c b/app/widgets/gimpdockable.c
index 6f2af2f..60ad609 100644
--- a/app/widgets/gimpdockable.c
+++ b/app/widgets/gimpdockable.c
@@ -143,6 +143,9 @@ static void gimp_dockable_clear_title_area (GimpDockable *dockable);
static gboolean gimp_dockable_menu_button_press (GtkWidget *button,
GdkEventButton *bevent,
GimpDockable *dockable);
+static GimpTabStyle
+ gimp_dockable_convert_tab_style (GimpDockable *dockable,
+ GimpTabStyle tab_style);
static gboolean gimp_dockable_show_menu (GimpDockable *dockable);
static gboolean gimp_dockable_blink_timeout (GimpDockable *dockable);
@@ -1066,34 +1069,9 @@ void
gimp_dockable_set_tab_style (GimpDockable *dockable,
GimpTabStyle tab_style)
{
- GtkWidget *child;
-
g_return_if_fail (GIMP_IS_DOCKABLE (dockable));
- child = gtk_bin_get_child (GTK_BIN (dockable));
-
- if (child && ! GIMP_DOCKED_GET_INTERFACE (child)->get_preview)
- {
- switch (tab_style)
- {
- case GIMP_TAB_STYLE_PREVIEW:
- tab_style = GIMP_TAB_STYLE_ICON;
- break;
-
- case GIMP_TAB_STYLE_PREVIEW_NAME:
- tab_style = GIMP_TAB_STYLE_ICON_BLURB;
- break;
-
- case GIMP_TAB_STYLE_PREVIEW_BLURB:
- tab_style = GIMP_TAB_STYLE_ICON_BLURB;
- break;
-
- default:
- break;
- }
- }
-
- dockable->p->tab_style = tab_style;
+ dockable->p->tab_style = gimp_dockable_convert_tab_style (dockable, tab_style);
}
GtkWidget *
@@ -1333,6 +1311,36 @@ gimp_dockable_menu_button_press (GtkWidget *button,
return FALSE;
}
+static GimpTabStyle
+gimp_dockable_convert_tab_style (GimpDockable *dockable,
+ GimpTabStyle tab_style)
+{
+ GtkWidget *child = gtk_bin_get_child (GTK_BIN (dockable));
+
+ if (child && ! GIMP_DOCKED_GET_INTERFACE (child)->get_preview)
+ {
+ switch (tab_style)
+ {
+ case GIMP_TAB_STYLE_PREVIEW:
+ tab_style = GIMP_TAB_STYLE_ICON;
+ break;
+
+ case GIMP_TAB_STYLE_PREVIEW_NAME:
+ tab_style = GIMP_TAB_STYLE_ICON_BLURB;
+ break;
+
+ case GIMP_TAB_STYLE_PREVIEW_BLURB:
+ tab_style = GIMP_TAB_STYLE_ICON_BLURB;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return tab_style;
+}
+
static void
gimp_dockable_menu_position (GtkMenu *menu,
gint *x,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]