time-selector: limit to 11 hours when using 12h format

This commit is contained in:
Georges Basile Stavracas Neto
2014-12-18 09:55:10 -05:00
committed by Erick Pérez Castellanos
parent 37a38b6acb
commit de04c78cc0
+8
View File
@@ -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);