Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#7826 closed enhancement (wontfix)

allow buttontree to customize individual column widths and layouts

Reported by: ron@… Owned by: stuartm
Priority: minor Milestone: unknown
Component: MythTV - User Interface Library Version: unknown
Severity: medium Keywords:
Cc: Ticket locked: yes

Description

This patch allows you to optionally add custom styling to the individual columns of a buttontree.

To customize the widths, you need only add a <columnwidths> tag to the <buttontree> declaration. For example, in a 3 column layout, you can make the last column twice as wide by doing: <columnwidths>200,200,400</columnwidths>

To customize the layout of an individual column, you simply define an additional buttonlist child, just as you currently do with the listtemplate element. For each columnn in the tree, if there is a matching buttonlist with the name "listcolumn_X" (where X is the column number, with 1 being the first column), that will be used for the layout. If a matching buttonlist is not found, then the "listtemplate" buttonlist will be used instead.

I'm attaching 2 files: a patch for the code, and an example patch that can be applied to mythvideo to make the 3rd column in the List View buttontree appear twice as wide and have a red font (this second patch is only for example).

Attachments (2)

buttontree_columns.patch (2.9 KB) - added by Ronald Frazier <ron@…> 10 years ago.
allow customizing buttontree columns
video-ui-example.patch (2.0 KB) - added by Ronald Frazier <ron@…> 10 years ago.
example of customizing columns of mythvideo's List View

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by Ronald Frazier <ron@…>

Attachment: buttontree_columns.patch added

allow customizing buttontree columns

Changed 10 years ago by Ronald Frazier <ron@…>

Attachment: video-ui-example.patch added

example of customizing columns of mythvideo's List View

comment:1 Changed 10 years ago by stuartm

Resolution: wontfix
Status: newclosed

It was intentional that column widths were equal because of the nature of tree. The values in list 3 (4,5) will appear in list 1 when you've moved deep enough, you are also make assumptions about the layout of everyone's files or the different filters that may have been applied.

Lets say you've customised the widths to fit the following file system - "TV > Series > Episode Name", a narrow list on the left just big enough to accommodate TV, a slightly wider list in the middle for series name and a very wide list on the right for the long episode titles. Now lets imagine that a user of the resulting theme in fact has the following filesystem - "Frederick's Home Videos > Summer holiday in Australia Jun 2004 > Day One > The Airport.mpg", they see "Fr.. > Summer Holiday i... > Day One >".

If we auto-calculated the width of the list on the basis of it's content it _may_ work better, but static sizing of column widths to fit one particular dataset isn't workable. Indeed there are places like mythmovies where the use of the tree widget are inappropriate and it would have been better to use separate, unlinked, lists.

I'm inclined to close as 'won't fix' for the reasons given, I don't think enough thought has been given to tree depths greater than the visible number of lists or the unpredictable nature of the content which make unequal widths impractical. Feel free to discuss on the -dev list.

comment:2 Changed 9 years ago by raymondboettcher@…

I disagree with this. Your original UI for MythTV < 0.21 uses a static UI for MythVideo? that shows the last column as being bigger than the rest. Many people have formatted their directory structures to accommodate for your Static UI and now that functionality is gone. I was forced to change the <numlists> property to 1 so I could see the last column without UI interference which completely defeats the purpose of having a buttontree. The idea of creating themes is to give the user complete control of customization of the interface. But if you leave out key elements like this, then you limit the functionality of the UI. The <columnwidth> property is optional. If someone wants equal size buttontree lists, then THEY will leave that option out. If the end user doesn't like a certain aspect of a theme but likes everything else (like me) then they can go in and modify the theme to their liking. As it stands now, the Theme UI interface can't be used to recreate the original static UI because of limitations in the theme interface, starting with <columnwidth>.

The fact that it cuts off text on the first or second column is irrelevant. In the instance of a directory structure being 6-7 levels deep, once they enter that "directory" it won't matter if it's shortened when they move 'right' because they will remember what it means. The most important element to be able to read is the very last one. Because that element determines where to go next in the tree. The original UI that was used since the beginning suffered the same problems that were described in your nofix resolution...

comment:3 Changed 9 years ago by stuartm

Ticket locked: set

comment:4 Changed 9 years ago by stuartm

If reading the columns to the left is irrelevant then displaying those columns is also irrelevant and you may as well use a buttonlist instead in your theme (Which is supported).

Note: See TracTickets for help on using tickets.