Skip to content

Commit fbb9da2

Browse files
authored
Plug: add headerbar to placeholder (#213)
1 parent 346c6d7 commit fbb9da2

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

src/Plug.vala

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,27 @@ namespace Printers {
3434

3535
list = new PrinterList (stack);
3636

37+
var header_bar = new Adw.HeaderBar () {
38+
show_title = false,
39+
show_start_title_buttons = false,
40+
show_back_button = false
41+
};
42+
header_bar.add_css_class (Granite.STYLE_CLASS_FLAT);
43+
3744
var empty_alert = new Granite.Placeholder (_("No Printers Available")) {
3845
description = _("Connect to a printer by clicking the icon in the toolbar below."),
3946
icon = new ThemedIcon ("printer-error"),
40-
visible = true
47+
vexpand = true
4148
};
42-
empty_alert.remove_css_class (Granite.STYLE_CLASS_VIEW);
49+
50+
var placeholder_box = new Gtk.Box (VERTICAL, 0);
51+
placeholder_box.append (header_bar);
52+
placeholder_box.append (empty_alert);
4353

4454
main_stack = new Gtk.Stack () {
4555
transition_type = Gtk.StackTransitionType.CROSSFADE
4656
};
47-
main_stack.add_named (empty_alert, "empty-alert");
57+
main_stack.add_named (placeholder_box, "empty-alert");
4858
main_stack.add_named (stack, "main-paned");
4959

5060
main_paned = new Gtk.Paned (Gtk.Orientation.HORIZONTAL) {

0 commit comments

Comments
 (0)