diff --git a/.gitignore b/.gitignore
index 6bc1d4e..d745815 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ build/*
debian/build/*
debian/debhelper-build-stamp
*debhelper.log
+.flatpak-builder
diff --git a/README.md b/README.md
index b51b783..cb0fda5 100644
--- a/README.md
+++ b/README.md
@@ -6,19 +6,17 @@
-Quickly resize images from the context menu.
+Quickly resize images.
Features:
-- Use from context menu: right click on image(s), and select "Resize images".
-- Use from Applications menu: Drag and drop image(s).
+- Open images with Resizer or open Reizer and Drag and drop images
- Maintains aspect ratio.
- Keyboard control: Change the sizes using the up and down keys, press enter to resize.
- Settings are stored for next time.
-![Screenshot 1](screenshot.png)
-![Screenshot 2](screenshot2.png)
-![Screenshot 3](screenshot3.png)
-![Screenshot 4](screenshot4.png)
-![Screenshot 5](screenshot5.png)
+![Screenshot resize image](screenshot.png)
+![Screenshot without images](screenshot2.png)
+![Screenshot resize multiple images](screenshot3.png)
+![Screenshot error](screenshot4.png)
## Building, Testing, and Installation
@@ -50,5 +48,5 @@ Generate / update `.po` files:
## Credits
-A lot of the code is inspired by the [elementary Screenshot tool](https://github.com/elementary/screenshot-tool) and Felipe Escoto's [wallpaperize](https://github.com/Philip-Scott/wallpaperize).
+A lot of the code is inspired by the [elementary Screenshot tool](https://github.com/elementary/screenshot-tool) and Felipe Escoto's [wallpaperize](https://github.com/Philip-Scott/wallpaperize).
The icon is based on the [elementary Photos icon](https://github.com/elementary/icons/blob/master/apps/128/multimedia-photo-manager.svgs) and was greatly improved by [TraumaD](https://github.com/TraumaD).
diff --git a/com.github.peteruithoven.resizer.yml b/com.github.peteruithoven.resizer.yml
new file mode 100644
index 0000000..e2258f9
--- /dev/null
+++ b/com.github.peteruithoven.resizer.yml
@@ -0,0 +1,55 @@
+# This is the same ID that you've used in meson.build and other files
+app-id: com.github.peteruithoven.resizer
+
+# Instead of manually specifying a long list of build and runtime dependencies,
+# we can use a convenient pre-made runtime and SDK. For this example, we'll be
+# using the runtime and SDK provided by elementary.
+runtime: io.elementary.Platform
+runtime-version: '6'
+sdk: io.elementary.Sdk
+
+# This should match the exec line in your .desktop file and usually is the same
+# as your app ID
+command: com.github.peteruithoven.resizer
+
+# Here we can specify the kinds of permissions our app needs to run. Since we're
+# not using hardware like webcams, making sound, or reading external files, we
+# only need permission to draw our app on screen using either X11 or Wayland.
+finish-args:
+ - '--share=ipc'
+ - '--socket=fallback-x11'
+ - '--socket=wayland'
+ - '--filesystem=home'
+
+# This section is where you list all the source code required to build your app.
+# If we had external dependencies that weren't included in our SDK, we would list
+# them here.
+modules:
+ - name: resizer
+ buildsystem: meson
+ sources:
+ - type: dir
+ path: .
+ # Inspiration: https://github.com/ImageMagick/ImageMagick6/releases/tag/6.9.12-19
+ - name: imagemagick
+ config-opts:
+ - --enable-shared
+ - --disable-static
+ - --with-modules
+ - --with-x
+ - --with-threads
+ - --with-magick_plus_plus
+ - --with-gslib
+ - --with-wmf
+ - --with-webp
+ - --with-openexr
+ - --with-rsvg
+ - --with-xml
+ - --with-jbig
+ - --with-openjp2
+ sources:
+ - type: archive
+ url: https://github.com/ImageMagick/ImageMagick6/archive/6.9.12-19.tar.gz
+ sha256: 2f184f1f5c3e19849347b2b4acb6dd074290903d36fa5924956ee06c85ddf783
+ cleanup:
+ - /share/doc
diff --git a/data/com.github.peteruithoven.resizer.appdata.xml.in b/data/com.github.peteruithoven.resizer.appdata.xml.in
index 1d40fce..3ef9c27 100644
--- a/data/com.github.peteruithoven.resizer.appdata.xml.in
+++ b/data/com.github.peteruithoven.resizer.appdata.xml.in
@@ -5,17 +5,16 @@
CC0
GPL-3.0+
Resizer
- Quickly resize images from the context menu
+ Quickly resize images
- A simple image resizer that resizes one or more images, usable from the context menu or as a standalone app.
+ A simple image resizer that resizes one or more images.
Features:
- - Use from context menu: right click on image(s), and select "Resize images".
- - Use from Applications menu: Drag and drop image(s).
+ - Open images with Resizer or open Reizer and Drag and drop images
- Maintains aspect ratio.
- Keyboard control: Change the sizes using the up and down keys, press enter to resize.
- Settings are stored for next time.
@@ -34,9 +33,6 @@
https://raw.githubusercontent.com/peteruithoven/resizer/master/screenshot4.png
-
- https://raw.githubusercontent.com/peteruithoven/resizer/master/screenshot5.png
-
diff --git a/data/com.github.peteruithoven.resizer.desktop.in b/data/com.github.peteruithoven.resizer.desktop.in
index 135107a..2097c20 100644
--- a/data/com.github.peteruithoven.resizer.desktop.in
+++ b/data/com.github.peteruithoven.resizer.desktop.in
@@ -3,9 +3,10 @@ Name=Resizer
GenericName=Resizer App
Comment=Image resizer
Categories=Graphics;2DGraphics;RasterGraphics;
-Exec=com.github.peteruithoven.resizer %f
+Exec=com.github.peteruithoven.resizer %F
Icon=com.github.peteruithoven.resizer
Terminal=false
Type=Application
X-GNOME-Gettext-Domain=resizer
-Keywords=Image;resize;
\ No newline at end of file
+Keywords=Image;resize;
+MimeType=image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff;image/x-bmp;image/x-png;image/webp;
diff --git a/meson.build b/meson.build
index 3c33c29..86180a9 100644
--- a/meson.build
+++ b/meson.build
@@ -13,12 +13,14 @@ add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), la
# replacing variables like PROJECT_NAME
conf_data = configuration_data()
conf_data.set_quoted('PROJECT_NAME', meson.project_name())
-configure_file(
+config_file = configure_file(
input : 'src/config.vala.in',
output : 'config.vala',
configuration : conf_data
)
+meson.build_root()
+
executable(
meson.project_name(),
'src/Application.vala',
@@ -29,10 +31,11 @@ executable(
'src/Resizer.vala',
'src/DropArea.vala',
'src/MessageCenter.vala',
- 'build/config.vala',
+ config_file,
dependencies: [
dependency('gtk+-3.0'),
- dependency('granite')
+ dependency('granite'),
+ dependency('libhandy-1', version: '>=1.0.0')
],
install : true
)
@@ -40,4 +43,4 @@ executable(
meson.add_install_script('meson/post_install.py')
subdir('data')
-subdir('po')
\ No newline at end of file
+subdir('po')
diff --git a/screenshot2.png b/screenshot2.png
index 692c6f3..ac0bdaa 100644
Binary files a/screenshot2.png and b/screenshot2.png differ
diff --git a/screenshot3.png b/screenshot3.png
index ac0bdaa..53fbc44 100644
Binary files a/screenshot3.png and b/screenshot3.png differ
diff --git a/screenshot4.png b/screenshot4.png
index 53fbc44..b080914 100644
Binary files a/screenshot4.png and b/screenshot4.png differ
diff --git a/screenshot5.png b/screenshot5.png
deleted file mode 100644
index b080914..0000000
Binary files a/screenshot5.png and /dev/null differ
diff --git a/src/Application.vala b/src/Application.vala
index a6e09d6..5733893 100644
--- a/src/Application.vala
+++ b/src/Application.vala
@@ -20,7 +20,7 @@
*/
namespace Resizer {
- public class Application : Granite.Application {
+ public class Application : Gtk.Application {
private Window window = null;
public Application () {
diff --git a/src/DropArea.vala b/src/DropArea.vala
index e0408de..3f9083d 100644
--- a/src/DropArea.vala
+++ b/src/DropArea.vala
@@ -28,14 +28,14 @@ namespace Resizer {
construct {
image = new Gtk.Image ();
- image.get_style_context ().add_class ("card");
+ image.get_style_context ().add_class (Granite.STYLE_CLASS_CARD);
image.hexpand = true;
image.width_request = 300;
image.height_request = 200;
image.margin = 6;
image2 = new Gtk.Image ();
- image2.get_style_context ().add_class ("card");
+ image2.get_style_context ().add_class (Granite.STYLE_CLASS_CARD);
image2.margin = 6;
image2.margin_start = 6+6;
image2.margin_top = 6;
@@ -45,7 +45,7 @@ namespace Resizer {
drag_label.justify = Gtk.Justification.CENTER;
var drag_label_style_context = drag_label.get_style_context ();
- drag_label_style_context.add_class ("h2");
+ drag_label_style_context.add_class (Granite.STYLE_CLASS_H2_LABEL);
drag_label_style_context.add_class (Gtk.STYLE_CLASS_DIM_LABEL);
var images = new Gtk.Fixed();
diff --git a/src/HeaderBar.vala b/src/HeaderBar.vala
index 9dee519..2a1db1d 100644
--- a/src/HeaderBar.vala
+++ b/src/HeaderBar.vala
@@ -20,13 +20,13 @@
*/
namespace Resizer {
- public class HeaderBar : Gtk.HeaderBar {
+ public class HeaderBar : Hdy.HeaderBar {
construct {
show_close_button = true;
var header_context = get_style_context ();
- header_context.add_class ("titlebar");
- header_context.add_class ("default-decoration");
+ header_context.add_class (Gtk.STYLE_CLASS_TITLEBAR);
+ header_context.add_class (Granite.STYLE_CLASS_DEFAULT_DECORATION);
header_context.add_class (Gtk.STYLE_CLASS_FLAT);
var info_text = new Gtk.Label (_("Resizer will never upscale and always maintain the aspect ratio of your images."));
diff --git a/src/ResizePage.vala b/src/ResizePage.vala
index 37ae867..8ad7f11 100644
--- a/src/ResizePage.vala
+++ b/src/ResizePage.vala
@@ -30,7 +30,7 @@ namespace Resizer {
private Gtk.Button cancel_btn;
private Gtk.Button resize_btn;
- public ResizePage (Gtk.ApplicationWindow app) {
+ public ResizePage (Window app) {
var spacing = 12;
intro_label = new Gtk.Label ("");
diff --git a/src/Window.vala b/src/Window.vala
index 0577c61..e8a1921 100644
--- a/src/Window.vala
+++ b/src/Window.vala
@@ -20,7 +20,7 @@
*/
namespace Resizer {
- public class Window : Gtk.ApplicationWindow {
+ public class Window : Hdy.Window {
private Gtk.Stack pages;
const Gtk.TargetEntry[] DRAG_TARGETS = { { "text/uri-list", 0, 0 } };
@@ -32,10 +32,9 @@ namespace Resizer {
);
}
construct {
- this.get_style_context ().add_class ("rounded");
+ Hdy.init ();
var header = new HeaderBar ();
- this.set_titlebar (header);
var resize_page = new ResizePage (this);
var resizing_page = new ResizingPage ();
@@ -50,11 +49,16 @@ namespace Resizer {
var message_center = MessageCenter.get_default();
+ var innerGrid = new Gtk.Grid();
+ innerGrid.orientation = Gtk.Orientation.VERTICAL;
+ innerGrid.row_spacing = 12;
+ innerGrid.add(message_center);
+ innerGrid.add(pages);
+
var grid = new Gtk.Grid();
grid.orientation = Gtk.Orientation.VERTICAL;
- grid.row_spacing = 12;
- grid.add(message_center);
- grid.add(pages);
+ grid.add(header);
+ grid.add(innerGrid);
this.add(grid);
Resizer.get_default ().state_changed.connect((r, state) => {