summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2016-02-09 22:25:32 -0800
committerSøren Sandmann Pedersen <soren.sandmann@gmail.com>2016-02-21 17:34:30 -0500
commitec2d66e77e992a359397c9c33ede45cdef14df0b (patch)
tree27246e3bbc307531404416854510f971560138ca
parentc280c4391e12625513d9a6a34c6481cee19108b7 (diff)
demos/scale: default to GOOD and locked-together axisspitzak13
This makes the demo match normal behavior of pixman/cairo at startup. Signed-off-by: Bill Spitzak <spitzak@gmail.com> Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
-rw-r--r--demos/scale.c10
-rw-r--r--demos/scale.ui1
2 files changed, 6 insertions, 5 deletions
diff --git a/demos/scale.c b/demos/scale.c
index 6d7ad2a7..d1fce5d3 100644
--- a/demos/scale.c
+++ b/demos/scale.c
@@ -340,7 +340,7 @@ on_expose (GtkWidget *da, GdkEvent *event, gpointer data)
static void
set_up_combo_box (app_t *app, const char *box_name,
- int n_entries, const named_int_t table[])
+ int n_entries, const named_int_t table[], int active)
{
GtkWidget *widget = get_widget (app, box_name);
GtkListStore *model;
@@ -366,7 +366,7 @@ set_up_combo_box (app_t *app, const char *box_name,
gtk_list_store_set (model, &iter, 0, info->name, -1);
}
- gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
+ gtk_combo_box_set_active (GTK_COMBO_BOX (widget), active);
g_signal_connect (widget, "changed", G_CALLBACK (rescale), app);
}
@@ -374,7 +374,7 @@ set_up_combo_box (app_t *app, const char *box_name,
static void
set_up_filter_box (app_t *app, const char *box_name)
{
- set_up_combo_box (app, box_name, G_N_ELEMENTS (filters), filters);
+ set_up_combo_box (app, box_name, G_N_ELEMENTS (filters), filters, 0);
}
static char *
@@ -422,14 +422,14 @@ app_new (pixman_image_t *original)
widget = get_widget (app, "drawing_area");
g_signal_connect (widget, "expose_event", G_CALLBACK (on_expose), app);
- set_up_combo_box (app, "filter_combo_box", G_N_ELEMENTS (filter_types), filter_types);
+ set_up_combo_box (app, "filter_combo_box", G_N_ELEMENTS (filter_types), filter_types, 3);
set_up_filter_box (app, "reconstruct_x_combo_box");
set_up_filter_box (app, "reconstruct_y_combo_box");
set_up_filter_box (app, "sample_x_combo_box");
set_up_filter_box (app, "sample_y_combo_box");
set_up_combo_box (
- app, "repeat_combo_box", G_N_ELEMENTS (repeats), repeats);
+ app, "repeat_combo_box", G_N_ELEMENTS (repeats), repeats, 0);
g_signal_connect (
gtk_builder_get_object (app->builder, "lock_checkbutton"),
diff --git a/demos/scale.ui b/demos/scale.ui
index 1e77f56e..13e0e0d7 100644
--- a/demos/scale.ui
+++ b/demos/scale.ui
@@ -177,6 +177,7 @@
id="lock_checkbutton">
<property name="label" translatable="yes">Lock X and Y Dimensions</property>
<property name="xalign">0.0</property>
+ <property name="active">True</property>
</object>
<packing>
<property name="expand">False</property>