Commit eb043981 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

Support scaling by percentage. Patch by Paul W. Frields

2006-12-06  Juerg Billeter  <j@bitron.ch>

	* src/nautilus-image-resizer.c: Support scaling by percentage.
	  Patch by Paul W. Frields <stickster@gmail.com>

svn path=/trunk/; revision=10
parent 2ba9cbdf
2006-12-06 Jürg Billeter <j@bitron.ch>
* src/nautilus-image-resizer.c: Support scaling by percentage.
Patch by Paul W. Frields <stickster@gmail.com>
2006-01-19 Jürg Billeter <j@bitron.ch>
* src/nautilus-image-resizer.c: Remove unnecessary -size argument.
......
......@@ -210,6 +210,83 @@
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox8">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkRadioButton" id="custom_pct_radiobutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Scale:</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">default_size_radiobutton</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="pct_spinbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="climb_rate">1</property>
<property name="digits">0</property>
<property name="numeric">True</property>
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
<property name="adjustment">50 1 100 1 10 10</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label15">
<property name="visible">True</property>
<property name="label" translatable="yes">percent</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox5">
<property name="visible">True</property>
......
......@@ -55,6 +55,8 @@ struct _NautilusImageResizerPrivate {
GtkDialog *resize_dialog;
GtkRadioButton *default_size_radiobutton;
GtkComboBox *size_combobox;
GtkRadioButton *custom_pct_radiobutton;
GtkSpinButton *pct_spinbutton;
GtkRadioButton *custom_size_radiobutton;
GtkSpinButton *width_spinbutton;
GtkSpinButton *height_spinbutton;
......@@ -370,6 +372,8 @@ nautilus_image_resizer_response_cb (GtkDialog *dialog, gint response_id, gpointe
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->default_size_radiobutton))) {
priv->size = gtk_combo_box_get_active_text (GTK_COMBO_BOX (priv->size_combobox));
} else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->custom_pct_radiobutton))) {
priv->size = g_strdup_printf ("%d%%", (int) gtk_spin_button_get_value (priv->pct_spinbutton));
} else {
priv->size = g_strdup_printf ("%dx%d", (int) gtk_spin_button_get_value (priv->width_spinbutton), (int) gtk_spin_button_get_value (priv->height_spinbutton));
}
......@@ -393,6 +397,8 @@ nautilus_image_resizer_init(NautilusImageResizer *resizer)
priv->default_size_radiobutton = GTK_RADIO_BUTTON (glade_xml_get_widget (xml_dialog, "default_size_radiobutton"));
priv->size_combobox = GTK_COMBO_BOX (glade_xml_get_widget (xml_dialog, "size_combobox"));
gtk_combo_box_set_active (priv->size_combobox, 4); /* 1024x768 */
priv->custom_pct_radiobutton = GTK_RADIO_BUTTON (glade_xml_get_widget (xml_dialog, "custom_pct_radiobutton"));
priv->pct_spinbutton = GTK_SPIN_BUTTON (glade_xml_get_widget (xml_dialog, "pct_spinbutton"));
priv->custom_size_radiobutton = GTK_RADIO_BUTTON (glade_xml_get_widget (xml_dialog, "custom_size_radiobutton"));
priv->width_spinbutton = GTK_SPIN_BUTTON (glade_xml_get_widget (xml_dialog, "width_spinbutton"));
priv->height_spinbutton = GTK_SPIN_BUTTON (glade_xml_get_widget (xml_dialog, "height_spinbutton"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment