summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtkext')
-rw-r--r--src/gtkext/gtkdockstation.c19
-rw-r--r--src/gtkext/gtkdockstation.h2
2 files changed, 11 insertions, 10 deletions
diff --git a/src/gtkext/gtkdockstation.c b/src/gtkext/gtkdockstation.c
index a742c07..157b286 100644
--- a/src/gtkext/gtkdockstation.c
+++ b/src/gtkext/gtkdockstation.c
@@ -196,12 +196,12 @@ GtkWidget *gtk_dock_station_new(void)
static gboolean gtk_dock_station_switch_panel(GtkNotebook *notebook, gpointer *page, guint index, gpointer data)
{
GtkWidget *widget; /* Panneau concerné */
- char *caption; /* Texte à redonner */
+ char *str; /* Texte à redonner */
widget = gtk_notebook_get_nth_page(notebook, index);
- caption = g_object_get_data(G_OBJECT(widget), "title");
+ str = g_object_get_data(G_OBJECT(widget), "title");
- gtk_dock_panel_update_title(GTK_DOCK_STATION(data), widget, caption);
+ gtk_dock_panel_update_title(GTK_DOCK_STATION(data), widget, str);
g_signal_emit_by_name(GTK_DOCK_STATION(data), "switch-widget", widget);
@@ -215,6 +215,7 @@ static gboolean gtk_dock_station_switch_panel(GtkNotebook *notebook, gpointer *p
* Paramètres : station = plateforme GTK à compléter. *
* widget = nouvel élément à intégrer. *
* caption = intitulé court à afficher sur les onglets. *
+* desc = intitulé long pour le titre et la description. *
* *
* Description : Ajoute un paquet d'informations à l'affichage centralisé. *
* *
@@ -224,13 +225,13 @@ static gboolean gtk_dock_station_switch_panel(GtkNotebook *notebook, gpointer *p
* *
******************************************************************************/
-void gtk_dock_panel_add_widget(GtkDockStation *station, GtkWidget *widget, const char *caption)
+void gtk_dock_panel_add_widget(GtkDockStation *station, GtkWidget *widget, const char *caption, const char *desc)
{
size_t max; /* Taille maximale des titres */
char *str; /* Titre des prochaines fois */
GtkWidget *label; /* Etiquette d'onglet */
- max = 3; // TODO : config dans un .so pour Python // get_integer_config_value(get_main_configuration(), MPT_ELLIPSIS_TAB);
+ max = 35; // TODO : config dans un .so pour Python // get_integer_config_value(get_main_configuration(), MPT_ELLIPSIS_TAB);
str = ellipsis(strdup(caption), max);
label = qck_create_label(NULL, NULL, str);
@@ -240,7 +241,7 @@ void gtk_dock_panel_add_widget(GtkDockStation *station, GtkWidget *widget, const
G_CALLBACK(gtk_dock_station_switch_panel), station);
gtk_notebook_insert_page(station->notebook, widget, label, -1);
- gtk_widget_set_tooltip_text(label, caption);
+ gtk_widget_set_tooltip_text(label, desc);
g_signal_connect(station->notebook, "switch-page",
G_CALLBACK(gtk_dock_station_switch_panel), station);
@@ -249,10 +250,10 @@ void gtk_dock_panel_add_widget(GtkDockStation *station, GtkWidget *widget, const
str = g_object_get_data(G_OBJECT(widget), "title");
if (str != NULL) free(str);
- max = 3; // TODO : config dans un .so pour Python // get_integer_config_value(get_main_configuration(), MPT_ELLIPSIS_HEADER);
- g_object_set_data(G_OBJECT(widget), "title", ellipsis(strdup(caption), max));
+ max = 54; // TODO : config dans un .so pour Python // get_integer_config_value(get_main_configuration(), MPT_ELLIPSIS_HEADER);
+ g_object_set_data(G_OBJECT(widget), "title", ellipsis(strdup(desc), max));
- gtk_dock_panel_update_title(station, widget, caption);
+ gtk_dock_panel_update_title(station, widget, desc);
gtk_notebook_set_current_page(station->notebook, -1);
diff --git a/src/gtkext/gtkdockstation.h b/src/gtkext/gtkdockstation.h
index 399f277..7cc2263 100644
--- a/src/gtkext/gtkdockstation.h
+++ b/src/gtkext/gtkdockstation.h
@@ -76,7 +76,7 @@ GType gtk_dock_station_get_type(void);
GtkWidget *gtk_dock_station_new(void);
/* Ajoute un paquet d'informations à l'affichage centralisé. */
-void gtk_dock_panel_add_widget(GtkDockStation *, GtkWidget *, const char *);
+void gtk_dock_panel_add_widget(GtkDockStation *, GtkWidget *, const char *, const char *);
/* Change le contenu de l'onglet courant uniquement. */
void gtk_dock_panel_change_active_widget(GtkDockStation *, GtkWidget *);