Removed alt button box from ui file

This commit is contained in:
Erik Reider
2021-09-17 22:31:24 +02:00
parent 9365ff2d80
commit b39fbb1bb0
2 changed files with 10 additions and 20 deletions

View File

@@ -191,22 +191,6 @@
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkButtonBox" id="alt_actions_button_box">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="homogeneous">True</property>
<property name="layout-style">expand</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<style> <style>
<class name="notification"/> <class name="notification"/>
</style> </style>

View File

@@ -10,13 +10,15 @@ namespace SwayNotificatonCenter {
[GtkChild] [GtkChild]
unowned Gtk.Button default_button; unowned Gtk.Button default_button;
[GtkChild]
unowned Gtk.Box base_box;
[GtkChild] [GtkChild]
unowned Gtk.Revealer close_revealer; unowned Gtk.Revealer close_revealer;
[GtkChild] [GtkChild]
unowned Gtk.Button close_button; unowned Gtk.Button close_button;
[GtkChild] private Gtk.ButtonBox alt_actions_box;
unowned Gtk.ButtonBox alt_actions_button_box;
[GtkChild] [GtkChild]
unowned Gtk.Label summary; unowned Gtk.Label summary;
@@ -156,14 +158,18 @@ namespace SwayNotificatonCenter {
private void set_actions () { private void set_actions () {
if (param.actions.length > 0) { if (param.actions.length > 0) {
alt_actions_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL);
alt_actions_box.set_homogeneous (true);
alt_actions_box.set_layout (Gtk.ButtonBoxStyle.EXPAND);
foreach (var action in param.actions) { foreach (var action in param.actions) {
var actionButton = new Gtk.Button.with_label (action._name); var actionButton = new Gtk.Button.with_label (action._name);
actionButton.clicked.connect (() => action_clicked (action)); actionButton.clicked.connect (() => action_clicked (action));
actionButton.get_style_context ().add_class ("notification-action"); actionButton.get_style_context ().add_class ("notification-action");
actionButton.can_focus = false; actionButton.can_focus = false;
alt_actions_button_box.add (actionButton); alt_actions_box.add (actionButton);
} }
alt_actions_button_box.show_all (); alt_actions_box.show_all ();
base_box.add (alt_actions_box);
} }
} }