diff --git a/src/ag-window.c b/src/ag-window.c index 1add944..f83b177 100644 --- a/src/ag-window.c +++ b/src/ag-window.c @@ -13,6 +13,7 @@ #include "ag-settings.h" struct _AgWindowPrivate { + GtkWidget *header_bar; GtkWidget *grid; GtkWidget *stack; GtkWidget *stack_switcher; @@ -551,6 +552,7 @@ ag_window_class_init(AgWindowClass *klass) gobject_class->dispose = ag_window_dispose; gtk_widget_class_set_template_from_resource(widget_class, "/eu/polonkai/gergely/astrognome/ag-window.ui"); + gtk_widget_class_bind_template_child_private(widget_class, AgWindow, header_bar); gtk_widget_class_bind_template_child_private(widget_class, AgWindow, name); gtk_widget_class_bind_template_child_private(widget_class, AgWindow, year); gtk_widget_class_bind_template_child_private(widget_class, AgWindow, month); @@ -697,3 +699,14 @@ ag_window_change_tab(AgWindow *window, const gchar *tab_name) g_variant_new_string(tab_name) ); } + +void +ag_window_name_changed_cb(GtkEntry *name_entry, AgWindow *window) +{ + const gchar *name; + AgWindowPrivate *priv = ag_window_get_instance_private(window); + + name = gtk_entry_get_text(name_entry); + + gtk_header_bar_set_subtitle(GTK_HEADER_BAR(priv->header_bar), name); +} diff --git a/src/ag-window.ui b/src/ag-window.ui index 7d67ae9..0b60206 100644 --- a/src/ag-window.ui +++ b/src/ag-window.ui @@ -116,6 +116,7 @@ False False True + Astrognome True @@ -199,6 +200,7 @@ True True + 1