[gnome-calendar/time-selector] time-selector: limit to 11 hours when using 12h format
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/time-selector] time-selector: limit to 11 hours when using 12h format
- Date: Wed, 17 Dec 2014 17:29:31 +0000 (UTC)
commit d549c32ea8078ec5f8e4dd98421d3bbe8317d550
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Dec 17 15:29:21 2014 -0200
time-selector: limit to 11 hours when using 12h format
src/gcal-time-selector.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-time-selector.c b/src/gcal-time-selector.c
index e5e3afd..f6c7b26 100644
--- a/src/gcal-time-selector.c
+++ b/src/gcal-time-selector.c
@@ -104,6 +104,7 @@ gcal_time_selector_constructed (GObject *object)
GcalTimeSelectorPrivate *priv;
GtkWidget *grid;
GtkBuilder *builder;
+ GtkAdjustment *adj;
GSettings *settings;
gchar *clock_format;
@@ -154,6 +155,13 @@ gcal_time_selector_constructed (GObject *object)
gtk_container_add (GTK_CONTAINER (priv->popover), grid);
g_object_bind_property (priv->popover, "visible", object, "active", G_BINDING_BIDIRECTIONAL);
+ /* maximum of 11 for 12h format */
+ if (! priv->format_24h)
+ {
+ adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->hour_spin));
+ gtk_adjustment_set_upper (adj, 11.0);
+ }
+
/* signals */
g_signal_connect (priv->hour_spin, "output", G_CALLBACK (on_output), object);
g_signal_connect (priv->minute_spin, "output", G_CALLBACK (on_output), object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]