Commit graph

45 commits

Author SHA1 Message Date
1cf17dcde8 yoda: phase 3 — drag-drop toolbar editor in Settings
Migrates the config model from the phase-2 bag-of-bools (ToolbarItems)
to an ordered Vec<ToolbarAction> so the user can pick BOTH the set of
buttons AND their order in the toolbar.

Config (config.rs):
- new ToolbarAction enum with 11 variants (LocationUp, Reload,
  NewFolder, NewFile, Rename, Delete, Cut, Copy, Paste,
  ToggleShowHidden, OpenTerminal) + to_u8/from_u8 for DnD payload
- Config.toolbar: Vec<ToolbarAction>, default = default_toolbar()
  (NewFolder, Rename, Delete, Cut, Copy, Paste — same 6 as phase 2)

Rendering (view()):
- iterate self.config.toolbar in order and emit a tooltip'd icon button
  per entry via the new toolbar_action_ui(action) helper shared with
  the Settings page. Paste stays disabled when clipboard empty.
- No hardcoded groups or auto-dividers anymore — order is 100% user.

Settings page (toolbar_settings_section):
- two stacked lists:
  * 'Toolbar': currently-enabled actions in their Vec order. Each row
    is wrapped in dnd_source (drags a ToolbarActionPayload carrying
    the enum discriminant) + dnd_destination (accepts drops from other
    rows, fires Message::ToolbarReorder { src, target } to move src
    before target in the Vec). A list-drag-handle icon + a minus button
    (ToolbarRemove) per row.
  * 'Available': actions not yet enabled, each with a plus button
    (ToolbarAdd) that pushes to the end of the Vec.
- 'Reset to defaults' button at the bottom (ToolbarReset).

DnD infra (app.rs top):
- TOOLBAR_MIME constant: 'application/x-cosmic-files-toolbar-action'
- ToolbarActionPayload(u8) with AsMimeTypes + AllowedMimeTypes +
  TryFrom<(Vec<u8>, String)> impls — single-byte wire format matching
  the enum discriminant.

Messages:
- ToolbarAdd(ToolbarAction) — append to toolbar vec if absent
- ToolbarRemove(ToolbarAction)
- ToolbarReorder { src, target } — remove src, reinsert before target
- ToolbarReset — restore default_toolbar()

i18n (en + fr):
- new keys: toolbar-available, toolbar-empty-hint, toolbar-reset

Migration: existing installs with a phase-2 ToolbarItems struct in
their config will error at load time (different shape); cosmic_config
falls back to Self::default() which gives the phase-2 minimal-6 set —
a safe reset rather than a broken partial read.
2026-04-24 08:13:30 +02:00
33a5c8ff99 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.
2026-04-24 07:53:49 +02:00
darkfated
39281a6336 Add user-defined context actions 2026-04-06 06:16:27 +03:00
Sebastiano Giordano
5d3d893c9e feat: add setting to enable/disable the "recents" feature 2026-02-17 13:02:28 -05:00
wowitsjack
5e92d081c6 add type-to-select option for keyboard navigation 2025-12-27 19:07:21 +10:00
Cheong Lau
bd1fa1f0a9 perf: general minor performance optimisations
Notably there is some code cleanup with the zooming functionality, I've
created a new module to reduce code duplication.
2025-10-29 08:16:50 +10:00
Cheong Lau
5f729829d7 chore: more pedantic clippy suggestions 2025-10-29 08:10:19 +10:00
Cheong Lau
43a9fca4ec perf: use rustc-hash for HashMap and HashSet
Since we already depend on `rustc-hash` transiently, this doesn't add
any more dependencies. As long as DOS attacks aren't a concern (which I
don't think they are?), this should be free performance.

In my (admittedly naive) testing, this really improved CPU usage in some
cases, which is pretty nice to get for free.
2025-10-19 08:46:12 +10:00
Vukašin Vojinović
f95869a631 chore: migrate to Rust 2024 edition 2025-09-11 08:15:26 -06:00
Mitchel Stewart
293350092c
thumbnail: Support jxl and plumbing for future formats. (#1058)
* add plumbing for additional thumbnailers

* remove bad logging and fmt

* fix bad logging message

* add decoding ram limits

* add configuration for thumbs

* cleanups

* fix rebase fails
2025-07-30 15:45:53 -06:00
Jeremy Soller
795f90ba95
Persist more dialog options 2025-07-22 09:13:14 -06:00
Jeremy Soller
4f0c5c1ec1 dialog: preserve show details setting 2025-07-21 19:51:30 -06:00
Ashley Wulber
c7e9828d7b feat: retry opening network locations after mounting 2025-07-15 13:15:45 -06:00
Jeremy Soller
3566040bac
Fix warnings 2025-07-08 09:14:48 -06:00
Ashley Wulber
e4ffec63a1 refactor: apply limit on the number of persisted sort names 2025-07-03 19:34:48 +00:00
Ashley Wulber
84b73b0bdc refactor: move sort names to state 2025-07-03 15:13:11 +00:00
Ashley Wulber
01bf55865c feat: persist sort options for each location 2025-07-03 15:13:11 +00:00
Jason Hansen
5e21c7cf99
Use icu for date and time localization (#934)
* Use icu for date and time localization

* Handle military time config in dialog
2025-04-14 08:59:32 -06:00
CaelusV
20e571efab Add 'Single click to open' settings toggle 2025-03-14 03:30:58 +01:00
Jeremy Soller
f95762bd44
Type to search or seek (#859)
* WIP: type to search/seek

* Implement type to seek
2025-03-06 20:44:05 -07:00
Josh Megnauth
e34dcf1372
Respect military time config from time applet
Closes: #775
2025-02-24 01:02:30 -05:00
Jeremy Soller
abf95c0189
Add icon size and grid spacing for desktop, fixes #751 2025-02-06 09:26:20 -07:00
Josh Megnauth
dddfc8a673 chore(clippy): config, dialog, menu
Fixes Clippy lints for:
* src/config.rs
* src/dialog.rs
* src/menu.rs
2025-01-22 08:10:19 -07:00
Jeremy Soller
390673c70f
Update libcosmic/iced 2024-10-21 13:51:10 -06:00
Jeremy Soller
e25cd37f2d
Search redesign, fixes #550, fixes #287, fixes part of #224 2024-10-09 15:41:10 -06:00
Jeremy Soller
c511242dd4
Implement desktop view toggles, part of #547 2024-10-04 16:28:30 -06:00
Jeremy Soller
21eac9324f
Make show details configurable and persistent, fixes #540 and #321 2024-10-02 15:26:02 -06:00
Jeremy Soller
60743ed251
Settings overhaul, part of #321 2024-10-02 14:53:24 -06:00
Jeremy Soller
0fe302a524
Default to list view 2024-09-17 11:41:14 -06:00
Jeremy Soller
ca664f009b
dialog: show configured navbar items and drives, part of #335 2024-09-11 09:09:32 -06:00
Jeremy Soller
010e1a977d
Adjust default list size 2024-07-11 10:12:07 -06:00
Ashley Wulber
ac2e129e4d feat: load preferred theme instead of using default 2024-05-30 12:31:16 -06:00
maciekk64
a085499c0e default view config 2024-05-29 17:56:42 -06:00
Jeremy Soller
322dad2b8a
Implement view menu, fixes #184 2024-05-28 10:40:36 -06:00
Jeremy Soller
99c378873a
Implement add to sidebar, fixes #112 2024-05-09 12:48:33 -06:00
Jeremy Soller
a13e3fd095
Add config for favorites 2024-04-30 13:29:58 -06:00
Jeremy Soller
3ab5597fc3
Load thumbnails with maximum grid icon size, fixes #78 2024-03-20 10:06:21 -06:00
Josh Megnauth
a4b38c4983 Refactor sorting option to TabConfig 2024-03-16 11:24:19 -06:00
Jeremy Soller
f8521d5b0d
Implement condensed list view 2024-02-29 19:47:27 -07:00
Jeremy Soller
61fe3c093d
Adjust list view sizing to match designs 2024-02-22 21:46:33 -07:00
Josh Megnauth
162616f687 Add icon sizes to settings page 2024-02-20 09:58:35 -07:00
Josh Megnauth
1f613860e4 Add icon sizes to config
Icon sizes are stored as a zoom percentage. This may need to be updated
by a programmer with better ideas, but it seems a bit nicer than storing
the size in pixels and presenting that to the user.
2024-02-20 09:58:35 -07:00
Josh Megnauth
e697e96afe Small TabConfig clean ups
* Rename `config::Tab` to `TabConfig`
* Use the loaded tab config instead of the default (oops)
2024-02-11 07:23:02 -07:00
Josh Megnauth
073a9a95ab Add a per Tab config
A tab config is useful for allowing users to show hidden files, sorting
by different metrics such as size or MIME type, as well as providing a
way to implement some of the todos such as configurable icon sizes for
views.
2024-02-11 07:23:02 -07:00
Jeremy Soller
9978f246b9
Basic implementation 2024-01-03 15:27:32 -07:00