[gnome-calendar/wip/gbsneto/date-chooser] date-chooser: tweak style
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/wip/gbsneto/date-chooser] date-chooser: tweak style
- Date: Sat, 23 Jul 2016 20:25:18 +0000 (UTC)
commit f1f69c98bc703ceb9413c8c37c41aaead209d676
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Jul 23 17:18:18 2016 -0300
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.
src/gcal-date-chooser-day.c | 3 +++
src/gcal-date-chooser.c | 10 +++++++++-
2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-date-chooser-day.c b/src/gcal-date-chooser-day.c
index 1f85d14..018bec7 100644
--- a/src/gcal-date-chooser-day.c
+++ b/src/gcal-date-chooser-day.c
@@ -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");
diff --git a/src/gcal-date-chooser.c b/src/gcal-date-chooser.c
index a054f78..fc157e3 100644
--- a/src/gcal-date-chooser.c
+++ b/src/gcal-date-chooser.c
@@ -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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]