Fix issue rendering messages outside reachable scroll area

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/2556
This commit is contained in:
Marvin W 2020-04-01 00:30:33 +02:00
parent 12cd56612d
commit 2f52291be5
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A
4 changed files with 21 additions and 2 deletions

View file

@ -161,6 +161,7 @@ SOURCES
src/ui/util/helper.vala src/ui/util/helper.vala
src/ui/util/label_hybrid.vala src/ui/util/label_hybrid.vala
src/ui/util/sizing_bin.vala src/ui/util/sizing_bin.vala
src/ui/util/size_request_box.vala
src/ui/util/scaling_image.vala src/ui/util/scaling_image.vala
src/ui/util/preview_file_chooser_native.vala src/ui/util/preview_file_chooser_native.vala
CUSTOM_VAPIS CUSTOM_VAPIS

View file

@ -28,11 +28,12 @@
<object class="GtkEventBox" id="main_event_box"> <object class="GtkEventBox" id="main_event_box">
<property name="visible">True</property> <property name="visible">True</property>
<child> <child>
<object class="GtkBox" id="main"> <object class="DinoUiSizeRequestBox" id="main">
<property name="margin-bottom">15</property> <property name="margin-bottom">15</property>
<property name="expand">False</property> <property name="expand">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="size-request-mode">height-for-width</property>
</object> </object>
</child> </child>
</object> </object>

View file

@ -106,7 +106,7 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins
// Get widget under pointer // Get widget under pointer
int h = 0; int h = 0;
bool @break = false; bool @break = false;
Widget w = null; Widget? w = null;
main.@foreach((widget) => { main.@foreach((widget) => {
if (break) return; 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 // Get widget coordinates in main
int widget_x, widget_y; int widget_x, widget_y;
w.translate_coordinates(main, 0, 0, out widget_x, out widget_y); w.translate_coordinates(main, 0, 0, out widget_x, out widget_y);

View file

@ -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;
}
}
}