aboutsummaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2020-04-01 00:30:33 +0200
committerMarvin W <git@larma.de>2020-04-01 00:30:37 +0200
commit2f52291be546b6fd68a1d8c4eb81978cb592a882 (patch)
tree0be4be59d2484a9b273710747c42ae3cb14c0a07 /main
parent12cd56612dd6edd056e2cd8aae59ea3ae8f05d1e (diff)
downloaddino-2f52291be546b6fd68a1d8c4eb81978cb592a882.tar.gz
dino-2f52291be546b6fd68a1d8c4eb81978cb592a882.zip
Fix issue rendering messages outside reachable scroll area
Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/2556
Diffstat (limited to 'main')
-rw-r--r--main/CMakeLists.txt1
-rw-r--r--main/data/conversation_content_view/view.ui3
-rw-r--r--main/src/ui/conversation_content_view/conversation_view.vala8
-rw-r--r--main/src/ui/util/size_request_box.vala11
4 files changed, 21 insertions, 2 deletions
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
index 5dc69dcb..c9e3b879 100644
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -161,6 +161,7 @@ SOURCES
src/ui/util/helper.vala
src/ui/util/label_hybrid.vala
src/ui/util/sizing_bin.vala
+ src/ui/util/size_request_box.vala
src/ui/util/scaling_image.vala
src/ui/util/preview_file_chooser_native.vala
CUSTOM_VAPIS
diff --git a/main/data/conversation_content_view/view.ui b/main/data/conversation_content_view/view.ui
index fc7132aa..af05d285 100644
--- a/main/data/conversation_content_view/view.ui
+++ b/main/data/conversation_content_view/view.ui
@@ -28,11 +28,12 @@
<object class="GtkEventBox" id="main_event_box">
<property name="visible">True</property>
<child>
- <object class="GtkBox" id="main">
+ <object class="DinoUiSizeRequestBox" id="main">
<property name="margin-bottom">15</property>
<property name="expand">False</property>
<property name="orientation">vertical</property>
<property name="visible">True</property>
+ <property name="size-request-mode">height-for-width</property>
</object>
</child>
</object>
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