Skip to content

Commit

Permalink
Handle own titlebuttons (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Mar 21, 2024
1 parent 76bcf92 commit 13ed638
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/Plug.vala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

public class DateTime.Plug : Switchboard.Plug {
private MainView main_view;
private Gtk.Box box;

public Plug () {
GLib.Intl.bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
Expand All @@ -36,11 +36,22 @@ public class DateTime.Plug : Switchboard.Plug {
}

public override Gtk.Widget get_widget () {
if (main_view == null) {
main_view = new DateTime.MainView ();
if (box == null) {
var headerbar = new Adw.HeaderBar () {
show_title = false
};
headerbar.add_css_class (Granite.STYLE_CLASS_FLAT);

var main_view = new MainView () {
vexpand = true
};

box = new Gtk.Box (VERTICAL, 0);
box.append (headerbar);
box.append (main_view);
}

return main_view;
return box;
}

public override void shown () {
Expand Down

0 comments on commit 13ed638

Please sign in to comment.