From cd7f6ac974dde831c8963d1c2afdb6f06cee5448 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sat, 7 Sep 2019 23:46:00 +0200 Subject: Add scrolled window to XMLDialog and CSS dialog to avoid auto growing when add new content --- src/ui/dialog/xml-tree.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/ui/dialog/xml-tree.cpp') diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp index c91bcd2ab..f3259eb15 100644 --- a/src/ui/dialog/xml-tree.cpp +++ b/src/ui/dialog/xml-tree.cpp @@ -74,7 +74,9 @@ XmlTree::XmlTree() if (!desktop) { return; } - Gtk::Box *contents = _getContents(); + + Gtk::Box *root = _getContents(); + Gtk::Box *contents = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); status.set_halign(Gtk::ALIGN_START); status.set_valign(Gtk::ALIGN_CENTER); status.set_size_request(1, -1); @@ -85,6 +87,7 @@ XmlTree::XmlTree() contents->pack_start(_paned, true, true, 0); contents->set_valign(Gtk::ALIGN_FILL); contents->child_property_fill(_paned); + _paned.set_vexpand(true); _message_stack = std::make_shared(); _message_context = std::unique_ptr(new Inkscape::MessageContext(_message_stack)); @@ -234,7 +237,11 @@ XmlTree::XmlTree() _paned.property_position() = panedpos; _updating = false; tree_reset_context(); - + Gtk::ScrolledWindow *dialog_scroller = new Gtk::ScrolledWindow(); + dialog_scroller->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC ); + dialog_scroller->set_shadow_type(Gtk::SHADOW_IN); + dialog_scroller->add(*Gtk::manage(contents)); + root->pack_start(*dialog_scroller, true, true, 0); g_assert(desktop != nullptr); set_tree_desktop(desktop); -- cgit v1.2.3