Skip to content

Commit e23deea

Browse files
danirabbitjeremypw
andauthored
CalendarRow: cleanup (#841)
Co-authored-by: Jeremy Wootten <jeremywootten@gmail.com>
1 parent 17d465d commit e23deea

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

src/Widgets/CalendarRow.vala

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
public class CalendarRow : Gtk.Grid {
18+
public class CalendarRow : Gtk.Box {
1919

2020
private const string CALENDAR_COLOR_STYLE = """
2121
.cal-color {
@@ -46,25 +46,27 @@ public class CalendarRow : Gtk.Grid {
4646
}
4747

4848
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");
5555

5656
calendar_color_context = calendar_color.get_style_context ();
57-
calendar_color_context.add_class ("cal-color");
5857

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+
};
6363

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+
};
6768

69+
spacing = 6;
6870
add (calendar_color);
6971
add (calendar_name_label);
7072
add (selection_icon);

0 commit comments

Comments
 (0)