[gthumb: 123/129] rotate tool: added reset button
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb: 123/129] rotate tool: added reset button
- Date: Wed, 27 Apr 2011 21:00:43 +0000 (UTC)
commit a0ccaff4c94f38375f88adc9511c3e851fbda696
Author: Stefano Pettini <spettini users sourceforge net>
Date: Tue Apr 26 18:05:52 2011 +0100
rotate tool: added reset button
extensions/file_tools/data/ui/rotate-options.ui | 328 ++++++++++++-----------
extensions/file_tools/gth-file-tool-rotate.c | 12 +
2 files changed, 184 insertions(+), 156 deletions(-)
---
diff --git a/extensions/file_tools/data/ui/rotate-options.ui b/extensions/file_tools/data/ui/rotate-options.ui
index 36a35ed..53011f1 100644
--- a/extensions/file_tools/data/ui/rotate-options.ui
+++ b/extensions/file_tools/data/ui/rotate-options.ui
@@ -23,39 +23,31 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkVBox" id="vbox6">
+ <object class="GtkTable" id="table2">
<property name="visible">True</property>
- <property name="spacing">6</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
<child>
- <object class="GtkTable" id="table2">
+ <object class="GtkHBox" id="rotation_angle_hbox">
<property name="visible">True</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">6</property>
- <property name="row_spacing">6</property>
<child>
- <object class="GtkHBox" id="rotation_angle_hbox">
- <property name="visible">True</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="rotation_angle_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Angle</property>
- </object>
- <packing>
- <property name="x_options">GTK_FILL</property>
- </packing>
+ <placeholder/>
</child>
</object>
<packing>
- <property name="position">0</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="rotation_angle_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Angle</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
@@ -68,7 +60,41 @@
<property name="draw_indicator">True</property>
</object>
<packing>
- <property name="position">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHButtonBox" id="hbuttonbox4">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkButton" id="reset_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Reset</property>
+ <attributes>
+ <attribute name="size" value="8000"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
</packing>
</child>
</object>
@@ -102,61 +128,52 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkVBox" id="vbox4">
+ <object class="GtkHButtonBox" id="hbuttonbox3">
<property name="visible">True</property>
<property name="spacing">6</property>
+ <property name="layout_style">spread</property>
<child>
- <object class="GtkHButtonBox" id="hbuttonbox3">
+ <object class="GtkButton" id="align_h_button">
<property name="visible">True</property>
- <property name="spacing">6</property>
- <property name="layout_style">spread</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
<child>
- <object class="GtkButton" id="align_h_button">
+ <object class="GtkLabel" id="label6">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
- <child>
- <object class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Align horizontally</property>
- <attributes>
- <attribute name="size" value="8000"/>
- </attributes>
- </object>
- </child>
+ <property name="label" translatable="yes">Align horizontally</property>
+ <attributes>
+ <attribute name="size" value="8000"/>
+ </attributes>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
</child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="align_v_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
<child>
- <object class="GtkButton" id="align_v_button">
+ <object class="GtkLabel" id="label7">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
- <child>
- <object class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Align vertically</property>
- <attributes>
- <attribute name="size" value="8000"/>
- </attributes>
- </object>
- </child>
+ <property name="label" translatable="yes">Align vertically</property>
+ <attributes>
+ <attribute name="size" value="8000"/>
+ </attributes>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
<packing>
- <property name="position">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
@@ -190,9 +207,87 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkVBox" id="vbox5">
+ <object class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="spacing">6</property>
+ <property name="n_rows">6</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkHBox" id="crop_p1_hbox">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="crop_p2_hbox">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="crop_p1_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">P1</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="crop_p2_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">P2</property>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="crop_grid_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Grid</property>
+ </object>
+ <packing>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="crop_grid_hbox">
+ <property name="visible">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ </packing>
+ </child>
<child>
<object class="GtkCheckButton" id="enable_guided_crop">
<property name="label" translatable="yes">Enable guided crop</property>
@@ -203,7 +298,7 @@
<property name="draw_indicator">True</property>
</object>
<packing>
- <property name="position">0</property>
+ <property name="right_attach">2</property>
</packing>
</child>
<child>
@@ -216,90 +311,9 @@
<property name="draw_indicator">True</property>
</object>
<packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">6</property>
- <property name="row_spacing">6</property>
- <child>
- <object class="GtkHBox" id="crop_p1_hbox">
- <property name="visible">True</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="crop_p2_hbox">
- <property name="visible">True</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="crop_p1_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">P1</property>
- </object>
- <packing>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="crop_p2_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">P2</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="crop_grid_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Grid</property>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="crop_grid_hbox">
- <property name="visible">True</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">2</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
</packing>
</child>
<child>
@@ -351,7 +365,9 @@
</child>
</object>
<packing>
- <property name="position">3</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
</packing>
</child>
</object>
diff --git a/extensions/file_tools/gth-file-tool-rotate.c b/extensions/file_tools/gth-file-tool-rotate.c
index b049203..8fd9399 100644
--- a/extensions/file_tools/gth-file-tool-rotate.c
+++ b/extensions/file_tools/gth-file-tool-rotate.c
@@ -283,6 +283,14 @@ gth_file_tool_rotate_update_sensitivity (GthFileTool *base)
static void
+reset_button_clicked_cb (GtkButton *button,
+ GthFileToolRotate *self)
+{
+ gtk_adjustment_set_value (self->priv->rotation_angle_adj, 0.0);
+}
+
+
+static void
align_h_button_clicked_cb (GtkButton *button,
GthFileToolRotate *self)
{
@@ -554,6 +562,10 @@ gth_file_tool_rotate_get_options (GthFileTool *base)
"clicked",
G_CALLBACK (cancel_button_clicked_cb),
self);
+ g_signal_connect (GET_WIDGET ("reset_button"),
+ "clicked",
+ G_CALLBACK (reset_button_clicked_cb),
+ self);
g_signal_connect (GET_WIDGET ("align_h_button"),
"clicked",
G_CALLBACK (align_h_button_clicked_cb),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]