summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2013-03-01 14:14:44 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2013-03-01 14:14:44 (GMT)
commite398035b1634ff55247a366e862c15965e7945bc (patch)
treea805c08065ddb91706e33883143d97958d5a58f4 /src/gtkext
parent80a2bc2ab0f8f831a45bba4bbbbad4b15cbf0645 (diff)
Hidden the welcome panel when binaries get loaded.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@343 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext')
-rw-r--r--src/gtkext/gtkdockstation.c25
-rw-r--r--src/gtkext/gtkdockstation.h3
2 files changed, 27 insertions, 1 deletions
diff --git a/src/gtkext/gtkdockstation.c b/src/gtkext/gtkdockstation.c
index 68c8e1d..e087377 100644
--- a/src/gtkext/gtkdockstation.c
+++ b/src/gtkext/gtkdockstation.c
@@ -64,6 +64,22 @@ G_DEFINE_TYPE(GtkDockStation, gtk_dock_station, GTK_TYPE_VBOX)
static void gtk_dock_station_class_init(GtkDockStationClass *class)
{
+ g_signal_new("dock-widget",
+ GTK_TYPE_DOCK_STATION,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(GtkDockStationClass, dock_widget),
+ NULL, NULL,
+ g_cclosure_user_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1, GTK_TYPE_WIDGET);
+
+ g_signal_new("undock-widget",
+ GTK_TYPE_DOCK_STATION,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(GtkDockStationClass, undock_widget),
+ NULL, NULL,
+ g_cclosure_user_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1, GTK_TYPE_WIDGET);
+
g_signal_new("switch-widget",
GTK_TYPE_DOCK_STATION,
G_SIGNAL_RUN_LAST,
@@ -238,6 +254,8 @@ void gtk_dock_panel_add_widget(GtkDockStation *station, GtkWidget *widget, const
gtk_notebook_set_current_page(station->notebook, -1);
+ g_signal_emit_by_name(station, "dock-widget", widget);
+
}
@@ -303,12 +321,17 @@ void gtk_dock_panel_change_active_widget(GtkDockStation *station, GtkWidget *wid
void gtk_dock_panel_remove_widget(GtkDockStation *station, GtkWidget *widget)
{
gint index; /* Indice de l'onglet visé */
+ gint count; /* Nombre d'onglets en place */
index = gtk_notebook_page_num(station->notebook, widget);
gtk_notebook_remove_page(station->notebook, index);
- if (gtk_notebook_get_n_pages(station->notebook) == 0)
+ count = gtk_notebook_get_n_pages(station->notebook);
+
+ gtk_notebook_set_show_tabs(station->notebook, count > 1);
+
+ if (count == 0)
gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(GTK_WIDGET(station))),
GTK_WIDGET(station));
diff --git a/src/gtkext/gtkdockstation.h b/src/gtkext/gtkdockstation.h
index c285dc7..192fdf2 100644
--- a/src/gtkext/gtkdockstation.h
+++ b/src/gtkext/gtkdockstation.h
@@ -61,6 +61,9 @@ struct _GtkDockStationClass
/* Signaux */
+ void (* dock_widget) (GtkDockStation *, GtkWidget *);
+ void (* undock_widget) (GtkDockStation *, GtkWidget *);
+
void (* switch_widget) (GtkDockStation *, GtkWidget *);
};