From fbae2aa9c68736e67fe651c49092d6ffb07b7a31 Mon Sep 17 00:00:00 2001 From: Leonhard Date: Sun, 24 Dec 2023 17:53:32 +0100 Subject: [PATCH 1/2] Use subject name as title on the subject page --- src/subject-page.vala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/subject-page.vala b/src/subject-page.vala index 00184c7..2196c61 100644 --- a/src/subject-page.vala +++ b/src/subject-page.vala @@ -54,10 +54,13 @@ public class SubjectPage : Gtk.Box { icon_name = "document-edit-symbolic" }; - var header_bar = new Adw.HeaderBar (); + var title_label = new Adw.WindowTitle ("", ""); + + var header_bar = new Adw.HeaderBar () { + title_widget = title_label + }; header_bar.pack_end (menu_button); header_bar.pack_end (edit_subject_button); - header_bar.pack_start (toggle_button); //TOP BOX @@ -149,9 +152,11 @@ public class SubjectPage : Gtk.Box { if (subject == null) { placeholder_stack.visible_child = placeholder; edit_subject_button.visible = false; + title_label.title = _("No Subject Selected"); } else { placeholder_stack.visible_child = gtk_sw; edit_subject_button.visible = true; + title_label.title = subject.name; } } From 9d93633159ee77baab2431d1f343bb1fb20f8cc6 Mon Sep 17 00:00:00 2001 From: Leonhard Date: Sun, 24 Dec 2023 17:55:46 +0100 Subject: [PATCH 2/2] Show no title when no subject selected --- src/subject-page.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/subject-page.vala b/src/subject-page.vala index 2196c61..5f557fd 100644 --- a/src/subject-page.vala +++ b/src/subject-page.vala @@ -152,7 +152,7 @@ public class SubjectPage : Gtk.Box { if (subject == null) { placeholder_stack.visible_child = placeholder; edit_subject_button.visible = false; - title_label.title = _("No Subject Selected"); + title_label.title = ""; } else { placeholder_stack.visible_child = gtk_sw; edit_subject_button.visible = true;