Unverified Commit 4aed2c4f authored by Erik Reider's avatar Erik Reider Committed by GitHub

Make the notification actions stretch to fill the whole space like before (#613)

parent 5adc54cc
...@@ -575,6 +575,7 @@ namespace SwayNotificationCenter { ...@@ -575,6 +575,7 @@ namespace SwayNotificationCenter {
child = alt_actions_box.get_first_child ()) { child = alt_actions_box.get_first_child ()) {
alt_actions_box.remove (child); alt_actions_box.remove (child);
} }
alt_actions_box.set_max_children_per_line (1);
// Check for security codes // Check for security codes
string ? code = parse_body_codes (); string ? code = parse_body_codes ();
...@@ -601,8 +602,10 @@ namespace SwayNotificationCenter { ...@@ -601,8 +602,10 @@ namespace SwayNotificationCenter {
flowbox_child.set_child (action_button); flowbox_child.set_child (action_button);
} }
int max_children_per_line = 0;
// Add notification specified actions // Add notification specified actions
foreach (var action in param.actions.data) { foreach (var action in param.actions.data) {
max_children_per_line++;
Gtk.FlowBoxChild flowbox_child = new Gtk.FlowBoxChild (); Gtk.FlowBoxChild flowbox_child = new Gtk.FlowBoxChild ();
flowbox_child.add_css_class ("notification-action"); flowbox_child.add_css_class ("notification-action");
alt_actions_box.append (flowbox_child); alt_actions_box.append (flowbox_child);
...@@ -612,6 +615,7 @@ namespace SwayNotificationCenter { ...@@ -612,6 +615,7 @@ namespace SwayNotificationCenter {
action_button.set_can_focus (false); action_button.set_can_focus (false);
flowbox_child.set_child (action_button); flowbox_child.set_child (action_button);
} }
alt_actions_box.set_max_children_per_line (max_children_per_line.clamp (1, 7));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment