date-chooser: tweak style
To keep the current date chooser in sync with GNOME Shell, tweak the week names to show only the first, upcased letter of the week name. Also, this commit avoids making day number circles ellipses when the week number is not present.
This commit is contained in:
@@ -337,6 +337,9 @@ gcal_date_chooser_day_init (GcalDateChooserDay *self)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (self);
|
||||
|
||||
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
|
||||
|
||||
gtk_widget_set_can_focus (widget, TRUE);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "day");
|
||||
|
||||
|
||||
@@ -205,12 +205,20 @@ static gchar *
|
||||
calendar_get_weekday_name (gint i)
|
||||
{
|
||||
GDateTime *date;
|
||||
gchar *formatted_date;
|
||||
gchar *upcased_date;
|
||||
gchar *text;
|
||||
|
||||
date = g_date_time_new_local (2015, 1, 4 + i, 1, 1, 1);
|
||||
text = g_date_time_format (date, "%a");
|
||||
formatted_date = g_date_time_format (date, "%a");
|
||||
g_date_time_unref (date);
|
||||
|
||||
upcased_date = g_utf8_strup (formatted_date, -1);
|
||||
g_free (formatted_date);
|
||||
|
||||
text = g_utf8_substring (upcased_date, 0, 1);
|
||||
g_free (upcased_date);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user