month-view: read 12/24 time format setting
The setting will be used when showing the start time of events in the overflow popover.
This commit is contained in:
@@ -93,6 +93,11 @@ typedef struct
|
|||||||
gint pressed_overflow_indicator;
|
gint pressed_overflow_indicator;
|
||||||
gint hovered_overflow_indicator;
|
gint hovered_overflow_indicator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clock format from GNOME desktop settings
|
||||||
|
*/
|
||||||
|
gboolean use_24h_format;
|
||||||
|
|
||||||
/* text direction factors */
|
/* text direction factors */
|
||||||
gint k;
|
gint k;
|
||||||
|
|
||||||
@@ -1886,3 +1891,20 @@ gcal_month_view_set_first_weekday (GcalMonthView *view,
|
|||||||
g_free (date);
|
g_free (date);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gcal_month_view_set_use_24h_format:
|
||||||
|
* @view:
|
||||||
|
* @use_24h:
|
||||||
|
*
|
||||||
|
* Whether the view will show time using 24h or 12h format
|
||||||
|
**/
|
||||||
|
void
|
||||||
|
gcal_month_view_set_use_24h_format (GcalMonthView *view,
|
||||||
|
gboolean use_24h)
|
||||||
|
{
|
||||||
|
GcalMonthViewPrivate *priv;
|
||||||
|
|
||||||
|
priv = gcal_month_view_get_instance_private (view);
|
||||||
|
priv->use_24h_format = use_24h;
|
||||||
|
}
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ GtkWidget* gcal_month_view_new (GcalManager *manager);
|
|||||||
void gcal_month_view_set_first_weekday (GcalMonthView *view,
|
void gcal_month_view_set_first_weekday (GcalMonthView *view,
|
||||||
gint day_nr);
|
gint day_nr);
|
||||||
|
|
||||||
|
void gcal_month_view_set_use_24h_format (GcalMonthView *view,
|
||||||
|
gboolean use_24h);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GCAL_MONTH_VIEW_H__ */
|
#endif /* __GCAL_MONTH_VIEW_H__ */
|
||||||
|
|||||||
+4
-8
@@ -1259,14 +1259,10 @@ gcal_window_constructed (GObject *object)
|
|||||||
priv->views[GCAL_WINDOW_VIEW_WEEK],
|
priv->views[GCAL_WINDOW_VIEW_WEEK],
|
||||||
"week", _("Week"));
|
"week", _("Week"));
|
||||||
|
|
||||||
priv->views[GCAL_WINDOW_VIEW_MONTH] =
|
priv->views[GCAL_WINDOW_VIEW_MONTH] = gcal_month_view_new (priv->manager);
|
||||||
gcal_month_view_new (priv->manager);
|
gcal_month_view_set_first_weekday (GCAL_MONTH_VIEW (priv->views[GCAL_WINDOW_VIEW_MONTH]), get_first_weekday ());
|
||||||
gcal_month_view_set_first_weekday (
|
gcal_month_view_set_use_24h_format (GCAL_MONTH_VIEW (priv->views[GCAL_WINDOW_VIEW_MONTH]), use_24h_format);
|
||||||
GCAL_MONTH_VIEW (priv->views[GCAL_WINDOW_VIEW_MONTH]),
|
gtk_stack_add_titled (GTK_STACK (priv->views_stack), priv->views[GCAL_WINDOW_VIEW_MONTH], "month", _("Month"));
|
||||||
get_first_weekday ());
|
|
||||||
gtk_stack_add_titled (GTK_STACK (priv->views_stack),
|
|
||||||
priv->views[GCAL_WINDOW_VIEW_MONTH],
|
|
||||||
"month", _("Month"));
|
|
||||||
|
|
||||||
priv->views[GCAL_WINDOW_VIEW_YEAR] =
|
priv->views[GCAL_WINDOW_VIEW_YEAR] =
|
||||||
gcal_year_view_new (priv->manager);
|
gcal_year_view_new (priv->manager);
|
||||||
|
|||||||
Reference in New Issue
Block a user