[gnome-games/wip/exalm/issue98-330: 1/4] game-thumbnail: Implement height-for-width sizing
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/issue98-330: 1/4] game-thumbnail: Implement height-for-width sizing
- Date: Sun, 23 Sep 2018 09:58:25 +0000 (UTC)
commit 3f5daeec792d6b12f95c68bed6dc2d74b73abbd3
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]