rabite0 / hunter

The fastest file manager in the galaxy!
Do What The F*ck You Want To Public License
1.31k stars 64 forks source link

Customizable column ratios #58

Closed ath3 closed 5 years ago

ath3 commented 5 years ago

Ability to set custom column ratios in config file.

columns=15,35,49 or columns=15:35:49

Default is 20:30:49 The sum of the numbers has to be 99 The sum of the numbers now doesn't have to be 99

rabite0 commented 5 years ago

Looks good. While you're at it, could you maybe just remove the 0/99-based column ratios? That's probably wrong anyway.

The only places set_ratios get called are in file_browser.rs:258 and proclist.rs:457.

ath3 commented 5 years ago

Im not sure if i understand correctly: You want to have the logic allowing any number for ratios - as done in the second commit, but doing the calculations in calculate_coordinates instead of doing it in config?

rabite0 commented 5 years ago

Yeah, so that it's possible to use anywhere. Would be nice if it was part of HBox itself.

rabite0 commented 5 years ago

If you don't have time or are having difficulties, I could also do it myself.

ath3 commented 5 years ago

Sorry, i didnt have time, but I would like to work on it, if not sooner, then i will do it this weekend.

ath3 commented 5 years ago

This change now also sets the minimal column size to 10, so if the ratio calculations would make it smaller than that, it will adjust the numbers. The config parsing of invalid ratios should now be more robust, and if the input is not valid then the default ratios will be taken.

rabite0 commented 5 years ago

Great, thank you!