[gnome-builder] hoverpopover: use scrolled window to avoid large sizes
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] hoverpopover: use scrolled window to avoid large sizes
- Date: Tue, 19 Oct 2021 22:51:17 +0000 (UTC)
commit 44073ac28478ef835e17379e38892e1568be91c4
Author: Christian Hergert <chergert redhat com>
Date: Tue Oct 19 15:51:10 2021 -0700
hoverpopover: use scrolled window to avoid large sizes
Fixes #1551
src/libide/sourceview/ide-hover-popover.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/sourceview/ide-hover-popover.c b/src/libide/sourceview/ide-hover-popover.c
index aa80cf360..53d418284 100644
--- a/src/libide/sourceview/ide-hover-popover.c
+++ b/src/libide/sourceview/ide-hover-popover.c
@@ -274,6 +274,7 @@ static void
ide_hover_popover_init (IdeHoverPopover *self)
{
GtkStyleContext *style_context;
+ GtkWidget *scroller;
self->context = g_object_new (IDE_TYPE_HOVER_CONTEXT, NULL);
self->cancellable = g_cancellable_new ();
@@ -281,11 +282,20 @@ ide_hover_popover_init (IdeHoverPopover *self)
style_context = gtk_widget_get_style_context (GTK_WIDGET (self));
gtk_style_context_add_class (style_context, "hoverer");
+ scroller = g_object_new (GTK_TYPE_SCROLLED_WINDOW,
+ "visible", TRUE,
+ "propagate-natural-width", TRUE,
+ "propagate-natural-height", TRUE,
+ "max-content-width", 600,
+ "max-content-height", 600,
+ NULL);
+ gtk_container_add (GTK_CONTAINER (self), scroller);
+
self->box = g_object_new (GTK_TYPE_BOX,
"orientation", GTK_ORIENTATION_VERTICAL,
"visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (self->box));
+ gtk_container_add (GTK_CONTAINER (scroller), GTK_WIDGET (self->box));
}
IdeHoverContext *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]