diff --git a/data/plug.css b/data/plug.css index dca9012c..d18f1c48 100644 --- a/data/plug.css +++ b/data/plug.css @@ -55,7 +55,7 @@ .wallpaper flowboxchild { border-radius: 0.75em; - margin: 1em; + margin: 0.5em; } .wallpaper flowboxchild picture { diff --git a/src/Views/Wallpaper.vala b/src/Views/Wallpaper.vala index 09fa32db..71e68e20 100644 --- a/src/Views/Wallpaper.vala +++ b/src/Views/Wallpaper.vala @@ -60,7 +60,6 @@ public class PantheonShell.Wallpaper : Switchboard.SettingsPage { activate_on_single_click = true, homogeneous = true, selection_mode = SINGLE, - min_children_per_line = 3, max_children_per_line = 5 }; wallpaper_view.bind_model (wallpaper_model, create_widget_func); diff --git a/src/Widgets/WallpaperContainer.vala b/src/Widgets/WallpaperContainer.vala index 90da0452..9e4a5b38 100644 --- a/src/Widgets/WallpaperContainer.vala +++ b/src/Widgets/WallpaperContainer.vala @@ -25,7 +25,8 @@ public class PantheonShell.WallpaperContainer : Granite.Bin { protected const int THUMB_HEIGHT = 144; protected Gtk.Picture image; - private Gtk.Box card_box; + private static float monitor_ratio; + private Gtk.Revealer check_revealer; public string? thumb_path { get; construct set; } @@ -53,10 +54,18 @@ public class PantheonShell.WallpaperContainer : Granite.Bin { Object (uri: uri, thumb_path: thumb_path, thumb_valid: thumb_valid); } + static construct { + var monitor = Gdk.Display.get_default ().get_monitor_at_surface ( + (((Gtk.Application) Application.get_default ()).active_window).get_surface () + ); + + monitor_ratio = (float) monitor.geometry.width / monitor.geometry.height; + } + construct { image = new Gtk.Picture () { - content_fit = COVER, - height_request = THUMB_HEIGHT + can_shrink = false, + content_fit = COVER }; image.add_css_class (Granite.CssClass.CARD); @@ -78,10 +87,12 @@ public class PantheonShell.WallpaperContainer : Granite.Bin { }; overlay.add_overlay (check_revealer); - halign = CENTER; - valign = CENTER; + var frame = new Gtk.AspectFrame (0.5f, 0.5f, monitor_ratio, false) { + child = overlay + }; - child = overlay; + child = frame; + height_request = THUMB_HEIGHT; if (uri != null) { var remove_wallpaper_action = new SimpleAction ("trash", null);