diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 5bb3cac..42b92b7 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -128,23 +128,23 @@ public class Mondai.MainWindow : He.ApplicationWindow { actions.add_action_entries (ACTION_ENTRIES, this); insert_action_group ("win", actions); + var title = new He.ViewTitle (); + stack.visible_child_name = "select"; - appbar.viewtitle_widget = null; - appbar.viewtitle_widget = new He.ViewTitle () { label = _("Select Component") }; + appbar.viewtitle_widget = title; + title.label = _("Select Component"); appbar.show_back = false; appbar.scroller = s; to_describe.clicked.connect (() => { stack.visible_child_name = "describe"; - appbar.viewtitle_widget = null; - appbar.viewtitle_widget = new He.ViewTitle () { label = _("Describe Issue") }; + title.label = _("Describe Issue"); appbar.scroller = s1; appbar.show_back = true; appbar.back_button.clicked.connect (() => { stack.visible_child_name = "select"; - appbar.viewtitle_widget = null; - appbar.viewtitle_widget = new He.ViewTitle () { label = _("Select Component") }; + title.label = _("Select Component"); appbar.show_back = false; appbar.scroller = s; }); @@ -153,14 +153,12 @@ public class Mondai.MainWindow : He.ApplicationWindow { submit.clicked.connect (() => { submit_report.begin (() => { stack.visible_child_name = "submitted"; - appbar.viewtitle_widget = null; - appbar.viewtitle_widget = new He.ViewTitle () { label = _("Report submitted!") }; + title.label = _("Report submitted!"); appbar.scroller = s2; appbar.back_button.clicked.connect (() => { stack.visible_child_name = "describe"; - appbar.viewtitle_widget = null; - appbar.viewtitle_widget = new He.ViewTitle () { label = _("Select Component") }; + title.label = _("Select Component"); appbar.scroller = s1; }); });