GNOME Bugzilla – Bug 169152
Columns resizing on drag in RbTreeView
Last modified: 2005-07-29 03:55:41 UTC
The category dividers in applications move like one would expect them to... dragging one moves one. The issue I am having (in my case in Rhythmbox) is that moving one divider to the left moves the two dividers farther to the left right, so they are converging. See the ASCII art: |Track |Title |Genre |Artist |Album |Time becomes |Track |Title |Genre |Artist |Album |Time If that doesn't get the idea across, I'll attach a few screenshots... I hope this isn't intended behavior. Other information:
In the example above, I dragged the album divider left, which caused the genre and artist dividers to move right.
Actually, it's rhythmbox bug, since it uses RbTreeView - it's own tree implemntation.
Created attachment 38256 [details] [review] Patch to drop RbTreeView and use of GtkTreeView Files that not needed and should be removed: gtktreeprivate.h \ gtkrbtree.h rb-tree-view.c rb-tree-view.h rb-query-creator.h rb-tree-view-column.c rb-tree-view-column.h Althogh it doesn't solve problem completely. GtkTreeView behaviour is also not perfect.
Created attachment 38302 [details] Testcase in simple gtk
What is this testcase about?
Created attachment 38462 [details] [review] Patch to gtk to improve columns resizing Attachment 38302 [details] is the simple demo of resizing columns when two or more columns are expandible. gtk is not optimal in this situation - when you start to resize column it sometimes jump and so on, when you move mouse left, column sometimes grow but then becames smaller. This patch should correct situation.
About RbTreeView. If I've understood correctly it was created for three resons - 1. Expandable columns 2. Sortable columns 3. Handling of horizontal resizing so that widget has constant width. Now in gkt 2.4 both 1) and 2) supported. 3 can be archived by just setting GTK_POLICY_NEVER to hscrollbar of ScrolledWindow. This will be more conformant way to all gtk application behaviour. So as a result it would be nice to remove RbTreeView with the patch from comment #3
I had a play around with this and it works fine, but making the entry view never have horizontal scrollbars isn't as easy as setting hscrollbar_policy to GTK_POLICY_NEVER for rb-entryview (which is derived from ScrolledWindow.). Does anyone with more GTK knowledge than me know exactly how to get the horizontal scrollbars to disappear?
James, the problem here is the following - you either have no resizable columns at all or have horizontal scrollbar that should appear or use POLICY_NEVER and then widget should expand. That is _gtk_ behavior and it's preferable for me, since it follows the behavior of other applications. Having the widget that looks very similar to GtkTreeView but behaves differently is not so good. Probably rhythmbox can use new implementation of scrollbar_widget instead that even without horizonal scrollbar will restrict child size. To be honest, I also don't know why columns should be resizable.
Created attachment 49253 [details] [review] Modified version of RbTreeView->GtkTreeView For some reason none of the columns were set to be expandable, so they wouldn't shrink - which is why it wasn't working. This is a slightly modified version of the first patch, which will make several columns ellipsize and shrink when necessary - the title, artist, album and genre (the ones it makes sense to ellipsize). This means that we shouldn't get a horizontal scrollbar unless the window is fairly thin. The column resize behaviour is still wierd, but I guess that's a GTK issue. I guess the reason they are resizable is that if things are being ellipsized, you might care more about the title than the album - and so want to give it more room.
If you think the column-resizing patch needs to be applied, please attach it to a bug against GTK. 2005-07-29 James Livingston <jrl@ids.org.au> * sources/rb-playlist-source.c: (rb_playlist_source_constructor): * sources/rb-sourcelist.c: * widgets/Makefile.am: * widgets/rb-entry-view.c: (rb_entry_view_append_column), (rb_entry_view_constructor): Patch from Nickolay V. Shmyrev <nshmyrev@yandex.ru> to use GTK's TreeView rather than our own implementation. (Closes 169152) Files removed: * widgets/gtkrbtree.h: * widgets/gtktreeprivate.h: * widgets/rb-tree-view-column.c: * widgets/rb-tree-view-column.h: * widgets/rb-tree-view.c: * widgets/rb-tree-view.h: