[shotwell/wip/dedeprecate: 8/26] De-deprecate crop tool



commit 40f16689e372e38ab19f09298b59c004c69af22c
Author: Jens Georg <mail jensge org>
Date:   Wed Oct 19 21:55:14 2016 +0200

    De-deprecate crop tool
    
    Signed-off-by: Jens Georg <mail jensge org>

 configure.ac                         |    4 ++--
 shotwell.am                          |   10 ++++++++++
 src/editing_tools/EditingTools.vala  |   19 +++++++++++++------
 src/org.gnome.Shotwell.gresource.xml |    6 ++++++
 4 files changed, 31 insertions(+), 8 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c641f72..0279e60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,7 +93,7 @@ PKG_CHECK_MODULES(SHOTWELL, [
                              gstreamer-base-1.0 >= 1.0.0
                              gstreamer-plugins-base-1.0 >= 1.0.0
                              gstreamer-pbutils-1.0 >= 1.0.0
-                             gtk+-3.0 >= 3.12.2
+                             gtk+-3.0 >= 3.14.0
                              gudev-1.0 >= 145
                              libexif >= 0.6.16
                              libgphoto2 >= 2.5.0
@@ -103,7 +103,7 @@ PKG_CHECK_MODULES(SHOTWELL, [
                              sqlite3 >= 3.5.9
                              webkit2gtk-4.0
                             ])
-PKG_CHECK_MODULES(THUMBNAILER, [gee-0.8 >= 0.8.5 gtk+-3.0 >= 3.12.2
+PKG_CHECK_MODULES(THUMBNAILER, [gee-0.8 >= 0.8.5 gtk+-3.0 >= 3.14.0
                                 gstreamer-base-1.0 >= 1.0.0])
 
 PKG_CHECK_MODULES(PLUGIN, [gobject-2.0 glib-2.0 json-glib-1.0 libxml-2.0
diff --git a/shotwell.am b/shotwell.am
index dcade97..d1b64ef 100644
--- a/shotwell.am
+++ b/shotwell.am
@@ -20,6 +20,16 @@ shotwell_VALAFLAGS = $(COMMON_VALAFLAGS) \
        $(UNITY_VALAFLAGS) \
        $(COMMON_VALAFLAGS_POST)
 
+nodist_shotwell_SOURCES = \
+       src/resource.c
+MOSTLYCLEANFILES += src/resource.c
+
+src/resource.c: src/org.gnome.Shotwell.gresource.xml
+       $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ \
+               --sourcedir=$(abs_top_srcdir)/icons \
+               --sourcedir=$(abs_top_srcdir)/ui \
+               --generate $<
+
 shotwell_SOURCES = \
        src/unit/Unit.vala \
        src/util/Util.vala \
diff --git a/src/editing_tools/EditingTools.vala b/src/editing_tools/EditingTools.vala
index b2ba172..29187e7 100644
--- a/src/editing_tools/EditingTools.vala
+++ b/src/editing_tools/EditingTools.vala
@@ -675,8 +675,8 @@ public class CropTool : EditingTool {
             constraint_combo.set_row_separator_func(constraint_combo_separator_func);
             constraint_combo.set_active(0);
 
-            pivot_reticle_button.set_image(new Gtk.Image.from_stock(Resources.CROP_PIVOT_RETICLE,
-                Gtk.IconSize.SMALL_TOOLBAR));
+            var image = new Gtk.Image.from_resource ("/org/gnome/Shotwell/crop-pivot-reticle.png");
+            pivot_reticle_button.set_image (image);
             pivot_reticle_button.set_tooltip_text(_("Pivot the crop rectangle between portrait and landscape 
orientations"));
 
             custom_width_entry.set_width_chars(4);
@@ -1240,8 +1240,13 @@ public class CropTool : EditingTool {
         }
 
         // make sure the cursor isn't set to a modify indicator
-        if (canvas != null)
-            canvas.get_drawing_window().set_cursor(new Gdk.Cursor(Gdk.CursorType.LEFT_PTR));
+        if (canvas != null) {
+            var drawing_window = canvas.get_drawing_window ();
+            var display = drawing_window.get_display ();
+            var cursor = new Gdk.Cursor.for_display (display,
+                                                     Gdk.CursorType.LEFT_PTR);
+            drawing_window.set_cursor (cursor);
+        }
 
         crop_surface = null;
 
@@ -1435,8 +1440,10 @@ public class CropTool : EditingTool {
         }
 
         if (cursor_type != current_cursor_type) {
-            Gdk.Cursor cursor = new Gdk.Cursor(cursor_type);
-            canvas.get_drawing_window().set_cursor(cursor);
+            var drawing_window = canvas.get_drawing_window ();
+            var display = drawing_window.get_display ();
+            var cursor = new Gdk.Cursor.for_display (display, cursor_type);
+            drawing_window.set_cursor (cursor);
             current_cursor_type = cursor_type;
         }
     }
diff --git a/src/org.gnome.Shotwell.gresource.xml b/src/org.gnome.Shotwell.gresource.xml
new file mode 100644
index 0000000..a7e3d8d
--- /dev/null
+++ b/src/org.gnome.Shotwell.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/Shotwell">
+      <file>crop-pivot-reticle.png</file>
+  </gresource>
+</gresources>


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