Page 1 of 1

Custom columns: reusing width from other columns

Posted: 2019-03-05, 22:21 UTC
by DrShark
Currently it's possible only to set a column width as a number in dialog units (either by moving the column separators in panels, or by writing a width number in Custom Columns set configuration window.

I suggest in addition to dialog units use as a column width also word as a "link" to a width of other column. This is especially useful if custom column set uses some of built-in Default or Comment view columns (File, Size, Date, Attr; Comment.)
For example, if we'll use a word Size instead of dialog units, our custom column will have a width of a Size column from default view.

In addition to taking width from built-in views, in a similar way it could be possible to re-use the width of other column from current column set. Here we could use 2 methods: a number with special character (to avoid confusion with dialog units), f. ex. #3 to re-use the with of column №3, or a quoted word (quotes to avoid conflict with above method to reuse default column widths), f.ex. "Size" is to re-use the width of a column with that (unquoted) name from current colums set (words will work only if such column name will be unique in current columns set.) This addition will allow to change a width of several columns by changing only one with mouse in panels (all other columns that "link" to a coulumn width of which we're changing, will change their widths to same value.)

Re: Custm columns: reusing width from other columns

Posted: 2019-04-09, 16:28 UTC
by Usher
Just one question: how do you want to prevent recursion?

Re: Custm columns: reusing width from other columns

Posted: 2019-04-15, 16:38 UTC
by DrShark
Usher wrote:
2019-04-09, 16:28 UTC
Just one question: how do you want to prevent recursion?
TC can stop using referenced width sizes on first detected recursion (and use default width instead.)

Re: Custm columns: reusing width from other columns

Posted: 2019-04-15, 18:03 UTC
by Usher
2DrShark
It's still too general.
1. It may be a long chain of references and it may seriously slow down operations for directories with a lot of files.
2. I think that the only safe way is to refer to full column names, that is plugin-name.property. You can use quite normal arithmetic expressions in this case, f.e. tc.fullname+20, shelldetails.Author*2, 600-tc.ext etc.
3. How do you want to manage sizes when you remove some referenced column from the view?
4. How do you want to manage sizes if for some reason you change TC window size or resize some columns manually? Many people prefer to avoid horizontal scrolling, so increasing some size you should decrease another one (see 600-tc.ext above?).

I think there should be additional parameter for resizing behaviour: keep fixed size, follow the arithmetic expression, make proportional changes etc.
And the solution gets complicated…