Skip to content

Commit f90d295

Browse files
authored
RepeatPanel: put inside a scrolled (#920)
1 parent 55656fa commit f90d295

1 file changed

Lines changed: 30 additions & 28 deletions

File tree

src/EventEdition/RepeatPanel.vala

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Authored by: Jaap Broekhuizen
66
*/
77

8-
public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid {
8+
public class Maya.View.EventEdition.RepeatPanel : Gtk.Bin {
99
private EventDialog parent_dialog;
1010
private Gtk.Switch repeat_switch;
1111
private Gtk.ComboBoxText repeat_combobox;
@@ -133,23 +133,20 @@ public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid {
133133

134134
var exceptions_label = new Granite.HeaderLabel (_("Exceptions:"));
135135

136-
var no_exceptions_label = new Gtk.Label (_("No Exceptions"));
136+
var no_exceptions_label = new Gtk.Label (_("No Exceptions")) {
137+
margin_top = 12,
138+
margin_bottom = 12
139+
};
137140
no_exceptions_label.show ();
138141

139142
no_exceptions_label.get_style_context ().add_class (Granite.STYLE_CLASS_H3_LABEL);
140143
no_exceptions_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL);
141144

142145
exceptions_list = new Gtk.ListBox () {
143-
hexpand = true,
144-
vexpand = true,
145146
selection_mode = NONE
146147
};
147148
exceptions_list.set_placeholder (no_exceptions_label);
148149

149-
var exceptions_scrolled = new Gtk.ScrolledWindow (null, null) {
150-
child = exceptions_list
151-
};
152-
153150
var add_button = new Gtk.Button.with_label (_("Add Exception")) {
154151
always_show_image = true,
155152
image = new Gtk.Image.from_icon_name ("list-add-symbolic", Gtk.IconSize.BUTTON),
@@ -165,29 +162,33 @@ public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid {
165162
inline_toolbar.add (add_button);
166163

167164
var exceptions_box = new Gtk.Box (VERTICAL, 0) {
165+
margin_bottom = 12,
168166
sensitive = false
169167
};
170-
exceptions_box.add (exceptions_scrolled);
168+
exceptions_box.add (exceptions_list);
171169
exceptions_box.add (inline_toolbar);
170+
exceptions_box.get_style_context ().add_class (Granite.STYLE_CLASS_CARD);
172171

173-
var exceptions_frame = new Gtk.Frame (null) {
174-
child = exceptions_box
172+
var main_box = new Gtk.Box (VERTICAL, 6) {
173+
margin_start = 12,
174+
margin_end = 12
175+
};
176+
main_box.add (reminder_label);
177+
main_box.add (repeat_box);
178+
main_box.add (every_label);
179+
main_box.add (every_box);
180+
main_box.add (week_box);
181+
main_box.add (month_grid);
182+
main_box.add (ends_label);
183+
main_box.add (ends_grid);
184+
main_box.add (exceptions_label);
185+
main_box.add (exceptions_box);
186+
187+
var scrolled = new Gtk.ScrolledWindow (null, null) {
188+
child = main_box
175189
};
176190

177-
margin_start = 12;
178-
margin_end = 12;
179-
row_spacing = 6;
180-
column_spacing = 12;
181-
attach (reminder_label, 1, 0);
182-
attach (repeat_box, 1, 1);
183-
attach (every_label, 1, 2);
184-
attach (every_box, 1, 3);
185-
attach (week_box, 1, 4);
186-
attach (month_grid, 1, 4);
187-
attach (ends_label, 1, 5);
188-
attach (ends_grid, 1, 6);
189-
attach (exceptions_label, 1, 7);
190-
attach (exceptions_frame, 1, 8);
191+
child = scrolled;
191192

192193
reorder_week_box ();
193194
Calendar.EventStore.get_default ().notify["week-starts-on"].connect (reorder_week_box);
@@ -779,9 +780,10 @@ public class Maya.View.EventEdition.ExceptionGrid : Gtk.ListBoxRow {
779780
box.add (date);
780781
box.add (remove_button);
781782

782-
margin_top = 6;
783-
margin_start = 6;
784-
margin_end = 6;
783+
margin_top = 12;
784+
margin_start = 12;
785+
margin_end = 12;
786+
margin_bottom = 12;
785787
child = box;
786788

787789
remove_button.clicked.connect (() => {

0 commit comments

Comments
 (0)