[gnome-games/wip/exalm/issue98: 1/4] game-thumbnail: Implement height-for-width sizing



commit 8abad46920e0c38598546299141d512dd6c321db
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sun Sep 23 14:38:42 2018 +0500

    game-thumbnail: Implement height-for-width sizing
    
    This allows to avoid setting height-request for thumbnais.

 src/ui/game-thumbnail.vala | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/ui/game-thumbnail.vala b/src/ui/game-thumbnail.vala
index f72d8902..99bcc89c 100644
--- a/src/ui/game-thumbnail.vala
+++ b/src/ui/game-thumbnail.vala
@@ -71,6 +71,14 @@ private class Games.GameThumbnail: Gtk.DrawingArea {
                set_css_name ("gamesgamethumbnail");
        }
 
+       public override Gtk.SizeRequestMode get_request_mode () {
+               return Gtk.SizeRequestMode.HEIGHT_FOR_WIDTH;
+       }
+
+       public override void get_preferred_height_for_width (int width, out int minimum_height, out int 
natural_height) {
+               minimum_height = natural_height = width;
+       }
+
        public override bool draw (Cairo.Context cr) {
                var window = get_window ();
                var style = get_style_context ();


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