After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 744721 - RFE: Automatically add intermediate viewport when adding non-scrollable widget to a scrolled window
RFE: Automatically add intermediate viewport when adding non-scrollable widge...
Status: RESOLVED OBSOLETE
Product: glade
Classification: Applications
Component: general
3.15.x
Other Linux
: Normal normal
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-18 16:55 UTC by David Shea
Modified: 2018-03-26 15:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ListBox in a ScrolledWindow without an explicit Viewport (643 bytes, text/plain)
2015-02-18 18:07 UTC, David Shea
Details
ListBox in a ScrolledWindow with an explicit Viewport (693 bytes, text/plain)
2015-02-18 18:08 UTC, David Shea
Details

Description David Shea 2015-02-18 16:55:30 UTC
It is currently impossible, in glade, to add a ListBox to a ScrolledWindow without a Viewport in the middle. The resulting listbox is not able to scroll when using keyboard navigation. It is possible to add a ListBox directly to a ScrolledWindow, and in that case scrolling by selecting off-screen widgets via the keyboard works fine. The problem is only that glade does not know this is possible. Please make glade know that this is possible.
Comment 1 Matthias Clasen 2015-02-18 18:03:27 UTC
But the end result is the same - if you add the listbox directly to the scrolledwindow, the scrolledwindow helpfully inserts a viewport itself.

So, what is different ?
Comment 2 David Shea 2015-02-18 18:07:17 UTC
Created attachment 297130 [details]
ListBox in a ScrolledWindow without an explicit Viewport

This ListBox, where the ListBox is added directly to a ScrolledWindow, works fine.
Comment 3 David Shea 2015-02-18 18:08:10 UTC
Created attachment 297131 [details]
ListBox in a ScrolledWindow with an explicit Viewport

This version, where the ListBox is added to an intermediate Viewport, and which is what glade requires me to do, does not work.
Comment 4 Matthias Clasen 2015-02-18 22:00:17 UTC
Looking at gtk_scrolled_window_add, the relevant difference is that it sets up the focus adjustments on the viewport:

      scrollable_child = gtk_viewport_new (hadj, vadj);

      gtk_container_set_focus_hadjustment (GTK_CONTAINER (scrollable_child),
                                           gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (scrolled_window)));
      gtk_container_set_focus_vadjustment (GTK_CONTAINER (scrollable_child),
                                           gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (scrolled_window)));

glade should do that too.

It should also allow you to add a listbox directly to a scrolled window, probably.
Comment 5 Tristan Van Berkom 2015-02-19 12:51:34 UTC
Updating the bug title to reflect this.

As a side note, the reason we dont allow adding non-scrollables to scrolled windows is because of the intermediate viewport that scrolled-window sneaks into the hierarchy - Glade cannot function in a case where gtk_widget_get_parent() does not returrn the GtkContainer which the said widget was added to, because
we rely on consistency in the widget hierarchy.

That said, automatically adding an intermediate viewport with some added adjustments should be possible, however Glade would *also* have to add the
adjustments to the project as well and set them both as the focus adjustments of the viewport, and the adjustments of the scrolled window.

As the scrolled window itself normally configures those adjustments, I'm not 100% sure that that will work out well.
Comment 6 David Shea 2015-03-04 22:13:30 UTC
It might be possible to work around this is I were able to set the focus adjustments on the listbox (or other unscrollable child) from glade, but I can't do that either.
Comment 7 GNOME Infrastructure Team 2018-03-26 15:45:39 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glade/issues/197.