List Info

Thread: CR/CN-Client: Fixing playlist GtkTreeView column-sizing problems.




CR/CN-Client: Fixing playlist GtkTreeView column-sizing problems.
country flaguser name
United States
2007-10-21 21:19:43
Modified by: dyekreal.com
Date: 10/21/2007
Project: Helix Player

Synopsis: Fixing playlist GtkTreeView column-sizing
problems.

Overview: 

Issue #1:
Setting GtkTreeViewColumn "expand" property to
TRUE 
when allowing users to resize columns is a problematic
combination in
GtkTreeView (for list view).

The result is that the column would expand in the opposite
direction 
as mouse movement when the user resizes it -- totally
bizarre.

There is a technical explanation to it: 
that the extra spaces (now in the expanded column on the
left) 
is used first before attempting to expand to the right.
This would work if column AUTOSIZE is based on data width,
rather than
column header width, but it is not now.

This shouldn't be the end result.

Ideally, GtkTreeView should "allow total user
control" even when
"expand" is desirably TRUE and user control should
be allowed.

This fix workaround the bizarre behavior by converting the 
expanded width to (pretended/artificial user) 

  resized_width

when GtkTreeView is realized, effectively consuming and
eliminating 
extra spaces in GtkTreeView column layout.


Issue #2:
GtkTreeView lays out AUTOSIZE columns based on their 
column headings/titles width, instead of maximum data
width.

(Or it could be that the functionality was turned off
because of
performance problem with huge lists. 
I haven't found out if it can be turned on somehow.)

Often titles are very short and thus the AUTOSIZE-columns
are
too small to be useful.

Issue #3:
>From the API document, one would conclude that there is
only 
this function available to grow the column width:
  gtk_tree_view_column_set_min_width()

This function prevents the column from shrinking when
resized by 
the user.

This fix doubles the AUTOSIZE width of Artist and Album
columns and 
set the resulting width as: 

  resized_width. 


This reasonably autosizes the columns and still doesn't
prevent 
user control. 

hx_tree_view_column_set_width()  is created to fill the role
of the missing API function.




With this checkin, the playlist dialog box is autosized
conveniently,
while letting users control over it.

There are two known behaviors that are not ideal, 
but generally not a problem:

1. Double middle-clicking on the right, resizing, Title
column border 
would restore Title column to its undesirable default
AUTOSIZE size, 
which is the width of column tile.

2. Title column doesn't expand more when users expand the 
playlist dialog.


Files Modified:
player/app/gtk/playlistdialog.cpp


Image Size and Heap Use impact (Client -Only):
None.

Platforms and Profiles Affected:
Linux

Distribution Libraries Affected:
None.

Distribution library impact and planned action:
None.

Platforms and Profiles Build Verified:
Profile: helix_client_all_define
Platform: Fedora Core 6

Platforms and Profiles Functionality verified:
Profile: helix_client_all_define
Platform: Fedora Core 6

Branch: HEAD

Copyright assignment: I am a RealNetworks employee.




-- 
Daniel Yek.


_______________________________________________
Player-dev mailing list
Player-devhelixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/play
er-dev

  
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )