yoda: phase 2 — customizable toolbar (settings toggles per button)
Phase 1 shipped a fixed 6-button toolbar. Phase 2 moves visibility to the config so users pick which buttons appear. Config (config.rs): - new ToolbarItems struct (CosmicConfigEntry) with one bool per button - Config.toolbar: ToolbarItems, default = 'minimal 6' set from phase 1 (new_folder, rename, delete, cut, copy, paste) + 5 extras off (new_file, reload, toggle_show_hidden, open_terminal, location_up) Rendering (view()): - iterate through self.config.toolbar fields in fixed logical order (location → create/edit → clipboard → view toggles) - dividers inserted only between non-empty groups - whole toolbar hidden if every button is off (no empty container) Settings page (settings()): - new 'Toolbar' section with one toggler per button, wired through Message::SetToolbar(ToolbarItems) which persists via config_set! i18n (en + fr): - added 'toolbar' + 'parent-directory' strings - reused existing new-folder / new-file / rename / delete / cut / copy / paste / reload-folder / show-hidden-files / open-in-terminal All actions dispatch through Action::message so keybindings and toolbar share one code path.
This commit is contained in:
parent
8b51af1632
commit
33a5c8ff99
4 changed files with 188 additions and 27 deletions
|
|
@ -139,6 +139,8 @@ open-with = Open with
|
|||
owner = Owner
|
||||
group = Group
|
||||
other = Other
|
||||
toolbar = Toolbar
|
||||
parent-directory = Parent directory
|
||||
mixed = Mixed
|
||||
### Mode 0
|
||||
none = None
|
||||
|
|
|
|||
|
|
@ -131,6 +131,8 @@ open-with = Ouvrir avec
|
|||
owner = Propriétaire
|
||||
group = Groupe
|
||||
other = Autre
|
||||
toolbar = Barre d'outils
|
||||
parent-directory = Dossier parent
|
||||
|
||||
### Mode 0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue