Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 30 additions & 28 deletions src/EventEdition/RepeatPanel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Authored by: Jaap Broekhuizen
*/

public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid {
public class Maya.View.EventEdition.RepeatPanel : Gtk.Bin {
private EventDialog parent_dialog;
private Gtk.Switch repeat_switch;
private Gtk.ComboBoxText repeat_combobox;
Expand Down Expand Up @@ -133,23 +133,20 @@ public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid {

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

var no_exceptions_label = new Gtk.Label (_("No Exceptions"));
var no_exceptions_label = new Gtk.Label (_("No Exceptions")) {
margin_top = 12,
margin_bottom = 12
};
no_exceptions_label.show ();

no_exceptions_label.get_style_context ().add_class (Granite.STYLE_CLASS_H3_LABEL);
no_exceptions_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL);

exceptions_list = new Gtk.ListBox () {
hexpand = true,
vexpand = true,
selection_mode = NONE
};
exceptions_list.set_placeholder (no_exceptions_label);

var exceptions_scrolled = new Gtk.ScrolledWindow (null, null) {
child = exceptions_list
};

var add_button = new Gtk.Button.with_label (_("Add Exception")) {
always_show_image = true,
image = new Gtk.Image.from_icon_name ("list-add-symbolic", Gtk.IconSize.BUTTON),
Expand All @@ -165,29 +162,33 @@ public class Maya.View.EventEdition.RepeatPanel : Gtk.Grid {
inline_toolbar.add (add_button);

var exceptions_box = new Gtk.Box (VERTICAL, 0) {
margin_bottom = 12,
sensitive = false
};
exceptions_box.add (exceptions_scrolled);
exceptions_box.add (exceptions_list);
exceptions_box.add (inline_toolbar);
exceptions_box.get_style_context ().add_class (Granite.STYLE_CLASS_CARD);

var exceptions_frame = new Gtk.Frame (null) {
child = exceptions_box
var main_box = new Gtk.Box (VERTICAL, 6) {
margin_start = 12,
margin_end = 12
};
main_box.add (reminder_label);
main_box.add (repeat_box);
main_box.add (every_label);
main_box.add (every_box);
main_box.add (week_box);
main_box.add (month_grid);
main_box.add (ends_label);
main_box.add (ends_grid);
main_box.add (exceptions_label);
main_box.add (exceptions_box);

var scrolled = new Gtk.ScrolledWindow (null, null) {
child = main_box
};

margin_start = 12;
margin_end = 12;
row_spacing = 6;
column_spacing = 12;
attach (reminder_label, 1, 0);
attach (repeat_box, 1, 1);
attach (every_label, 1, 2);
attach (every_box, 1, 3);
attach (week_box, 1, 4);
attach (month_grid, 1, 4);
attach (ends_label, 1, 5);
attach (ends_grid, 1, 6);
attach (exceptions_label, 1, 7);
attach (exceptions_frame, 1, 8);
child = scrolled;

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

margin_top = 6;
margin_start = 6;
margin_end = 6;
margin_top = 12;
margin_start = 12;
margin_end = 12;
margin_bottom = 12;
child = box;

remove_button.clicked.connect (() => {
Expand Down