Skip to content

Commit

Permalink
Use subject name as title on the subject page (#32)
Browse files Browse the repository at this point in the history
* Use subject name as title on the subject page

* Show no title when no subject selected
  • Loading branch information
leolost2605 committed Dec 24, 2023
1 parent b2f79ac commit f03512a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/subject-page.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = "";
} else {
placeholder_stack.visible_child = gtk_sw;
edit_subject_button.visible = true;
title_label.title = subject.name;
}
}

Expand Down

0 comments on commit f03512a

Please sign in to comment.