From 2f52291be546b6fd68a1d8c4eb81978cb592a882 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Wed, 1 Apr 2020 00:30:33 +0200 Subject: Fix issue rendering messages outside reachable scroll area Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/2556 --- main/src/ui/conversation_content_view/conversation_view.vala | 8 +++++++- main/src/ui/util/size_request_box.vala | 11 +++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 main/src/ui/util/size_request_box.vala (limited to 'main/src/ui') diff --git a/main/src/ui/conversation_content_view/conversation_view.vala b/main/src/ui/conversation_content_view/conversation_view.vala index c68ee5de..ac6df1fc 100644 --- a/main/src/ui/conversation_content_view/conversation_view.vala +++ b/main/src/ui/conversation_content_view/conversation_view.vala @@ -106,7 +106,7 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins // Get widget under pointer int h = 0; bool @break = false; - Widget w = null; + Widget? w = null; main.@foreach((widget) => { if (break) return; @@ -118,6 +118,12 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins } }); + if (w == null) { + if (currently_highlighted != null) currently_highlighted.unset_state_flags(StateFlags.PRELIGHT); + currently_highlighted = null; + return; + } + // Get widget coordinates in main int widget_x, widget_y; w.translate_coordinates(main, 0, 0, out widget_x, out widget_y); diff --git a/main/src/ui/util/size_request_box.vala b/main/src/ui/util/size_request_box.vala new file mode 100644 index 00000000..c9adcb70 --- /dev/null +++ b/main/src/ui/util/size_request_box.vala @@ -0,0 +1,11 @@ +using Gtk; + +namespace Dino.Ui { +class SizeRequestBox : Box { + public SizeRequestMode size_request_mode { get; set; default = SizeRequestMode.CONSTANT_SIZE; } + + public override Gtk.SizeRequestMode get_request_mode() { + return size_request_mode; + } +} +} \ No newline at end of file -- cgit v1.2.3-70-g09d2