Make elapsed popover separator creation more universal

This commit is contained in:
Rafał Dzięgiel
2021-01-22 22:19:04 +01:00
parent a82a36c6b5
commit f993a9e16c
2 changed files with 27 additions and 23 deletions

View File

@@ -231,4 +231,30 @@ class ClapperElapsedPopoverButton extends LabelPopoverButton
this.scrolledWindow.max_content_height = (isFullscreen)
? 190 : 150;
}
addSeparator(text)
{
const box = new Gtk.Box({
orientation: Gtk.Orientation.HORIZONTAL,
hexpand: true,
});
const label = new Gtk.Label({
label: text,
halign: Gtk.Align.CENTER,
});
const leftSeparator = new Gtk.Separator({
orientation: Gtk.Orientation.HORIZONTAL,
hexpand: true,
valign: Gtk.Align.CENTER,
});
const rightSeparator = new Gtk.Separator({
orientation: Gtk.Orientation.HORIZONTAL,
hexpand: true,
valign: Gtk.Align.CENTER,
});
box.append(leftSeparator);
box.append(label);
box.append(rightSeparator);
this.popoverBox.append(box);
}
});