[gthumb] toolbox options: use an headerbar to save some vertical space



commit 6650ee0f302fdeca52b8003737e22d866a1c2d00
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon Dec 22 21:29:18 2014 +0100

    toolbox options: use an headerbar to save some vertical space

 .../file_tools/data/ui/adjust-colors-options.ui    |   62 +-----
 .../file_tools/data/ui/adjust-contrast-options.ui  |   57 -----
 extensions/file_tools/data/ui/crop-options.ui      |  245 ++++++++------------
 extensions/file_tools/data/ui/grayscale-options.ui |   57 -----
 extensions/file_tools/data/ui/resize-options.ui    |   62 +-----
 extensions/file_tools/data/ui/rotate-options.ui    |   63 +-----
 extensions/file_tools/data/ui/sharpen-options.ui   |   94 ++------
 .../file_tools/gth-file-tool-adjust-colors.c       |   37 ++--
 .../file_tools/gth-file-tool-adjust-contrast.c     |   32 +--
 extensions/file_tools/gth-file-tool-crop.c         |   63 +++---
 extensions/file_tools/gth-file-tool-grayscale.c    |   32 +--
 extensions/file_tools/gth-file-tool-resize.c       |   30 +--
 extensions/file_tools/gth-file-tool-rotate.c       |   71 +++---
 extensions/file_tools/gth-file-tool-sharpen.c      |   81 +++----
 .../data/ui/red-eye-removal-options.ui             |   80 +------
 extensions/red_eye_removal/gth-file-tool-red-eye.c |   52 +----
 gthumb/gth-file-tool.c                             |   15 ++
 gthumb/gth-file-tool.h                             |    2 +
 gthumb/gth-toolbox.c                               |   65 +++---
 gthumb/resources/gthumb.css                        |    8 +
 20 files changed, 353 insertions(+), 855 deletions(-)
---
diff --git a/extensions/file_tools/data/ui/adjust-colors-options.ui 
b/extensions/file_tools/data/ui/adjust-colors-options.ui
index 4d0ca6e..e486f3e 100644
--- a/extensions/file_tools/data/ui/adjust-colors-options.ui
+++ b/extensions/file_tools/data/ui/adjust-colors-options.ui
@@ -85,6 +85,9 @@
                 <property name="column_spacing">6</property>
                 <property name="row_spacing">6</property>
                 <child>
+                  <placeholder/>
+                </child>
+                <child>
                   <object class="GtkLabel" id="brightness_label">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -353,9 +356,6 @@
                     <property name="y_options">GTK_FILL</property>
                   </packing>
                 </child>
-                <child>
-                  <placeholder/>
-                </child>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -402,62 +402,6 @@
             <property name="position">0</property>
           </packing>
         </child>
-        <child>
-          <object class="GtkHSeparator" id="hseparator1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkHButtonBox" id="hbuttonbox1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="spacing">12</property>
-            <property name="layout_style">center</property>
-            <child>
-              <object class="GtkButton" id="ok_button">
-                <property name="label">gtk-apply</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="cancel_button">
-                <property name="label">gtk-cancel</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="padding">12</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
       </object>
     </child>
   </object>
diff --git a/extensions/file_tools/data/ui/adjust-contrast-options.ui 
b/extensions/file_tools/data/ui/adjust-contrast-options.ui
index bf34634..226e60f 100644
--- a/extensions/file_tools/data/ui/adjust-contrast-options.ui
+++ b/extensions/file_tools/data/ui/adjust-contrast-options.ui
@@ -38,63 +38,6 @@
             <property name="position">0</property>
           </packing>
         </child>
-        <child>
-          <object class="GtkSeparator" id="separator1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="padding">6</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkButtonBox" id="buttonbox1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="spacing">12</property>
-            <property name="homogeneous">True</property>
-            <property name="layout_style">center</property>
-            <child>
-              <object class="GtkButton" id="ok_button">
-                <property name="label">gtk-ok</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="cancel_button">
-                <property name="label">gtk-cancel</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="padding">6</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
       </object>
     </child>
   </object>
diff --git a/extensions/file_tools/data/ui/crop-options.ui b/extensions/file_tools/data/ui/crop-options.ui
index be5864f..7516302 100644
--- a/extensions/file_tools/data/ui/crop-options.ui
+++ b/extensions/file_tools/data/ui/crop-options.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.0 on Sat Nov  9 20:24:52 2013 -->
+<!-- Generated with glade 3.18.3 -->
 <interface>
-  <!-- interface-requires gtk+ 3.0 -->
+  <requires lib="gtk+" version="3.0"/>
   <object class="GtkAdjustment" id="bind_factor_adjustment">
     <property name="lower">1</property>
     <property name="upper">100000</property>
@@ -24,10 +24,99 @@
     <property name="upper">999999</property>
     <property name="step_increment">1</property>
   </object>
+  <object class="GtkDialog" id="options_dialog">
+    <property name="width_request">300</property>
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Options</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox4">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area4">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="options_close_button">
+                <property name="label">gtk-close</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkGrid" id="grid1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="border_width">5</property>
+            <property name="row_spacing">6</property>
+            <property name="column_spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="grid_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">_Grid:</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHBox" id="grid_type_combobox_box">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkAdjustment" id="ratio_h_adjustment">
+    <property name="upper">999999</property>
+    <property name="step_increment">1</property>
+  </object>
+  <object class="GtkAdjustment" id="ratio_w_adjustment">
+    <property name="upper">999999</property>
+    <property name="step_increment">1</property>
+  </object>
   <object class="GtkAlignment" id="options">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="top_padding">6</property>
     <child>
       <object class="GtkVBox" id="vbox2">
         <property name="visible">True</property>
@@ -539,157 +628,7 @@
             <property name="position">0</property>
           </packing>
         </child>
-        <child>
-          <object class="GtkHSeparator" id="hseparator1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="padding">6</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkHButtonBox" id="hbuttonbox1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="spacing">12</property>
-            <property name="layout_style">center</property>
-            <child>
-              <object class="GtkButton" id="crop_button">
-                <property name="label" translatable="yes">C_rop</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="cancel_button">
-                <property name="label">gtk-cancel</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="padding">6</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-  </object>
-  <object class="GtkDialog" id="options_dialog">
-    <property name="width_request">300</property>
-    <property name="can_focus">False</property>
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes">Options</property>
-    <property name="resizable">False</property>
-    <property name="type_hint">dialog</property>
-    <child internal-child="vbox">
-      <object class="GtkBox" id="dialog-vbox4">
-        <property name="can_focus">False</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area4">
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="options_close_button">
-                <property name="label">gtk-close</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkGrid" id="grid1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="border_width">5</property>
-            <property name="row_spacing">6</property>
-            <property name="column_spacing">6</property>
-            <child>
-              <object class="GtkLabel" id="grid_label">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">_Grid:</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">0</property>
-                <property name="width">1</property>
-                <property name="height">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkHBox" id="grid_type_combobox_box">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="hexpand">True</property>
-                <child>
-                  <placeholder/>
-                </child>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">0</property>
-                <property name="width">1</property>
-                <property name="height">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
       </object>
     </child>
   </object>
-  <object class="GtkAdjustment" id="ratio_h_adjustment">
-    <property name="upper">999999</property>
-    <property name="step_increment">1</property>
-  </object>
-  <object class="GtkAdjustment" id="ratio_w_adjustment">
-    <property name="upper">999999</property>
-    <property name="step_increment">1</property>
-  </object>
 </interface>
diff --git a/extensions/file_tools/data/ui/grayscale-options.ui 
b/extensions/file_tools/data/ui/grayscale-options.ui
index bf34634..226e60f 100644
--- a/extensions/file_tools/data/ui/grayscale-options.ui
+++ b/extensions/file_tools/data/ui/grayscale-options.ui
@@ -38,63 +38,6 @@
             <property name="position">0</property>
           </packing>
         </child>
-        <child>
-          <object class="GtkSeparator" id="separator1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="padding">6</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkButtonBox" id="buttonbox1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="spacing">12</property>
-            <property name="homogeneous">True</property>
-            <property name="layout_style">center</property>
-            <child>
-              <object class="GtkButton" id="ok_button">
-                <property name="label">gtk-ok</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="cancel_button">
-                <property name="label">gtk-cancel</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="padding">6</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
       </object>
     </child>
   </object>
diff --git a/extensions/file_tools/data/ui/resize-options.ui b/extensions/file_tools/data/ui/resize-options.ui
index b0cc4e1..5509612 100644
--- a/extensions/file_tools/data/ui/resize-options.ui
+++ b/extensions/file_tools/data/ui/resize-options.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.0 on Sat Nov  9 20:27:20 2013 -->
+<!-- Generated with glade 3.18.3 -->
 <interface>
-  <!-- interface-requires gtk+ 3.0 -->
+  <requires lib="gtk+" version="3.0"/>
   <object class="GtkDialog" id="options_dialog">
     <property name="width_request">300</property>
     <property name="can_focus">False</property>
@@ -113,7 +113,6 @@
   <object class="GtkAlignment" id="options">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="top_padding">6</property>
     <child>
       <object class="GtkVBox" id="vbox2">
         <property name="visible">True</property>
@@ -669,63 +668,6 @@
             <property name="position">2</property>
           </packing>
         </child>
-        <child>
-          <object class="GtkHSeparator" id="hseparator1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="padding">6</property>
-            <property name="position">3</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkHButtonBox" id="hbuttonbox1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="spacing">12</property>
-            <property name="layout_style">center</property>
-            <child>
-              <object class="GtkButton" id="resize_button">
-                <property name="label">gtk-ok</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="cancel_button">
-                <property name="label">gtk-cancel</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="padding">6</property>
-            <property name="position">4</property>
-          </packing>
-        </child>
       </object>
     </child>
   </object>
diff --git a/extensions/file_tools/data/ui/rotate-options.ui b/extensions/file_tools/data/ui/rotate-options.ui
index 19ee5a3..77a48e9 100644
--- a/extensions/file_tools/data/ui/rotate-options.ui
+++ b/extensions/file_tools/data/ui/rotate-options.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.0 on Sat Oct 12 13:47:20 2013 -->
+<!-- Generated with glade 3.18.3 -->
 <interface>
-  <!-- interface-requires gtk+ 3.0 -->
+  <requires lib="gtk+" version="3.0"/>
   <object class="GtkDialog" id="options_dialog">
     <property name="width_request">300</property>
     <property name="can_focus">False</property>
@@ -198,7 +198,6 @@
       <object class="GtkAlignment" id="rotation_options">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="top_padding">6</property>
         <child>
           <object class="GtkVBox" id="vbox2">
             <property name="visible">True</property>
@@ -542,64 +541,6 @@
                 <property name="position">0</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkHSeparator" id="hseparator1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="padding">6</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkHButtonBox" id="hbuttonbox1">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="spacing">12</property>
-                <property name="layout_style">center</property>
-                <child>
-                  <object class="GtkButton" id="apply_button">
-                    <property name="label">gtk-apply</property>
-                    <property name="use_action_appearance">False</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
-                    <property name="use_underline">True</property>
-                    <property name="use_stock">True</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkButton" id="cancel_button">
-                    <property name="label">gtk-cancel</property>
-                    <property name="use_action_appearance">False</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
-                    <property name="use_stock">True</property>
-                    <property name="xalign">0.47999998927116394</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="padding">6</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
           </object>
         </child>
       </object>
diff --git a/extensions/file_tools/data/ui/sharpen-options.ui 
b/extensions/file_tools/data/ui/sharpen-options.ui
index 1a634f7..ef2f87e 100644
--- a/extensions/file_tools/data/ui/sharpen-options.ui
+++ b/extensions/file_tools/data/ui/sharpen-options.ui
@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.0 on Sat Oct 12 13:11:35 2013 -->
+<!-- Generated with glade 3.18.3 -->
 <interface>
-  <!-- interface-requires gtk+ 3.0 -->
+  <requires lib="gtk+" version="3.0"/>
   <object class="GtkAlignment" id="options">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="top_padding">6</property>
     <child>
       <object class="GtkVBox" id="vbox2">
         <property name="visible">True</property>
@@ -27,8 +26,23 @@
                     <property name="can_focus">False</property>
                     <property name="orientation">vertical</property>
                     <child>
+                      <object class="GtkHBox" id="preview_hbox">
+                        <property name="height_request">190</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <placeholder/>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
                       <object class="GtkCheckButton" id="preview_checkbutton">
-                        <property name="label" translatable="yes">_Preview:</property>
+                        <property name="label" translatable="yes">_Preview</property>
                         <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
@@ -41,21 +55,6 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkHBox" id="preview_hbox">
-                        <property name="height_request">190</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <child>
-                          <placeholder/>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
@@ -220,63 +219,6 @@
             <property name="position">0</property>
           </packing>
         </child>
-        <child>
-          <object class="GtkHSeparator" id="hseparator1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="padding">6</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkHButtonBox" id="hbuttonbox1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="spacing">12</property>
-            <property name="layout_style">center</property>
-            <child>
-              <object class="GtkButton" id="ok_button">
-                <property name="label">gtk-apply</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="cancel_button">
-                <property name="label">gtk-cancel</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="padding">6</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
       </object>
     </child>
   </object>
diff --git a/extensions/file_tools/gth-file-tool-adjust-colors.c 
b/extensions/file_tools/gth-file-tool-adjust-colors.c
index a93d922..8b0d42f 100644
--- a/extensions/file_tools/gth-file-tool-adjust-colors.c
+++ b/extensions/file_tools/gth-file-tool-adjust-colors.c
@@ -231,20 +231,6 @@ adjust_data_free (gpointer user_data)
 }
 
 
-static void apply_changes (GthFileToolAdjustColors *self);
-
-
-static void
-ok_button_clicked_cb (GtkButton *button,
-                     gpointer   user_data)
-{
-       GthFileToolAdjustColors *self = user_data;
-
-       self->priv->apply_to_original = TRUE;
-       apply_changes (self);
-}
-
-
 static void
 reset_button_clicked_cb (GtkButton *button,
                         gpointer   user_data)
@@ -261,6 +247,9 @@ reset_button_clicked_cb (GtkButton *button,
 }
 
 
+static void apply_changes (GthFileToolAdjustColors *self);
+
+
 static void
 image_task_completed_cb (GthTask  *task,
                         GError   *error,
@@ -477,14 +466,6 @@ gth_file_tool_adjust_colors_get_options (GthFileTool *base)
                                                                   GTH_COLOR_SCALE_YELLOW_BLUE,
                                                                   0.0, -99.0, 99.0, 1.0, 1.0, "%+.0f");
 
-       g_signal_connect (GET_WIDGET ("ok_button"),
-                         "clicked",
-                         G_CALLBACK (ok_button_clicked_cb),
-                         self);
-       g_signal_connect_swapped (GET_WIDGET ("cancel_button"),
-                                 "clicked",
-                                 G_CALLBACK (gth_file_tool_cancel),
-                                 self);
        g_signal_connect (GET_WIDGET ("reset_button"),
                          "clicked",
                          G_CALLBACK (reset_button_clicked_cb),
@@ -555,6 +536,17 @@ gth_file_tool_adjust_colors_destroy_options (GthFileTool *base)
 
 
 static void
+gth_file_tool_adjust_colors_apply_options (GthFileTool *base)
+{
+       GthFileToolAdjustColors *self;
+
+       self = (GthFileToolAdjustColors *) base;
+       self->priv->apply_to_original = TRUE;
+       apply_changes (self);
+}
+
+
+static void
 gth_file_tool_sharpen_reset_image (GthImageViewerPageTool *base)
 {
        GthFileToolAdjustColors *self = (GthFileToolAdjustColors *) base;
@@ -624,6 +616,7 @@ gth_file_tool_adjust_colors_class_init (GthFileToolAdjustColorsClass *klass)
        file_tool_class = (GthFileToolClass *) klass;
        file_tool_class->get_options = gth_file_tool_adjust_colors_get_options;
        file_tool_class->destroy_options = gth_file_tool_adjust_colors_destroy_options;
+       file_tool_class->apply_options = gth_file_tool_adjust_colors_apply_options;
 
        image_viewer_page_tool_class = (GthImageViewerPageToolClass *) klass;
        image_viewer_page_tool_class->reset_image = gth_file_tool_sharpen_reset_image;
diff --git a/extensions/file_tools/gth-file-tool-adjust-contrast.c 
b/extensions/file_tools/gth-file-tool-adjust-contrast.c
index 94e7e6e..afd7f06 100644
--- a/extensions/file_tools/gth-file-tool-adjust-contrast.c
+++ b/extensions/file_tools/gth-file-tool-adjust-contrast.c
@@ -460,17 +460,6 @@ gth_file_tool_adjust_contrast_reset_image (GthImageViewerPageTool *base)
 
 
 static void
-ok_button_clicked_cb (GtkButton *button,
-                     gpointer   user_data)
-{
-       GthFileToolAdjustContrast *self = user_data;
-
-       self->priv->apply_to_original = TRUE;
-       apply_changes (self);
-}
-
-
-static void
 filter_grid_activated_cb (GthFilterGrid        *filter_grid,
                          int            filter_id,
                          gpointer       user_data)
@@ -548,15 +537,6 @@ gth_file_tool_adjust_contrast_get_options (GthFileTool *base)
        gtk_widget_show (filter_grid);
        gtk_box_pack_start (GTK_BOX (GET_WIDGET ("filter_grid_box")), filter_grid, TRUE, FALSE, 0);
 
-       g_signal_connect (GET_WIDGET ("ok_button"),
-                         "clicked",
-                         G_CALLBACK (ok_button_clicked_cb),
-                         self);
-       g_signal_connect_swapped (GET_WIDGET ("cancel_button"),
-                                 "clicked",
-                                 G_CALLBACK (gth_file_tool_cancel),
-                                 self);
-
        self->priv->preview_tool = gth_preview_tool_new ();
        gth_preview_tool_set_image (GTH_PREVIEW_TOOL (self->priv->preview_tool), self->priv->preview);
        gth_image_viewer_set_tool (GTH_IMAGE_VIEWER (viewer), self->priv->preview_tool);
@@ -605,6 +585,17 @@ gth_file_tool_adjust_contrast_destroy_options (GthFileTool *base)
 
 
 static void
+gth_file_tool_adjust_contrast_apply_options (GthFileTool *base)
+{
+       GthFileToolAdjustContrast *self;
+
+       self = (GthFileToolAdjustContrast *) base;
+       self->priv->apply_to_original = TRUE;
+       apply_changes (self);
+}
+
+
+static void
 gth_file_tool_adjust_contrast_finalize (GObject *object)
 {
        GthFileToolAdjustContrast *self;
@@ -637,6 +628,7 @@ gth_file_tool_adjust_contrast_class_init (GthFileToolAdjustContrastClass *klass)
        file_tool_class = GTH_FILE_TOOL_CLASS (klass);
        file_tool_class->get_options = gth_file_tool_adjust_contrast_get_options;
        file_tool_class->destroy_options = gth_file_tool_adjust_contrast_destroy_options;
+       file_tool_class->apply_options = gth_file_tool_adjust_contrast_apply_options;
 
        image_viewer_page_tool_class = (GthImageViewerPageToolClass *) klass;
        image_viewer_page_tool_class->reset_image = gth_file_tool_adjust_contrast_reset_image;
diff --git a/extensions/file_tools/gth-file-tool-crop.c b/extensions/file_tools/gth-file-tool-crop.c
index dc2bec5..977a847 100644
--- a/extensions/file_tools/gth-file-tool-crop.c
+++ b/extensions/file_tools/gth-file-tool-crop.c
@@ -108,32 +108,6 @@ image_task_completed_cb (GthTask  *task,
 
 
 static void
-crop_button_clicked_cb (GtkButton       *button,
-                       GthFileToolCrop *self)
-{
-       cairo_rectangle_int_t  selection;
-       GthTask               *task;
-
-       gth_image_selector_get_selection (self->priv->selector, &selection);
-       if ((selection.width == 0) || (selection.height == 0))
-               return;
-
-       task = gth_image_task_new (_("Applying changes"),
-                                  NULL,
-                                  crop_exec,
-                                  NULL,
-                                  self,
-                                  NULL);
-       gth_image_task_set_source_surface (GTH_IMAGE_TASK (task), gth_image_viewer_page_tool_get_source 
(GTH_IMAGE_VIEWER_PAGE_TOOL (self)));
-       g_signal_connect (task,
-                         "completed",
-                         G_CALLBACK (image_task_completed_cb),
-                         self);
-       gth_browser_exec_task (GTH_BROWSER (gth_file_tool_get_window (GTH_FILE_TOOL (self))), task, FALSE);
-}
-
-
-static void
 selection_x_value_changed_cb (GtkSpinButton   *spin,
                              GthFileToolCrop *self)
 {
@@ -505,14 +479,6 @@ gth_file_tool_crop_get_options (GthFileTool *base)
        gtk_spin_button_set_value (GTK_SPIN_BUTTON (GET_WIDGET ("bind_factor_spinbutton")),
                                   g_settings_get_int (self->priv->settings, PREF_CROP_BIND_FACTOR));
 
-       g_signal_connect (GET_WIDGET ("crop_button"),
-                         "clicked",
-                         G_CALLBACK (crop_button_clicked_cb),
-                         self);
-       g_signal_connect_swapped (GET_WIDGET ("cancel_button"),
-                                 "clicked",
-                                 G_CALLBACK (gth_file_tool_cancel),
-                                 self);
        g_signal_connect (GET_WIDGET ("options_button"),
                          "clicked",
                          G_CALLBACK (options_button_clicked_cb),
@@ -650,6 +616,34 @@ gth_file_tool_crop_destroy_options (GthFileTool *base)
 
 
 static void
+gth_file_tool_crop_apply_options (GthFileTool *base)
+{
+       GthFileToolCrop       *self;
+       cairo_rectangle_int_t  selection;
+       GthTask               *task;
+
+       self = (GthFileToolCrop *) base;
+
+       gth_image_selector_get_selection (self->priv->selector, &selection);
+       if ((selection.width == 0) || (selection.height == 0))
+               return;
+
+       task = gth_image_task_new (_("Applying changes"),
+                                  NULL,
+                                  crop_exec,
+                                  NULL,
+                                  self,
+                                  NULL);
+       gth_image_task_set_source_surface (GTH_IMAGE_TASK (task), gth_image_viewer_page_tool_get_source 
(GTH_IMAGE_VIEWER_PAGE_TOOL (self)));
+       g_signal_connect (task,
+                         "completed",
+                         G_CALLBACK (image_task_completed_cb),
+                         self);
+       gth_browser_exec_task (GTH_BROWSER (gth_file_tool_get_window (GTH_FILE_TOOL (self))), task, FALSE);
+}
+
+
+static void
 gth_file_tool_crop_reset_image (GthImageViewerPageTool *base)
 {
        GthFileToolCrop *self = (GthFileToolCrop *) base;
@@ -702,6 +696,7 @@ gth_file_tool_crop_class_init (GthFileToolCropClass *klass)
        file_tool_class = (GthFileToolClass *) klass;
        file_tool_class->get_options = gth_file_tool_crop_get_options;
        file_tool_class->destroy_options = gth_file_tool_crop_destroy_options;
+       file_tool_class->apply_options = gth_file_tool_crop_apply_options;
 
        image_viewer_page_tool_class = (GthImageViewerPageToolClass *) klass;
        image_viewer_page_tool_class->reset_image = gth_file_tool_crop_reset_image;
diff --git a/extensions/file_tools/gth-file-tool-grayscale.c b/extensions/file_tools/gth-file-tool-grayscale.c
index 2f2d066..6ebb798 100644
--- a/extensions/file_tools/gth-file-tool-grayscale.c
+++ b/extensions/file_tools/gth-file-tool-grayscale.c
@@ -299,17 +299,6 @@ gth_file_tool_grayscale_reset_image (GthImageViewerPageTool *base)
 
 
 static void
-ok_button_clicked_cb (GtkButton *button,
-                     gpointer   user_data)
-{
-       GthFileToolGrayscale *self = user_data;
-
-       self->priv->apply_to_original = TRUE;
-       apply_changes (self);
-}
-
-
-static void
 filter_grid_activated_cb (GthFilterGrid        *filter_grid,
                          int            filter_id,
                          gpointer       user_data)
@@ -387,15 +376,6 @@ gth_file_tool_grayscale_get_options (GthFileTool *base)
        gtk_widget_show (filter_grid);
        gtk_box_pack_start (GTK_BOX (GET_WIDGET ("filter_grid_box")), filter_grid, TRUE, FALSE, 0);
 
-       g_signal_connect (GET_WIDGET ("ok_button"),
-                         "clicked",
-                         G_CALLBACK (ok_button_clicked_cb),
-                         self);
-       g_signal_connect_swapped (GET_WIDGET ("cancel_button"),
-                                 "clicked",
-                                 G_CALLBACK (gth_file_tool_cancel),
-                                 self);
-
        self->priv->preview_tool = gth_preview_tool_new ();
        gth_preview_tool_set_image (GTH_PREVIEW_TOOL (self->priv->preview_tool), self->priv->preview);
        gth_image_viewer_set_tool (GTH_IMAGE_VIEWER (viewer), self->priv->preview_tool);
@@ -444,6 +424,17 @@ gth_file_tool_grayscale_destroy_options (GthFileTool *base)
 
 
 static void
+gth_file_tool_grayscale_apply_options(GthFileTool *base)
+{
+       GthFileToolGrayscale *self;
+
+       self = (GthFileToolGrayscale *) base;
+       self->priv->apply_to_original = TRUE;
+       apply_changes (self);
+}
+
+
+static void
 gth_file_tool_grayscale_finalize (GObject *object)
 {
        GthFileToolGrayscale *self;
@@ -476,6 +467,7 @@ gth_file_tool_grayscale_class_init (GthFileToolGrayscaleClass *klass)
        file_tool_class = GTH_FILE_TOOL_CLASS (klass);
        file_tool_class->get_options = gth_file_tool_grayscale_get_options;
        file_tool_class->destroy_options = gth_file_tool_grayscale_destroy_options;
+       file_tool_class->apply_options = gth_file_tool_grayscale_apply_options;
 
        image_viewer_page_tool_class = (GthImageViewerPageToolClass *) klass;
        image_viewer_page_tool_class->reset_image = gth_file_tool_grayscale_reset_image;
diff --git a/extensions/file_tools/gth-file-tool-resize.c b/extensions/file_tools/gth-file-tool-resize.c
index 435fdc2..b310ca2 100644
--- a/extensions/file_tools/gth-file-tool-resize.c
+++ b/extensions/file_tools/gth-file-tool-resize.c
@@ -63,15 +63,6 @@ static void update_image_size (GthFileToolResize *self);
 
 
 static void
-resize_button_clicked_cb (GtkButton       *button,
-                       GthFileToolResize *self)
-{
-       self->priv->apply_to_original = TRUE;
-       update_image_size (self);
-}
-
-
-static void
 update_dimensione_info_label (GthFileToolResize *self,
                              const char        *id,
                              double             x,
@@ -618,14 +609,6 @@ gth_file_tool_resize_get_options (GthFileTool *base)
        gtk_spin_button_set_value (GTK_SPIN_BUTTON (GET_WIDGET ("ratio_h_spinbutton")),
                                   MAX (g_settings_get_int (self->priv->settings, 
PREF_RESIZE_ASPECT_RATIO_HEIGHT), 1));
 
-       g_signal_connect (GET_WIDGET ("resize_button"),
-                         "clicked",
-                         G_CALLBACK (resize_button_clicked_cb),
-                         self);
-       g_signal_connect_swapped (GET_WIDGET ("cancel_button"),
-                                 "clicked",
-                                 G_CALLBACK (gth_file_tool_cancel),
-                                 self);
        g_signal_connect (GET_WIDGET ("options_button"),
                          "clicked",
                          G_CALLBACK (options_button_clicked_cb),
@@ -742,6 +725,18 @@ gth_file_tool_resize_destroy_options (GthFileTool *base)
 
 
 static void
+gth_file_tool_resize_apply_options (GthFileTool *base)
+{
+       GthFileToolResize *self;
+
+       self = (GthFileToolResize *) base;
+
+       self->priv->apply_to_original = TRUE;
+       update_image_size (self);
+}
+
+
+static void
 gth_file_tool_resize_reset_image (GthImageViewerPageTool *base)
 {
        GthFileToolResize *self = (GthFileToolResize *) base;
@@ -797,6 +792,7 @@ gth_file_tool_resize_class_init (GthFileToolResizeClass *klass)
        file_tool_class = (GthFileToolClass *) klass;
        file_tool_class->get_options = gth_file_tool_resize_get_options;
        file_tool_class->destroy_options = gth_file_tool_resize_destroy_options;
+       file_tool_class->apply_options = gth_file_tool_resize_apply_options;
 
        image_viewer_page_tool_class = (GthImageViewerPageToolClass *) klass;
        image_viewer_page_tool_class->reset_image = gth_file_tool_resize_reset_image;
diff --git a/extensions/file_tools/gth-file-tool-rotate.c b/extensions/file_tools/gth-file-tool-rotate.c
index 4df5786..76c2d1a 100644
--- a/extensions/file_tools/gth-file-tool-rotate.c
+++ b/extensions/file_tools/gth-file-tool-rotate.c
@@ -249,36 +249,6 @@ rotate_exec (GthAsyncTask *task,
 
 
 static void
-apply_button_clicked_cb (GtkButton         *button,
-                        GthFileToolRotate *self)
-{
-       GtkWidget   *window;
-       GtkWidget   *viewer_page;
-       GthTask     *task;
-
-       window = gth_file_tool_get_window (GTH_FILE_TOOL (self));
-       viewer_page = gth_browser_get_viewer_page (GTH_BROWSER (window));
-       task = gth_image_viewer_task_new (GTH_IMAGE_VIEWER_PAGE (viewer_page),
-                                         _("Applying changes"),
-                                         NULL,
-                                         rotate_exec,
-                                         NULL,
-                                         g_object_ref (self->priv->rotator),
-                                         g_object_unref);
-       gth_image_viewer_task_set_load_original (GTH_IMAGE_VIEWER_TASK (task), FALSE);
-       gth_image_task_set_source_surface (GTH_IMAGE_TASK (task), gth_image_viewer_page_tool_get_source 
(GTH_IMAGE_VIEWER_PAGE_TOOL (self)));
-
-       g_signal_connect (task,
-                         "completed",
-                         G_CALLBACK (gth_image_viewer_task_set_destination),
-                         NULL);
-       gth_browser_exec_task (GTH_BROWSER (window), task, FALSE);
-
-       gth_file_tool_hide_options (GTH_FILE_TOOL (self));
-}
-
-
-static void
 crop_settings_changed_cb (GtkAdjustment     *adj,
                          GthFileToolRotate *self)
 {
@@ -481,14 +451,6 @@ gth_file_tool_rotate_get_options (GthFileTool *base)
        self->priv->crop_region.width = cairo_image_surface_get_width (self->priv->image);
        self->priv->crop_region.height = cairo_image_surface_get_height (self->priv->image);
 
-       g_signal_connect (GET_WIDGET ("apply_button"),
-                         "clicked",
-                         G_CALLBACK (apply_button_clicked_cb),
-                         self);
-       g_signal_connect_swapped (GET_WIDGET ("cancel_button"),
-                                 "clicked",
-                                 G_CALLBACK (gth_file_tool_cancel),
-                                 self);
        g_signal_connect (GET_WIDGET ("reset_button"),
                          "clicked",
                          G_CALLBACK (reset_button_clicked_cb),
@@ -606,6 +568,38 @@ gth_file_tool_rotate_destroy_options (GthFileTool *base)
 
 
 static void
+gth_file_tool_rotate_apply_options (GthFileTool *base)
+{
+       GthFileToolRotate *self;
+       GtkWidget         *window;
+       GtkWidget         *viewer_page;
+       GthTask           *task;
+
+       self = (GthFileToolRotate *) base;
+
+       window = gth_file_tool_get_window (GTH_FILE_TOOL (self));
+       viewer_page = gth_browser_get_viewer_page (GTH_BROWSER (window));
+       task = gth_image_viewer_task_new (GTH_IMAGE_VIEWER_PAGE (viewer_page),
+                                         _("Applying changes"),
+                                         NULL,
+                                         rotate_exec,
+                                         NULL,
+                                         g_object_ref (self->priv->rotator),
+                                         g_object_unref);
+       gth_image_viewer_task_set_load_original (GTH_IMAGE_VIEWER_TASK (task), FALSE);
+       gth_image_task_set_source_surface (GTH_IMAGE_TASK (task), gth_image_viewer_page_tool_get_source 
(GTH_IMAGE_VIEWER_PAGE_TOOL (self)));
+
+       g_signal_connect (task,
+                         "completed",
+                         G_CALLBACK (gth_image_viewer_task_set_destination),
+                         NULL);
+       gth_browser_exec_task (GTH_BROWSER (window), task, FALSE);
+
+       gth_file_tool_hide_options (GTH_FILE_TOOL (self));
+}
+
+
+static void
 gth_file_tool_rotate_reset_image (GthImageViewerPageTool *self)
 {
        gth_image_viewer_page_reset (GTH_IMAGE_VIEWER_PAGE (gth_image_viewer_page_tool_get_page 
(GTH_IMAGE_VIEWER_PAGE_TOOL (self))));
@@ -647,6 +641,7 @@ gth_file_tool_rotate_class_init (GthFileToolRotateClass *klass)
        file_tool_class = (GthFileToolClass *) klass;
        file_tool_class->get_options = gth_file_tool_rotate_get_options;
        file_tool_class->destroy_options = gth_file_tool_rotate_destroy_options;
+       file_tool_class->apply_options = gth_file_tool_rotate_apply_options;
 
        image_viewer_page_tool_class = (GthImageViewerPageToolClass *) klass;
        image_viewer_page_tool_class->reset_image = gth_file_tool_rotate_reset_image;
diff --git a/extensions/file_tools/gth-file-tool-sharpen.c b/extensions/file_tools/gth-file-tool-sharpen.c
index 7a304a7..bbe94c8 100644
--- a/extensions/file_tools/gth-file-tool-sharpen.c
+++ b/extensions/file_tools/gth-file-tool-sharpen.c
@@ -101,41 +101,6 @@ sharpen_exec (GthAsyncTask *task,
 
 
 static void
-ok_button_clicked_cb (GtkButton          *button,
-                     GthFileToolSharpen *self)
-{
-       GtkWidget   *viewer_page;
-       SharpenData *sharpen_data;
-       GthTask     *task;
-
-       if (self->priv->apply_event != 0) {
-               g_source_remove (self->priv->apply_event);
-               self->priv->apply_event = 0;
-       }
-
-       viewer_page = gth_image_viewer_page_tool_get_page (GTH_IMAGE_VIEWER_PAGE_TOOL (self));
-       if (viewer_page == NULL)
-               return;
-
-       sharpen_data = sharpen_data_new (self);
-       task = gth_image_viewer_task_new (GTH_IMAGE_VIEWER_PAGE (viewer_page),
-                                         _("Sharpening image"),
-                                         NULL,
-                                         sharpen_exec,
-                                         NULL,
-                                         sharpen_data,
-                                         sharpen_data_free);
-       g_signal_connect (task,
-                         "completed",
-                         G_CALLBACK (gth_image_viewer_task_set_destination),
-                         NULL);
-       gth_browser_exec_task (GTH_BROWSER (gth_file_tool_get_window (GTH_FILE_TOOL (self))), task, FALSE);
-
-       gth_file_tool_hide_options (GTH_FILE_TOOL (self));
-}
-
-
-static void
 reset_button_clicked_cb (GtkButton          *button,
                         GthFileToolSharpen *self)
 {
@@ -299,14 +264,6 @@ gth_file_tool_sharpen_get_options (GthFileTool *base)
                                                               GTH_COLOR_SCALE_DEFAULT,
                                                               DEFAULT_THRESHOLD, 0.0, 255.0, 1.0, 1.0, 
"%.0f");
 
-       g_signal_connect (GET_WIDGET ("ok_button"),
-                         "clicked",
-                         G_CALLBACK (ok_button_clicked_cb),
-                         self);
-       g_signal_connect_swapped (GET_WIDGET ("cancel_button"),
-                                 "clicked",
-                                 G_CALLBACK (gth_file_tool_cancel),
-                                 self);
        g_signal_connect (GET_WIDGET ("reset_button"),
                          "clicked",
                          G_CALLBACK (reset_button_clicked_cb),
@@ -364,6 +321,43 @@ gth_file_tool_sharpen_destroy_options (GthFileTool *base)
 
 
 static void
+gth_file_tool_sharpen_apply_options (GthFileTool *base)
+{
+       GthFileToolSharpen *self;
+       GtkWidget          *viewer_page;
+       SharpenData        *sharpen_data;
+       GthTask            *task;
+
+       self = (GthFileToolSharpen *) base;
+
+       if (self->priv->apply_event != 0) {
+               g_source_remove (self->priv->apply_event);
+               self->priv->apply_event = 0;
+       }
+
+       viewer_page = gth_image_viewer_page_tool_get_page (GTH_IMAGE_VIEWER_PAGE_TOOL (self));
+       if (viewer_page == NULL)
+               return;
+
+       sharpen_data = sharpen_data_new (self);
+       task = gth_image_viewer_task_new (GTH_IMAGE_VIEWER_PAGE (viewer_page),
+                                         _("Sharpening image"),
+                                         NULL,
+                                         sharpen_exec,
+                                         NULL,
+                                         sharpen_data,
+                                         sharpen_data_free);
+       g_signal_connect (task,
+                         "completed",
+                         G_CALLBACK (gth_image_viewer_task_set_destination),
+                         NULL);
+       gth_browser_exec_task (GTH_BROWSER (gth_file_tool_get_window (GTH_FILE_TOOL (self))), task, FALSE);
+
+       gth_file_tool_hide_options (GTH_FILE_TOOL (self));
+}
+
+
+static void
 gth_file_tool_sharpen_reset_image (GthImageViewerPageTool *base)
 {
        GthFileToolSharpen *self = (GthFileToolSharpen *) base;
@@ -408,6 +402,7 @@ gth_file_tool_sharpen_class_init (GthFileToolSharpenClass *klass)
        file_tool_class = (GthFileToolClass *) klass;
        file_tool_class->get_options = gth_file_tool_sharpen_get_options;
        file_tool_class->destroy_options = gth_file_tool_sharpen_destroy_options;
+       file_tool_class->apply_options = gth_file_tool_sharpen_apply_options;
 
        image_viewer_page_tool_class = (GthImageViewerPageToolClass *) klass;
        image_viewer_page_tool_class->reset_image = gth_file_tool_sharpen_reset_image;
diff --git a/extensions/red_eye_removal/data/ui/red-eye-removal-options.ui 
b/extensions/red_eye_removal/data/ui/red-eye-removal-options.ui
index 94774aa..cefeaf8 100644
--- a/extensions/red_eye_removal/data/ui/red-eye-removal-options.ui
+++ b/extensions/red_eye_removal/data/ui/red-eye-removal-options.ui
@@ -1,10 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
 <interface>
-  <!-- interface-requires gtk+ 3.0 -->
+  <requires lib="gtk+" version="3.0"/>
+  <object class="GtkAdjustment" id="x_adjustment">
+    <property name="upper">10000</property>
+    <property name="step_increment">1</property>
+  </object>
+  <object class="GtkAdjustment" id="y_adjustment">
+    <property name="upper">10000</property>
+    <property name="step_increment">1</property>
+  </object>
   <object class="GtkAlignment" id="options">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="top_padding">6</property>
     <child>
       <object class="GtkVBox" id="vbox2">
         <property name="visible">True</property>
@@ -84,7 +92,6 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="invisible_char">●</property>
-                            <property name="invisible_char_set">True</property>
                             <property name="adjustment">x_adjustment</property>
                             <property name="climb_rate">1</property>
                           </object>
@@ -111,7 +118,6 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="invisible_char">●</property>
-                            <property name="invisible_char_set">True</property>
                             <property name="adjustment">y_adjustment</property>
                             <property name="climb_rate">1</property>
                           </object>
@@ -152,73 +158,7 @@
             <property name="position">0</property>
           </packing>
         </child>
-        <child>
-          <object class="GtkHSeparator" id="hseparator1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="padding">6</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkHButtonBox" id="hbuttonbox1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="spacing">12</property>
-            <property name="layout_style">center</property>
-            <child>
-              <object class="GtkButton" id="ok_button">
-                <property name="label">gtk-ok</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="cancel_button">
-                <property name="label">gtk-cancel</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="padding">6</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
       </object>
     </child>
   </object>
-  <object class="GtkAdjustment" id="x_adjustment">
-    <property name="upper">10000</property>
-    <property name="step_increment">1</property>
-  </object>
-  <object class="GtkAdjustment" id="y_adjustment">
-    <property name="upper">10000</property>
-    <property name="step_increment">1</property>
-  </object>
 </interface>
diff --git a/extensions/red_eye_removal/gth-file-tool-red-eye.c 
b/extensions/red_eye_removal/gth-file-tool-red-eye.c
index fdd5aed..27152dc 100644
--- a/extensions/red_eye_removal/gth-file-tool-red-eye.c
+++ b/extensions/red_eye_removal/gth-file-tool-red-eye.c
@@ -47,25 +47,6 @@ struct _GthFileToolRedEyePrivate {
 G_DEFINE_TYPE (GthFileToolRedEye, gth_file_tool_red_eye, GTH_TYPE_IMAGE_VIEWER_PAGE_TOOL)
 
 
-static void
-ok_button_clicked_cb (GtkButton         *button,
-                     GthFileToolRedEye *self)
-{
-       GtkWidget *viewer_page;
-       GtkWidget *viewer;
-
-       if (self->priv->new_pixbuf == NULL)
-               return;
-
-       viewer_page = gth_image_viewer_page_tool_get_page (GTH_IMAGE_VIEWER_PAGE_TOOL (self));
-       viewer = gth_image_viewer_page_get_image_viewer (GTH_IMAGE_VIEWER_PAGE (viewer_page));
-
-       gth_image_viewer_set_zoom_change (GTH_IMAGE_VIEWER (viewer), self->priv->original_zoom_change);
-       gth_image_viewer_page_set_pixbuf (GTH_IMAGE_VIEWER_PAGE (viewer_page), self->priv->new_pixbuf, TRUE);
-       gth_file_tool_hide_options (GTH_FILE_TOOL (self));
-}
-
-
 static int
 find_region (int   row,
             int   col,
@@ -367,14 +348,7 @@ gth_file_tool_red_eye_get_options (GthFileTool *base)
        self->priv->builder = _gtk_builder_new_from_file ("red-eye-removal-options.ui", "red_eye_removal");
        options = _gtk_builder_get_widget (self->priv->builder, "options");
        gtk_widget_show (options);
-       g_signal_connect_swapped (GET_WIDGET ("cancel_button"),
-                                 "clicked",
-                                 G_CALLBACK (gth_file_tool_cancel),
-                                 self);
-       g_signal_connect (GET_WIDGET ("ok_button"),
-                         "clicked",
-                         G_CALLBACK (ok_button_clicked_cb),
-                         self);
+
        viewer = gth_image_viewer_page_get_image_viewer (GTH_IMAGE_VIEWER_PAGE (viewer_page));
        self->priv->original_zoom_change = gth_image_viewer_get_zoom_change (GTH_IMAGE_VIEWER (viewer));
        gth_image_viewer_set_zoom_change (GTH_IMAGE_VIEWER (viewer), GTH_ZOOM_CHANGE_KEEP_PREV);
@@ -417,26 +391,23 @@ gth_file_tool_red_eye_destroy_options (GthFileTool *base)
 
 
 static void
-gth_file_tool_red_eye_activate (GthFileTool *base)
+gth_file_tool_red_eye_apply_options (GthFileTool *base)
 {
-       gth_file_tool_show_options (base);
-}
-
-
-static void
-gth_file_tool_red_eye_cancel (GthFileTool *base)
-{
-       GthFileToolRedEye *self = (GthFileToolRedEye *) base;
-       GtkWidget         *window;
+       GthFileToolRedEye *self;
        GtkWidget         *viewer_page;
        GtkWidget         *viewer;
 
-       window = gth_file_tool_get_window (GTH_FILE_TOOL (self));
-       viewer_page = gth_browser_get_viewer_page (GTH_BROWSER (window));
+       self = (GthFileToolRedEye *) base;
+
+       if (self->priv->new_pixbuf == NULL)
+               return;
+
+       viewer_page = gth_image_viewer_page_tool_get_page (GTH_IMAGE_VIEWER_PAGE_TOOL (self));
        viewer = gth_image_viewer_page_get_image_viewer (GTH_IMAGE_VIEWER_PAGE (viewer_page));
 
        gth_image_viewer_set_zoom_change (GTH_IMAGE_VIEWER (viewer), self->priv->original_zoom_change);
-       gth_image_viewer_page_reset (GTH_IMAGE_VIEWER_PAGE (viewer_page));
+       gth_image_viewer_page_set_pixbuf (GTH_IMAGE_VIEWER_PAGE (viewer_page), self->priv->new_pixbuf, TRUE);
+       gth_file_tool_hide_options (GTH_FILE_TOOL (self));
 }
 
 
@@ -483,6 +454,7 @@ gth_file_tool_red_eye_class_init (GthFileToolRedEyeClass *klass)
        file_tool_class = (GthFileToolClass *) klass;
        file_tool_class->get_options = gth_file_tool_red_eye_get_options;
        file_tool_class->destroy_options = gth_file_tool_red_eye_destroy_options;
+       file_tool_class->apply_options = gth_file_tool_red_eye_apply_options;
 
        image_viewer_page_tool_class = (GthImageViewerPageToolClass *) klass;
        image_viewer_page_tool_class->reset_image = gth_file_tool_red_eye_reset_image;
diff --git a/gthumb/gth-file-tool.c b/gthumb/gth-file-tool.c
index 3d1abfe..2b5f69d 100644
--- a/gthumb/gth-file-tool.c
+++ b/gthumb/gth-file-tool.c
@@ -81,6 +81,13 @@ gth_file_tool_base_destroy_options (GthFileTool *self)
 
 
 static void
+gth_file_tool_base_apply_options (GthFileTool *self)
+{
+       /* void */
+}
+
+
+static void
 gth_file_tool_finalize (GObject *object)
 {
        g_return_if_fail (object != NULL);
@@ -106,6 +113,7 @@ gth_file_tool_class_init (GthFileToolClass *klass)
        klass->cancel = gth_file_tool_base_cancel;
        klass->get_options = gth_file_tool_base_get_options;
        klass->destroy_options = gth_file_tool_base_destroy_options;
+       klass->apply_options = gth_file_tool_base_apply_options;
 
        gth_file_tool_signals[SHOW_OPTIONS] =
                        g_signal_new ("show-options",
@@ -261,3 +269,10 @@ gth_file_tool_destroy_options (GthFileTool *self)
 {
        GTH_FILE_TOOL_GET_CLASS (self)->destroy_options (self);
 }
+
+
+void
+gth_file_tool_apply_options (GthFileTool *self)
+{
+       GTH_FILE_TOOL_GET_CLASS (self)->apply_options (self);
+}
diff --git a/gthumb/gth-file-tool.h b/gthumb/gth-file-tool.h
index 6663237..d30607c 100644
--- a/gthumb/gth-file-tool.h
+++ b/gthumb/gth-file-tool.h
@@ -53,6 +53,7 @@ struct _GthFileToolClass {
        void         (*cancel)             (GthFileTool *self);
        GtkWidget *  (*get_options)        (GthFileTool *self);
        void         (*destroy_options)    (GthFileTool *self);
+       void         (*apply_options)      (GthFileTool *self);
 
        /*< signals >*/
 
@@ -77,6 +78,7 @@ GthToolboxSection     gth_file_tool_get_section               (GthFileTool            
*self);
 void                   gth_file_tool_destroy_options           (GthFileTool            *self);
 void                   gth_file_tool_show_options              (GthFileTool            *self);
 void                   gth_file_tool_hide_options              (GthFileTool            *self);
+void                   gth_file_tool_apply_options             (GthFileTool            *self);
 
 G_END_DECLS
 
diff --git a/gthumb/gth-toolbox.c b/gthumb/gth-toolbox.c
index 436e61d..413fa82 100644
--- a/gthumb/gth-toolbox.c
+++ b/gthumb/gth-toolbox.c
@@ -50,7 +50,6 @@ struct _GthToolboxPrivate {
        char      *name;
        GtkWidget *tool_grid[GTH_TOOLBOX_N_SECTIONS];
        GtkWidget *options;
-       GtkWidget *options_icon;
        GtkWidget *options_title;
        GtkWidget *active_tool;
 };
@@ -149,14 +148,34 @@ static const char * section_title[] = {
 
 
 static void
+close_button_clicked_cb (GtkButton *button,
+                        gpointer   user_data)
+{
+       GthToolbox *toolbox = user_data;
+       if (toolbox->priv->active_tool != NULL)
+               gth_file_tool_cancel (GTH_FILE_TOOL (toolbox->priv->active_tool));
+}
+
+
+static void
+ok_button_clicked_cb (GtkButton *button,
+                     gpointer   user_data)
+{
+       GthToolbox *toolbox = user_data;
+       if (toolbox->priv->active_tool != NULL)
+               gth_file_tool_apply_options (GTH_FILE_TOOL (toolbox->priv->active_tool));
+}
+
+
+static void
 gth_toolbox_init (GthToolbox *toolbox)
 {
        GtkWidget *scrolled;
        int        i;
        GtkWidget *grid_box;
        GtkWidget *options_box;
-       GtkWidget *options_header;
-       GtkWidget *header_sep;
+       GtkWidget *close_button;
+       GtkWidget *ok_button;
 
        toolbox->priv = G_TYPE_INSTANCE_GET_PRIVATE (toolbox, GTH_TYPE_TOOLBOX, GthToolboxPrivate);
 
@@ -210,32 +229,25 @@ gth_toolbox_init (GthToolbox *toolbox)
 
        /* tool options page */
 
-       options_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+       options_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
        gtk_widget_show (options_box);
        gtk_stack_add_named (GTK_STACK (toolbox), options_box, GTH_TOOLBOX_PAGE_OPTIONS);
 
-       options_header = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-       gtk_widget_set_margin_left (options_header, 10);
-       gtk_widget_set_margin_right (options_header, 10);
-       gtk_widget_set_margin_top (options_header, 10);
-       gtk_widget_set_margin_bottom (options_header, 10);
-       gtk_widget_show (options_header);
+       close_button = gtk_button_new_from_icon_name ("go-previous-symbolic", GTK_ICON_SIZE_BUTTON);
+       gtk_widget_show (close_button);
+       g_signal_connect (close_button, "clicked", G_CALLBACK (close_button_clicked_cb), toolbox);
 
-       toolbox->priv->options_icon = gtk_image_new ();
-       gtk_widget_show (toolbox->priv->options_icon);
-       gtk_box_pack_start (GTK_BOX (options_header), toolbox->priv->options_icon, FALSE, FALSE, 0);
+       ok_button = gtk_button_new_from_icon_name ("object-select-symbolic", GTK_ICON_SIZE_BUTTON);
+       gtk_style_context_add_class (gtk_widget_get_style_context (ok_button), 
GTK_STYLE_CLASS_SUGGESTED_ACTION);
+       gtk_widget_show (ok_button);
+       g_signal_connect (ok_button, "clicked", G_CALLBACK (ok_button_clicked_cb), toolbox);
 
-       toolbox->priv->options_title = gtk_label_new ("");
-       gtk_label_set_use_markup (GTK_LABEL (toolbox->priv->options_title), TRUE);
+       toolbox->priv->options_title = gtk_header_bar_new ();
+       /*gtk_style_context_add_class (gtk_widget_get_style_context (toolbox->priv->options_title), 
"inline-headerbar");*/
+       gtk_header_bar_pack_start (GTK_HEADER_BAR (toolbox->priv->options_title), close_button);
+       gtk_header_bar_pack_end (GTK_HEADER_BAR (toolbox->priv->options_title), ok_button);
        gtk_widget_show (toolbox->priv->options_title);
-       gtk_box_pack_start (GTK_BOX (options_header), toolbox->priv->options_title, FALSE, FALSE, 0);
-
-       gtk_widget_show (options_header);
-       gtk_box_pack_start (GTK_BOX (options_box), options_header, FALSE, FALSE, 0);
-
-       header_sep = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
-       gtk_widget_show (header_sep);
-       gtk_box_pack_start (GTK_BOX (options_box), header_sep, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (options_box), toolbox->priv->options_title, FALSE, FALSE, 0);
 
        toolbox->priv->options = gtk_scrolled_window_new (NULL, NULL);
        gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (toolbox->priv->options), GTK_SHADOW_NONE);
@@ -258,7 +270,6 @@ child_show_options_cb (GtkWidget *tool,
 {
        GthToolbox *toolbox = data;
        GtkWidget  *options;
-       char       *markup;
 
        options = gth_file_tool_get_options (GTH_FILE_TOOL (tool));
        if (options == NULL)
@@ -268,12 +279,10 @@ child_show_options_cb (GtkWidget *tool,
 
        _gtk_container_remove_children (GTK_CONTAINER (toolbox->priv->options), NULL, NULL);
 
-       markup = g_markup_printf_escaped ("<span size='large' weight='bold'>%s</span>", 
gth_file_tool_get_options_title (GTH_FILE_TOOL (tool)));
-       gtk_label_set_markup (GTK_LABEL (toolbox->priv->options_title), markup);
-       gtk_image_set_from_icon_name (GTK_IMAGE (toolbox->priv->options_icon), gth_file_tool_get_icon_name 
(GTH_FILE_TOOL (tool)), GTK_ICON_SIZE_MENU);
+       gtk_header_bar_set_title (GTK_HEADER_BAR (toolbox->priv->options_title), 
gth_file_tool_get_options_title (GTH_FILE_TOOL (tool)));
+       /*gtk_image_set_from_icon_name (GTK_IMAGE (toolbox->priv->options_icon), gth_file_tool_get_icon_name 
(GTH_FILE_TOOL (tool)), GTK_ICON_SIZE_MENU);*/
        gtk_container_add (GTK_CONTAINER (toolbox->priv->options), options);
        gtk_stack_set_visible_child_name (GTK_STACK (toolbox), GTH_TOOLBOX_PAGE_OPTIONS);
-       g_free (markup);
 
        g_signal_emit (toolbox, gth_toolbox_signals[OPTIONS_VISIBILITY], 0, TRUE);
 }
diff --git a/gthumb/resources/gthumb.css b/gthumb/resources/gthumb.css
index 220155e..8239445 100644
--- a/gthumb/resources/gthumb.css
+++ b/gthumb/resources/gthumb.css
@@ -137,3 +137,11 @@ GtkButton.filter-preview:checked {
        background-color: @theme_unfocused_selected_bg_color;
        color: @theme_unfocused_selected_fg_color;
 }
+
+/* -- headerbar inside the toolbox -- */
+
+GthToolbox .header-bar {
+       border-radius: 0;
+       box-shadow: none;
+       background-image: none;
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]