gimp r25017 - in branches/weskaggs: app/tools libgimpwidgets
- From: weskaggs svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25017 - in branches/weskaggs: app/tools libgimpwidgets
- Date: Mon, 3 Mar 2008 22:57:05 +0000 (GMT)
Author: weskaggs
Date: Mon Mar 3 22:57:05 2008
New Revision: 25017
URL: http://svn.gnome.org/viewvc/gimp?rev=25017&view=rev
Log:
Bill Skaggs <weskaggs primate ucdavis edu>
* libgimpwidgets/gimppropwidgets.[ch]
* app/tools/gimpinkoptions-gui.c
* app/tools/gimpcoloroptions.c
* app/tools/gimpblendoptions.c: add "scale control" prop widget,
and use it in tool options.
Modified:
branches/weskaggs/app/tools/gimpblendoptions.c
branches/weskaggs/app/tools/gimpcoloroptions.c
branches/weskaggs/app/tools/gimpinkoptions-gui.c
branches/weskaggs/libgimpwidgets/gimppropwidgets.c
branches/weskaggs/libgimpwidgets/gimppropwidgets.h
Modified: branches/weskaggs/app/tools/gimpblendoptions.c
==============================================================================
--- branches/weskaggs/app/tools/gimpblendoptions.c (original)
+++ branches/weskaggs/app/tools/gimpblendoptions.c Mon Mar 3 22:57:05 2008
@@ -215,7 +215,8 @@
/* the gradient type menu */
combo = gimp_prop_enum_combo_box_new (config, "gradient-type", 0, 0);
- g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+ /* FIXME -- commented out because generated warning about missing prop */
+/* g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL); */
gimp_enum_combo_box_set_stock_prefix (GIMP_ENUM_COMBO_BOX (combo),
"gimp-gradient");
gimp_table_attach_aligned (GTK_TABLE (table), 0, 4,
@@ -224,7 +225,7 @@
/* the repeat option */
combo = gimp_prop_enum_combo_box_new (config, "gradient-repeat", 0, 0);
- g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+/* g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL); */
gimp_table_attach_aligned (GTK_TABLE (table), 0, 5,
_("Repeat:"), 0.0, 0.5,
combo, 2, FALSE);
@@ -234,7 +235,7 @@
combo);
button = gimp_prop_check_button_new (config, "dither",
- _("Dithering"));
+ _("Dither"));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
@@ -244,7 +245,7 @@
gtk_table_set_row_spacings (GTK_TABLE (table), 1);
frame = gimp_prop_expanding_frame_new (config, "supersample",
- _("Adaptive supersampling"),
+ _("Supersample"),
table, NULL);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
Modified: branches/weskaggs/app/tools/gimpcoloroptions.c
==============================================================================
--- branches/weskaggs/app/tools/gimpcoloroptions.c (original)
+++ branches/weskaggs/app/tools/gimpcoloroptions.c Mon Mar 3 22:57:05 2008
@@ -166,11 +166,11 @@
GIMP_COLOR_OPTIONS (config)->sample_average);
g_object_set_data (G_OBJECT (button), "set_sensitive", table);
- adj = gimp_prop_scale_entry_new (config, "average-radius",
- GTK_TABLE (table), 0, 0,
- _("Radius:"),
- 1.0, 10.0, 0,
- FALSE, 0.0, 0.0);
+ adj = gimp_prop_scale_control_new (config, "average-radius",
+ GTK_TABLE (table), 0, 0,
+ _("Radius:"),
+ 1.0, 10.0, 0,
+ FALSE, 0.0, 0.0);
gimp_scale_control_set_logarithmic (adj, TRUE);
return vbox;
Modified: branches/weskaggs/app/tools/gimpinkoptions-gui.c
==============================================================================
--- branches/weskaggs/app/tools/gimpinkoptions-gui.c (original)
+++ branches/weskaggs/app/tools/gimpinkoptions-gui.c Mon Mar 3 22:57:05 2008
@@ -63,11 +63,11 @@
gtk_widget_show (table);
/* size slider */
- adj = gimp_prop_scale_entry_new (config, "size",
- GTK_TABLE (table), 0, 0,
- _("Size:"),
- 1.0, 2.0, 1,
- FALSE, 0.0, 0.0);
+ adj = gimp_prop_scale_control_new (config, "size",
+ GTK_TABLE (table), 0, 0,
+ _("Size:"),
+ 1.0, 2.0, 1,
+ FALSE, 0.0, 0.0);
gimp_scale_control_set_logarithmic (adj, TRUE);
/* angle adjust slider */
Modified: branches/weskaggs/libgimpwidgets/gimppropwidgets.c
==============================================================================
--- branches/weskaggs/libgimpwidgets/gimppropwidgets.c (original)
+++ branches/weskaggs/libgimpwidgets/gimppropwidgets.c Mon Mar 3 22:57:05 2008
@@ -1175,6 +1175,98 @@
if (! limit_scale)
{
+ adjustment = gimp_scale_entry_new (table, column, row,
+ label, -1, -1,
+ value, lower, upper,
+ step_increment, page_increment,
+ digits,
+ TRUE, 0.0, 0.0,
+ tooltip,
+ NULL);
+ }
+ else
+ {
+ adjustment = gimp_scale_entry_new (table, column, row,
+ label, -1, -1,
+ value, lower_limit, upper_limit,
+ step_increment, page_increment,
+ digits,
+ FALSE, lower, upper,
+ tooltip,
+ NULL);
+ }
+
+ set_param_spec (G_OBJECT (adjustment), NULL, param_spec);
+
+ g_signal_connect (adjustment, "value-changed",
+ G_CALLBACK (gimp_prop_adjustment_callback),
+ config);
+
+ connect_notify (config, property_name,
+ G_CALLBACK (gimp_prop_adjustment_notify),
+ adjustment);
+
+ return adjustment;
+}
+
+/**
+ * gimp_prop_scale_control_new:
+ * @config: Object to which property is attached.
+ * @property_name: Name of double property controlled by the spin button.
+ * @table: The #GtkTable the widgets will be attached to.
+ * @column: The column to start with.
+ * @row: The row to attach the widgets.
+ * @label: The text for the #GtkLabel which will appear left of
+ * the #GtkHScale.
+ * @step_increment: Step size.
+ * @page_increment: Page size.
+ * @digits: Number of digits after decimal point to display.
+ * @limit_scale: %TRUE if the range of possible values of the
+ * GtkSpinButton should be the same as of the GtkHScale.
+ * @lower_limit: The spinbutton's lower boundary if @limit_scale is %FALSE.
+ * @upper_limit: The spinbutton's upper boundary if @limit_scale is %FALSE.
+ *
+ * Creates a label, entry, and popup button, all inserted in the specified
+ * table. Clicking on the popup button pops up a slider/spinbutton control.
+ *
+ * Return value: The #GtkSpinButton's #GtkAdjustment.
+ *
+ * Since GIMP 2.6
+ */
+GtkObject *
+gimp_prop_scale_control_new (GObject *config,
+ const gchar *property_name,
+ GtkTable *table,
+ gint column,
+ gint row,
+ const gchar *label,
+ gdouble step_increment,
+ gdouble page_increment,
+ gint digits,
+ gboolean limit_scale,
+ gdouble lower_limit,
+ gdouble upper_limit)
+{
+ GParamSpec *param_spec;
+ GtkObject *adjustment;
+ const gchar *tooltip;
+ gdouble value;
+ gdouble lower;
+ gdouble upper;
+
+ param_spec = find_param_spec (config, property_name, G_STRFUNC);
+ if (! param_spec)
+ return NULL;
+
+ if (! get_numeric_values (config,
+ param_spec, &value, &lower, &upper, G_STRFUNC))
+ return NULL;
+
+ tooltip = dgettext (gimp_type_get_translation_domain (G_OBJECT_TYPE (config)),
+ g_param_spec_get_blurb (param_spec));
+
+ if (! limit_scale)
+ {
adjustment = gimp_scale_control_new (table, column, row,
label, -1, -1,
value, lower, upper,
@@ -1263,7 +1355,7 @@
adjustment = gimp_scale_control_new (table, column, row,
label, -1, -1,
value, lower, upper,
- 1.0, 10.0, 1,
+ 1.0, 10.0, 0,
TRUE, 0.0, 0.0,
tooltip,
NULL);
Modified: branches/weskaggs/libgimpwidgets/gimppropwidgets.h
==============================================================================
--- branches/weskaggs/libgimpwidgets/gimppropwidgets.h (original)
+++ branches/weskaggs/libgimpwidgets/gimppropwidgets.h Mon Mar 3 22:57:05 2008
@@ -112,6 +112,19 @@
gdouble lower_limit,
gdouble upper_limit);
+GtkObject * gimp_prop_scale_control_new (GObject *config,
+ const gchar *property_name,
+ GtkTable *table,
+ gint column,
+ gint row,
+ const gchar *label,
+ gdouble step_increment,
+ gdouble page_increment,
+ gint digits,
+ gboolean limit_scale,
+ gdouble lower_limit,
+ gdouble upper_limit);
+
/* special form of gimp_prop_scale_entry_new() for GParamDouble */
GtkObject * gimp_prop_opacity_entry_new (GObject *config,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]