├── debian ├── compat ├── source │ └── format ├── changelog ├── control ├── rules └── copyright ├── .gitignore ├── Example.png ├── Screenshot.png ├── data ├── com.github.philip-scott.wallpaperize.contract ├── com.github.philip-scott.wallpaperize.desktop ├── meson.build ├── com.github.philip-scott.wallpaperize.appdata.xml └── icons │ ├── 16 │ └── com.github.philip-scott.wallpaperize.svg │ ├── 24 │ └── com.github.philip-scott.wallpaperize.svg │ ├── 32 │ └── com.github.philip-scott.wallpaperize.svg │ ├── 48 │ └── com.github.philip-scott.wallpaperize.svg │ ├── 64 │ └── com.github.philip-scott.wallpaperize.svg │ └── 128 │ └── com.github.philip-scott.wallpaperize.svg ├── make.sh ├── meson.build ├── README.md └── src ├── Application.vala ├── Wallpaperize.vala └── Window.vala /debian/compat: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | *~ 3 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /Example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Philip-Scott/wallpaperize/HEAD/Example.png -------------------------------------------------------------------------------- /Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Philip-Scott/wallpaperize/HEAD/Screenshot.png -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | com.github.philip-scott.wallpaperize (0.1) UNSTABLE; urgency=low 2 | 3 | * Initial release 4 | 5 | -- Felipe Escoto Wed, 7 Jun 2017 04:52:12 -0600 6 | -------------------------------------------------------------------------------- /data/com.github.philip-scott.wallpaperize.contract: -------------------------------------------------------------------------------- 1 | [Contractor Entry] 2 | Name=Wallpaperize 3 | Icon=preferences-desktop-wallpaper 4 | Description=Beautify your oddly-sized wallpapers 5 | MimeType=image 6 | Exec=com.github.philip-scott.wallpaperize %F 7 | 8 | -------------------------------------------------------------------------------- /make.sh: -------------------------------------------------------------------------------- 1 | valac --pkg gtk+-3.0 --pkg granite src/Wallpaperize.vala 2 | 3 | sudo mkdir /usr/share/wallpaperize 4 | sudo cp Wallpaperize /usr/share/wallpaperize/Wallpaperize 5 | sudo cp src/wapaperize.contract /usr/share/contractor/wapaperize.contract 6 | 7 | echo "Wallpaperize instalation done! Enjoy" 8 | -------------------------------------------------------------------------------- /data/com.github.philip-scott.wallpaperize.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Wallpaperize 3 | Comment=Beautify your oddly-sized wallpapers 4 | Exec=com.github.philip-scott.wallpaperize %u 5 | Icon=com.github.philip-scott.wallpaperize 6 | Terminal=false 7 | Type=Application 8 | StartupNotify=true 9 | Categories=Graphics; 10 | Actions=AboutDialog; 11 | 12 | [Desktop Action AboutDialog] 13 | Exec=com.github.philip-scott.wallpaperize --about 14 | Name=About Wallpaperize 15 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: com.github.philip-scott.wallpaperize 2 | Section: x11 3 | Priority: extra 4 | Maintainer: Felipe Escoto 5 | Build-Depends: debhelper (>= 9), 6 | libgtk-3-dev, 7 | valac (>= 0.26), 8 | libgranite-dev, 9 | meson 10 | 11 | Standards-Version: 3.9.3 12 | Package: com.github.philip-scott.wallpaperize 13 | Architecture: any 14 | Depends: ${misc:Depends}, ${shlibs:Depends} 15 | Description: Beautify your oddly-sized wallpapers 16 | Turn your oddly sized wallpapers into a piece of beauty 17 | -------------------------------------------------------------------------------- /data/meson.build: -------------------------------------------------------------------------------- 1 | icon_sizes = ['24', '32', '48', '64', '128'] 2 | 3 | foreach i : icon_sizes 4 | install_data( 5 | join_paths('icons', i, meson.project_name() + '.svg'), 6 | install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps') 7 | ) 8 | endforeach 9 | 10 | install_data( 11 | meson.project_name() + '.desktop', 12 | install_dir: join_paths(get_option('datadir'), 'applications') 13 | ) 14 | 15 | install_data( 16 | meson.project_name() + '.appdata.xml', 17 | install_dir: join_paths(get_option('datadir'), 'metainfo') 18 | ) 19 | 20 | install_data( 21 | meson.project_name() + '.contract', 22 | install_dir: join_paths(get_option('datadir'), 'contractor') 23 | ) 24 | -------------------------------------------------------------------------------- /meson.build: -------------------------------------------------------------------------------- 1 | project('com.github.philip-scott.wallpaperize', ['vala', 'c'], 2 | version: '0.2.0' 3 | ) 4 | 5 | gnome = import('gnome') 6 | i18n = import('i18n') 7 | 8 | conf = configuration_data() 9 | conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) 10 | configure_file(output: 'config.h', configuration: conf) 11 | config_h_dir = include_directories('.') 12 | 13 | c_args = [ 14 | '-include', 'config.h', 15 | ] 16 | 17 | executable( 18 | 'com.github.philip-scott.wallpaperize', 19 | 'src/Application.vala', 20 | 'src/Wallpaperize.vala', 21 | 'src/Window.vala', 22 | c_args: c_args, 23 | dependencies: [ 24 | dependency('glib-2.0'), 25 | dependency('gobject-2.0'), 26 | dependency('gtk+-3.0'), 27 | dependency('granite'), 28 | ], 29 | install : true 30 | ) 31 | 32 | subdir('data') 33 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | %: 13 | dh $@ 14 | 15 | override_dh_auto_clean: 16 | rm -rf debian/build 17 | 18 | override_dh_auto_configure: 19 | mkdir -p debian/build 20 | cd debian/build && meson --prefix=/usr ../.. 21 | 22 | override_dh_auto_build: 23 | cd debian/build && ninja -v 24 | 25 | override_dh_auto_test: 26 | cd debian/build && ninja test 27 | 28 | override_dh_auto_install: 29 | cd debian/build && DESTDIR=${CURDIR}/debian/com.github.philip-scott.wallpaperize ninja install 30 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://dep.debian.net/deps/dep5 2 | Upstream-Name: cmake-hello-world 3 | Source: https://github.com/Philip-Scott/wallpaperize 4 | 5 | Files: * 6 | Copyright: 2017 Felipe Escoto 7 | License: GPL-3.0+ 8 | 9 | License: GPL-3.0+ 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | . 15 | This package is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | . 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | . 23 | On Debian systems, the complete text of the GNU General 24 | Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". 25 | 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

Wallpaperize

3 |

Turn your oddly sized wallpapers into a piece of beauty

4 |
5 | 6 |
7 | 8 |

9 | 10 | Get it on AppCenter 11 | 12 |

13 | 14 |
15 | 16 |

17 | Screenshot 18 |

19 | 20 |

21 | 22 | 23 | Turn your oddly sized wallpapers into a piece of beauty. Simply right click on your picture's file and select "Wallpaperize" from the drop down menu, or open the app and drag & drop the image you want. 24 | 25 | 26 | ## Installation 27 | [![Get it on AppCenter](https://appcenter.elementary.io/badge.svg)](https://appcenter.elementary.io/com.github.philip-scott.wallpaperize) 28 | 29 | On elementary OS? Hit the button to get Wallaperize! 30 | 31 | 32 | ## Build the App 33 | 34 | Run `meson build` to configure the build environment and then change to the build directory and run `ninja` to build 35 | 36 | meson build 37 | cd build 38 | mesonconf -Dprefix=/usr 39 | ninja 40 | 41 | To install, use `ninja install`, then execute with `com.github.philip-scott.wallpaperize` 42 | 43 | sudo ninja install 44 | com.github.philip-scott.wallpaperize 45 | 46 | ### Credits 47 | Original app: http://backgroundifier.archagon.net 48 | Request from: Mario Daniel Ruiz 49 | -------------------------------------------------------------------------------- /src/Application.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Felipe Escoto (https://github.com/Philip-Scott) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | * 19 | * Authored by: Felipe Escoto 20 | */ 21 | 22 | public class Wallpaperize.Application : Granite.Application { 23 | public const string PROGRAM_ID = "com.github.philip-scott.wallpaperize"; 24 | public const string PROGRAM_NAME = "Wallpaperize"; 25 | 26 | construct { 27 | flags |= ApplicationFlags.HANDLES_OPEN; 28 | 29 | application_id = PROGRAM_ID; 30 | program_name = PROGRAM_NAME; 31 | app_years = "2016-2017"; 32 | exec_name = PROGRAM_ID; 33 | app_launcher = PROGRAM_ID; 34 | 35 | build_version = "1.0"; 36 | app_icon = PROGRAM_ID; 37 | main_url = "https://github.com/Philip-Scott/%s/".printf (PROGRAM_NAME); 38 | bug_url = "https://github.com/Philip-Scott/%s/issues".printf (PROGRAM_NAME); 39 | help_url = "https://github.com/Philip-Scott/%s/issues".printf (PROGRAM_NAME); 40 | translate_url = "https://github.com/Philip-Scott/%s/tree/master/po".printf (PROGRAM_NAME); 41 | about_authors = {"Felipe Escoto ", null}; 42 | about_translators = _("translator-credits"); 43 | 44 | about_license_type = Gtk.License.GPL_3_0; 45 | } 46 | 47 | public override void open (File[] files, string hint) { 48 | Wallpaperize.Wallpaperiser.get_monitor_geometry (); 49 | foreach (var file in files) { 50 | Wallpaperize.Wallpaperiser.from_file (file); 51 | } 52 | } 53 | 54 | public override void activate () { 55 | var window = new Wallpaperize.Window (this); 56 | this.add_window (window); 57 | window.show (); 58 | } 59 | 60 | public static int main (string[] args) { 61 | /* Initiliaze gettext support */ 62 | Intl.setlocale (LocaleCategory.MESSAGES, Intl.get_language_names ()[0]); 63 | Intl.setlocale (LocaleCategory.NUMERIC, "en_US"); 64 | //Intl.textdomain (Config.GETTEXT_PACKAGE); 65 | 66 | Environment.set_application_name (PROGRAM_NAME); 67 | Environment.set_prgname (PROGRAM_NAME); 68 | 69 | var application = new Wallpaperize.Application (); 70 | 71 | return application.run (args); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /data/com.github.philip-scott.wallpaperize.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | com.github.philip-scott.wallpaperize 5 | CC0-1.0 6 | GPL-3.0+ 7 | Wallpaperize 8 | Beautify your oddly-sized wallpapers 9 | 10 |

11 | Turn your oddly sized wallpapers into a piece of beauty. Simply right click on your picture's file, and select "Wallpaperize" from the drop down menu, or open the app and drag-and-drop the images you wish to wallpaperize. 12 |

13 |
14 | 15 | com.github.philip-scott.wallpaperize 16 | 17 | 18 | 19 | 20 |

Juno Release

21 |
    22 |
  • Wallpaperize is now available in elementary OS Juno!
  • 23 |
24 |
25 |
26 |
27 | 28 | 29 | https://raw.githubusercontent.com/Philip-Scott/wallpaperize/master/Screenshot.png 30 | 31 | 32 | Felipe Escoto 33 | https://github.com/Philip-Scott 34 | https://github.com/Philip-Scott/wallpaperize/issues 35 | https://github.com/Philip-Scott/wallpaperize/issues 36 | felescoto95@hotmail.com 37 | 38 | #FCEDC5 39 | #482C4B 40 | 2 41 | 42 | 43 | none 44 | none 45 | none 46 | none 47 | none 48 | none 49 | none 50 | none 51 | none 52 | none 53 | none 54 | none 55 | none 56 | none 57 | none 58 | none 59 | none 60 | none 61 | none 62 | none 63 | none 64 | none 65 | none 66 | none 67 | none 68 | none 69 | none 70 | 71 |
72 | -------------------------------------------------------------------------------- /src/Wallpaperize.vala: -------------------------------------------------------------------------------- 1 | using Cairo; 2 | 3 | public class Wallpaperize.Wallpaperiser : Object { 4 | public static int W = 1920; 5 | public static int H = 1080; 6 | private const int RADIUS = 3; 7 | 8 | private static Gdk.Pixbuf image; 9 | 10 | private static int width; 11 | private static int height; 12 | private static double zoom; 13 | 14 | public static void from_file (File file) { 15 | var path = file.get_path (); 16 | try { 17 | var file_regex = new GLib.Regex (".(jpe?g|png|tiff|gif)"); 18 | string output_name = file_regex.replace (path, path.length, 0, "") + ".wp.png"; 19 | make_image (path, output_name); 20 | } catch (RegexError e) { 21 | stderr.printf ("Error on file: %s", e.message); 22 | } 23 | } 24 | 25 | public static void get_monitor_geometry() { 26 | var screen = Gdk.Screen.get_default (); 27 | int primary_monitor = screen.get_primary_monitor (); 28 | Gdk.Rectangle geometry; 29 | screen.get_monitor_geometry (primary_monitor, out geometry); 30 | 31 | int monitor_scale = screen.get_monitor_scale_factor (primary_monitor); 32 | Wallpaperize.Wallpaperiser.H = geometry.height * monitor_scale; 33 | Wallpaperize.Wallpaperiser.W = geometry.width * monitor_scale; 34 | } 35 | 36 | public static void make_image (string input, string output) { 37 | var surface = make_surface (input); 38 | surface.surface.write_to_png (output); 39 | } 40 | 41 | public static Granite.Drawing.BufferSurface? make_surface (string input) { 42 | var surface = new Granite.Drawing.BufferSurface (W, H); 43 | try { 44 | image = new Gdk.Pixbuf.from_file (input); 45 | } catch (Error e) { 46 | stderr.printf ("Error on input: %s", e.message); 47 | return null; 48 | } 49 | 50 | width = image.get_width(); 51 | height = image.get_height(); 52 | 53 | //Scale image if too big 54 | if (width > W || height > H) { 55 | while (width > W || height > H) { 56 | width = width / 5 * 2; 57 | height = height / 5 * 2; 58 | } 59 | 60 | image = image.scale_simple (width, height, Gdk.InterpType.BILINEAR); 61 | } 62 | 63 | int center_h = H/2 - height/2; 64 | int center_w = W/2 - width/2; 65 | double zoomh = H / (double) height; 66 | double zoomw = W / (double) width; 67 | 68 | if (zoomw >= zoomh) { 69 | zoom = zoomw; 70 | } else { 71 | zoom = zoomh; 72 | } 73 | 74 | //Background 75 | Gdk.cairo_set_source_pixbuf (surface.context, image, 0, 0); 76 | surface.context.scale (zoom, zoom); 77 | surface.context.paint (); 78 | 79 | //Lighten background 80 | surface.context.set_source_rgba (0,0,0, 0.1); 81 | surface.context.paint (); 82 | 83 | //Blur 84 | surface.exponential_blur (55); 85 | surface.context.paint (); 86 | 87 | //Draw shadow 88 | surface.context.scale (1/zoom, 1/zoom); 89 | 90 | surface.context.move_to (center_w + RADIUS, center_h); 91 | surface.context.arc (center_w + width - RADIUS , center_h + RADIUS, RADIUS, Math.PI * 1.5, Math.PI * 2); 92 | surface.context.arc (center_w + width - RADIUS , center_h + height - RADIUS + 2, RADIUS, 0, Math.PI * 0.5); 93 | surface.context.arc (center_w + RADIUS, center_h + height - RADIUS + 2 , RADIUS, Math.PI * 0.5, Math.PI); 94 | surface.context.arc (center_w + RADIUS, center_h + RADIUS, RADIUS, Math.PI, Math.PI * 1.5); 95 | surface.context.close_path (); 96 | 97 | surface.context.set_line_width (7.0); 98 | surface.context.set_source_rgba (0, 0, 0, 0.4); 99 | surface.context.fill_preserve (); 100 | 101 | surface.exponential_blur (5); 102 | 103 | //Place image 104 | Granite.Drawing.Utilities.cairo_rounded_rectangle (surface.context, center_w, center_h, image.get_width(), image.get_height(), RADIUS); 105 | Gdk.cairo_set_source_pixbuf (surface.context, image, center_w, center_h); 106 | surface.context.fill_preserve (); 107 | 108 | return surface; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /src/Window.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Felipe Escoto (https://github.com/Philip-Scott) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | * 19 | * Authored by: Felipe Escoto 20 | */ 21 | 22 | public class Wallpaperize.Window : Gtk.Window { 23 | const int MIN_WIDTH = 450; 24 | const int MIN_HEIGHT = 600; 25 | const int IMAGE_HEIGHT = 200; 26 | 27 | const Gtk.TargetEntry[] DRAG_TARGETS = {{ "text/uri-list", 0, 0 }}; 28 | 29 | const string STYLESHEET = """ 30 | .titlebar { 31 | background-color: @bg_color; 32 | background-image: none; 33 | border: none; 34 | box-shadow: none; 35 | padding: 16px; 36 | } 37 | """; 38 | 39 | public Gtk.Image image; 40 | public Gtk.Button cancel_button; 41 | public Gtk.Button run_button; 42 | public Gtk.Label drag_label; 43 | 44 | public Gtk.Entry width; 45 | public Gtk.Entry height; 46 | 47 | private File? _file; 48 | public File? file { 49 | get { 50 | return _file; 51 | } 52 | 53 | set { 54 | _file = value; 55 | if (value == null) { 56 | return; 57 | } 58 | 59 | var surface = Wallpaperize.Wallpaperiser.make_surface (value.get_path ()); 60 | 61 | if (surface != null) { 62 | var pixbuf = surface.load_to_pixbuf (); 63 | pixbuf = pixbuf.scale_simple (image.get_allocated_width (), image.get_allocated_height (), Gdk.InterpType.BILINEAR); 64 | 65 | image.set_from_pixbuf (pixbuf); 66 | run_button.label = _("Wallpaperize!"); 67 | drag_label.visible = false; 68 | drag_label.no_show_all = true; 69 | 70 | validate (); 71 | } 72 | } 73 | 74 | default = null; 75 | } 76 | 77 | public Window (Gtk.Application app) { 78 | Object (application: app); 79 | } 80 | 81 | construct { 82 | Granite.Widgets.Utils.set_theming_for_screen (this.get_screen (), STYLESHEET, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); 83 | get_style_context ().add_class ("rounded"); 84 | set_size_request(MIN_WIDTH, MIN_HEIGHT); 85 | 86 | Gtk.drag_dest_set (this, Gtk.DestDefaults.MOTION | Gtk.DestDefaults.DROP, DRAG_TARGETS, Gdk.DragAction.COPY); 87 | drag_data_received.connect (on_drag_data_received); 88 | 89 | resizable = false; 90 | deletable = false; 91 | set_keep_above (true); 92 | 93 | var grid = new Gtk.Grid (); 94 | grid.orientation = Gtk.Orientation.VERTICAL; 95 | grid.column_spacing = 12; 96 | grid.row_spacing = 12; 97 | grid.expand = true; 98 | grid.margin = 6; 99 | 100 | image = new Gtk.Image (); 101 | image.get_style_context ().add_class ("card"); 102 | image.hexpand = true; 103 | image.height_request = 200; 104 | image.margin = 6; 105 | 106 | drag_label = new Gtk.Label (_("Drop Image Here")); 107 | drag_label.justify = Gtk.Justification.CENTER; 108 | 109 | var drag_label_style_context = drag_label.get_style_context (); 110 | drag_label_style_context.add_class ("h2"); 111 | drag_label_style_context.add_class (Gtk.STYLE_CLASS_DIM_LABEL); 112 | 113 | var overlay = new Gtk.Overlay (); 114 | overlay.add (image); 115 | overlay.add_overlay (drag_label); 116 | 117 | width = new Gtk.Entry (); 118 | height = new Gtk.Entry (); 119 | 120 | width.input_purpose = Gtk.InputPurpose.DIGITS; 121 | height.input_purpose = Gtk.InputPurpose.DIGITS; 122 | 123 | width.set_tooltip_text (_("Width")); 124 | height.set_tooltip_text (_("Height")); 125 | 126 | width.changed.connect (() => { 127 | Wallpaperize.Wallpaperiser.W = int.parse (width.text); 128 | validate (); 129 | }); 130 | 131 | height.changed.connect (() => { 132 | Wallpaperize.Wallpaperiser.H = int.parse (height.text); 133 | validate (); 134 | }); 135 | 136 | var reset_button = new Gtk.Button.from_icon_name ("video-display-symbolic"); 137 | reset_button.clicked.connect (get_screen_size); 138 | reset_button.set_tooltip_text (_("Get resolution")); 139 | 140 | var resolution_box = new Gtk.Grid (); 141 | resolution_box.column_spacing = 6; 142 | resolution_box.margin = 6; 143 | resolution_box.add (width); 144 | resolution_box.add (new Gtk.Label ("\u00D7")); 145 | resolution_box.add (height); 146 | resolution_box.add (reset_button); 147 | 148 | cancel_button = new Gtk.Button.with_label (_("Cancel")); 149 | run_button = new Gtk.Button.with_label (_("Wallpaperize!")); 150 | run_button.get_style_context ().add_class ("suggested-action"); 151 | 152 | var actions_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6); 153 | actions_box.pack_start (cancel_button); 154 | actions_box.pack_end (run_button); 155 | actions_box.expand = true; 156 | actions_box.halign = Gtk.Align.END; 157 | actions_box.valign = Gtk.Align.END; 158 | actions_box.margin = 6; 159 | 160 | cancel_button.clicked.connect (() => { 161 | this.close (); 162 | }); 163 | 164 | run_button.sensitive = false; 165 | run_button.clicked.connect (() => { 166 | run_button.sensitive = false; 167 | Wallpaperize.Wallpaperiser.from_file (file); 168 | run_button.label = _("Done"); 169 | }); 170 | 171 | grid.attach (overlay, 0, 0, 1, 1); 172 | grid.attach (resolution_box, 0, 1, 1, 1); 173 | grid.attach (actions_box, 0, 2, 1, 1); 174 | this.add (grid); 175 | 176 | show_all (); 177 | get_screen_size (); 178 | } 179 | 180 | private void validate () { 181 | int w = Wallpaperiser.W; 182 | int h = Wallpaperiser.H; 183 | run_button.sensitive = w > 0 && h > 0 && w < 15000 && h < 15000 && file != null; 184 | } 185 | 186 | private void get_screen_size () { 187 | Wallpaperize.Wallpaperiser.get_monitor_geometry (); 188 | 189 | width.text = Wallpaperize.Wallpaperiser.W.to_string (); 190 | height.text = Wallpaperize.Wallpaperiser.H.to_string (); 191 | } 192 | 193 | private void on_drag_data_received (Gdk.DragContext drag_context, int x, int y, Gtk.SelectionData data, uint info, uint time) { 194 | stderr.printf (data.get_uris ()[0]); 195 | Gtk.drag_finish (drag_context, true, false, time); 196 | 197 | file = File.new_for_uri (data.get_uris ()[0]); 198 | } 199 | } 200 | -------------------------------------------------------------------------------- /data/icons/16/com.github.philip-scott.wallpaperize.svg: -------------------------------------------------------------------------------- 1 | 2 | 18 | 40 | 46 | 47 | 49 | 50 | 52 | image/svg+xml 53 | 55 | 56 | 57 | 58 | 59 | 61 | 63 | 67 | 71 | 75 | 79 | 80 | 82 | 86 | 90 | 94 | 98 | 99 | 102 | 106 | 110 | 114 | 118 | 119 | 121 | 125 | 129 | 130 | 132 | 136 | 140 | 144 | 145 | 155 | 165 | 174 | 176 | 180 | 184 | 185 | 187 | 191 | 195 | 199 | 200 | 202 | 206 | 210 | 214 | 218 | 219 | 221 | 225 | 229 | 233 | 237 | 238 | 248 | 257 | 266 | 275 | 284 | 294 | 305 | 306 | 309 | 314 | 321 | 326 | 327 | 336 | 345 | 350 | 355 | 360 | 365 | 374 | 379 | 389 | 399 | 409 | 410 | -------------------------------------------------------------------------------- /data/icons/24/com.github.philip-scott.wallpaperize.svg: -------------------------------------------------------------------------------- 1 | 2 | 18 | 40 | 46 | 47 | 49 | 50 | 52 | image/svg+xml 53 | 55 | 56 | 57 | 58 | 59 | 61 | 63 | 67 | 71 | 75 | 79 | 80 | 82 | 86 | 90 | 94 | 98 | 99 | 102 | 106 | 110 | 114 | 118 | 119 | 122 | 126 | 130 | 134 | 138 | 142 | 146 | 147 | 149 | 153 | 157 | 158 | 160 | 164 | 168 | 172 | 173 | 183 | 193 | 202 | 204 | 208 | 212 | 213 | 215 | 219 | 223 | 227 | 228 | 230 | 234 | 238 | 242 | 246 | 247 | 249 | 253 | 257 | 261 | 265 | 266 | 276 | 286 | 296 | 305 | 314 | 323 | 332 | 342 | 353 | 354 | 357 | 362 | 369 | 374 | 375 | 384 | 393 | 402 | 407 | 412 | 417 | 422 | 427 | 436 | 439 | 444 | 454 | 464 | 474 | 482 | 483 | 484 | -------------------------------------------------------------------------------- /data/icons/128/com.github.philip-scott.wallpaperize.svg: -------------------------------------------------------------------------------- 1 | 2 | 18 | 41 | 44 | 45 | 47 | 48 | 50 | image/svg+xml 51 | 53 | 54 | 55 | 56 | 57 | 59 | 61 | 65 | 69 | 73 | 77 | 78 | 80 | 84 | 88 | 92 | 96 | 97 | 100 | 104 | 108 | 112 | 116 | 117 | 120 | 124 | 128 | 132 | 136 | 140 | 144 | 145 | 147 | 151 | 155 | 159 | 163 | 164 | 166 | 170 | 174 | 175 | 177 | 181 | 185 | 189 | 190 | 200 | 210 | 219 | 228 | 238 | 240 | 244 | 248 | 252 | 256 | 257 | 267 | 269 | 273 | 277 | 278 | 280 | 284 | 288 | 292 | 293 | 295 | 299 | 303 | 307 | 311 | 312 | 314 | 318 | 322 | 326 | 330 | 331 | 341 | 351 | 361 | 370 | 379 | 388 | 398 | 407 | 416 | 425 | 435 | 443 | 447 | 448 | 456 | 460 | 461 | 462 | 467 | 474 | 479 | 488 | 493 | 499 | 505 | 514 | 523 | 532 | 541 | 546 | 551 | 556 | 561 | 566 | 575 | 584 | 593 | 598 | 608 | 618 | 628 | 636 | 637 | -------------------------------------------------------------------------------- /data/icons/64/com.github.philip-scott.wallpaperize.svg: -------------------------------------------------------------------------------- 1 | 2 | 18 | 40 | 43 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 58 | 60 | 64 | 68 | 72 | 76 | 77 | 79 | 83 | 87 | 91 | 95 | 96 | 99 | 103 | 107 | 111 | 115 | 116 | 119 | 123 | 127 | 131 | 135 | 139 | 143 | 144 | 146 | 150 | 154 | 158 | 162 | 163 | 165 | 169 | 173 | 174 | 176 | 180 | 184 | 188 | 189 | 199 | 209 | 218 | 227 | 237 | 239 | 243 | 247 | 251 | 255 | 256 | 266 | 268 | 272 | 276 | 277 | 279 | 283 | 287 | 291 | 292 | 294 | 298 | 302 | 306 | 310 | 311 | 313 | 317 | 321 | 325 | 329 | 330 | 340 | 350 | 360 | 369 | 378 | 387 | 397 | 406 | 415 | 424 | 434 | 442 | 446 | 447 | 455 | 459 | 460 | 461 | 465 | 472 | 476 | 485 | 494 | 499 | 504 | 508 | 517 | 526 | 535 | 544 | 549 | 554 | 559 | 564 | 569 | 578 | 587 | 596 | 601 | 611 | 621 | 631 | 639 | 640 | -------------------------------------------------------------------------------- /data/icons/48/com.github.philip-scott.wallpaperize.svg: -------------------------------------------------------------------------------- 1 | 2 | 18 | 41 | 44 | 45 | 47 | 48 | 50 | image/svg+xml 51 | 53 | 54 | 55 | 56 | 57 | 59 | 61 | 65 | 69 | 73 | 77 | 78 | 80 | 84 | 88 | 92 | 96 | 97 | 100 | 104 | 108 | 112 | 116 | 117 | 120 | 124 | 128 | 132 | 136 | 140 | 144 | 145 | 147 | 151 | 155 | 159 | 163 | 164 | 166 | 170 | 174 | 175 | 177 | 181 | 185 | 189 | 190 | 200 | 210 | 219 | 228 | 238 | 240 | 244 | 248 | 252 | 256 | 257 | 267 | 269 | 273 | 277 | 278 | 280 | 284 | 288 | 292 | 293 | 295 | 299 | 303 | 307 | 311 | 312 | 314 | 318 | 322 | 326 | 330 | 331 | 341 | 351 | 361 | 370 | 379 | 388 | 398 | 407 | 416 | 425 | 435 | 443 | 447 | 448 | 456 | 460 | 461 | 462 | 467 | 474 | 479 | 488 | 497 | 502 | 508 | 514 | 523 | 532 | 541 | 550 | 555 | 560 | 565 | 570 | 575 | 584 | 593 | 602 | 607 | 617 | 627 | 637 | 645 | 646 | -------------------------------------------------------------------------------- /data/icons/32/com.github.philip-scott.wallpaperize.svg: -------------------------------------------------------------------------------- 1 | 2 | 18 | 40 | 46 | 47 | 49 | 50 | 52 | image/svg+xml 53 | 55 | 56 | 57 | 58 | 59 | 61 | 63 | 67 | 71 | 75 | 79 | 80 | 82 | 86 | 90 | 94 | 98 | 99 | 102 | 106 | 110 | 114 | 118 | 119 | 122 | 126 | 130 | 134 | 138 | 142 | 146 | 147 | 149 | 153 | 157 | 161 | 165 | 166 | 168 | 172 | 176 | 177 | 179 | 183 | 187 | 191 | 192 | 202 | 212 | 221 | 230 | 240 | 242 | 246 | 250 | 254 | 258 | 259 | 269 | 271 | 275 | 279 | 280 | 282 | 286 | 290 | 294 | 295 | 297 | 301 | 305 | 309 | 313 | 314 | 316 | 320 | 324 | 328 | 332 | 333 | 343 | 353 | 363 | 372 | 381 | 390 | 400 | 409 | 418 | 427 | 437 | 445 | 449 | 450 | 458 | 462 | 463 | 474 | 475 | 480 | 487 | 492 | 501 | 510 | 515 | 521 | 527 | 536 | 545 | 554 | 563 | 568 | 573 | 578 | 583 | 588 | 597 | 606 | 615 | 618 | 623 | 633 | 643 | 653 | 661 | 662 | 663 | --------------------------------------------------------------------------------