|
15 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | */ |
17 | 17 |
|
18 | | -public class CalendarRow : Gtk.Grid { |
| 18 | +public class CalendarRow : Gtk.Box { |
19 | 19 |
|
20 | 20 | private const string CALENDAR_COLOR_STYLE = """ |
21 | 21 | .cal-color { |
@@ -46,25 +46,27 @@ public class CalendarRow : Gtk.Grid { |
46 | 46 | } |
47 | 47 |
|
48 | 48 | construct { |
49 | | - column_spacing = 6; |
50 | | - |
51 | | - var calendar_color = new Gtk.Grid (); |
52 | | - calendar_color.height_request = 12; |
53 | | - calendar_color.valign = Gtk.Align.CENTER; |
54 | | - calendar_color.width_request = 12; |
| 49 | + var calendar_color = new Gtk.Grid () { |
| 50 | + height_request = 12, |
| 51 | + width_request = 12, |
| 52 | + valign = CENTER |
| 53 | + }; |
| 54 | + calendar_color.get_style_context ().add_class ("cal-color"); |
55 | 55 |
|
56 | 56 | calendar_color_context = calendar_color.get_style_context (); |
57 | | - calendar_color_context.add_class ("cal-color"); |
58 | 57 |
|
59 | | - var calendar_name_label = new Gtk.Label (""); |
60 | | - calendar_name_label.xalign = 0; |
61 | | - calendar_name_label.hexpand = true; |
62 | | - calendar_name_label.ellipsize = Pango.EllipsizeMode.MIDDLE; |
| 58 | + var calendar_name_label = new Gtk.Label ("") { |
| 59 | + hexpand = true, |
| 60 | + ellipsize = MIDDLE, |
| 61 | + xalign = 0 |
| 62 | + }; |
63 | 63 |
|
64 | | - var selection_icon = new Gtk.Image.from_icon_name ("object-select-symbolic", Gtk.IconSize.MENU); |
65 | | - selection_icon.no_show_all = true; |
66 | | - selection_icon.visible = false; |
| 64 | + var selection_icon = new Gtk.Image.from_icon_name ("object-select-symbolic", Gtk.IconSize.MENU) { |
| 65 | + no_show_all = true, |
| 66 | + visible = false |
| 67 | + }; |
67 | 68 |
|
| 69 | + spacing = 6; |
68 | 70 | add (calendar_color); |
69 | 71 | add (calendar_name_label); |
70 | 72 | add (selection_icon); |
|
0 commit comments