No description
Find a file
leyoda 94c3e6c551 yoda: toolbar as segmented_button for working drag reorder
The generic dnd_source+dnd_destination pairing didn't reliably fire
on intra-window reorders in this setup, while segmented_button's
built-in drag (same primitive powering tab_bar, which does work) is
proven. Switched the toolbar rendering to segmented_button::horizontal
with drag enabled — each segment carries its ToolbarAction as data.

App state:
- new toolbar_model: segmented_button::Model<SingleSelect>
- rebuild_toolbar_model() mirrors config.toolbar into the model on
  every update_config (including the initial app.update_config at
  startup)
- sync_toolbar_config_from_model() is the reverse: walk the model's
  entity order after a reorder, write the new Vec<ToolbarAction>
  directly via config.set_toolbar (without calling update_config so
  we don't rebuild the model and wipe the reorder the user just did)

Messages:
- ToolbarTabActivate(Entity): look up action via model.data(), clear
  the model's active selection (segmented_button single-select would
  keep the last click highlighted; we don't want that for action
  buttons), dispatch the action's message.
- ToolbarTabReorder(ReorderEvent): model.reorder then sync.

View:
- replaces the row-of-dnd-wrapped-icon-buttons with
  segmented_button::horizontal(&self.toolbar_model)
  .enable_tab_drag("x-cosmic-files/toolbar-dnd") .on_reorder(...) .on_activate(...)
- fixed 36-px square buttons so it still looks toolbar-y rather than
  stretched pill-segmented-control

Kept: Settings panel ↑↓/add/remove UI (no regression).
Removed: dnd_source/dnd_destination wrappers from the toolbar (but
the ToolbarActionPayload + MIME constant remain in case Settings DnD
gets unstuck later).
2026-04-24 11:03:05 +02:00
.github Add pull request template 2026-02-13 12:35:27 -07:00
cosmic-files-applet Epoch 1.0.11 version update 2026-04-17 12:54:32 -06:00
debian Epoch 1.0.11 version update 2026-04-17 12:54:32 -06:00
examples example(dialog): switch logger to fix build 2026-04-14 17:47:50 +02:00
i18n yoda: phase 3 — drag-drop toolbar editor in Settings 2026-04-24 08:13:30 +02:00
res Generate translated desktop and metainfo files with xdgen 2026-02-12 14:46:38 -07:00
samples Add mode samples 2025-02-12 10:44:53 -07:00
scripts Remove fs_extra (#655) 2024-11-13 14:36:11 -07:00
src yoda: toolbar as segmented_button for working drag reorder 2026-04-24 11:03:05 +02:00
.gitignore Add just flamegraph target 2024-11-14 09:28:28 -07:00
build.rs Generate translated desktop and metainfo files with xdgen 2026-02-12 14:46:38 -07:00
Cargo.lock yoda wayland-v5: redirect window_clipboard + cosmic-text to local forks 2026-04-24 07:09:48 +02:00
Cargo.toml yoda wayland-v5: redirect window_clipboard + cosmic-text to local forks 2026-04-24 07:09:48 +02:00
i18n.toml Basic implementation 2024-01-03 15:27:32 -07:00
justfile Merge pull request #1558 from jpttrssn/exclude-trash 2026-03-02 11:49:53 -07:00
LICENSE Initial commit 2024-01-03 13:34:32 -07:00
README.md Remove WIP note from readme 2026-01-13 10:07:50 -07:00
TESTING.md docs (QA): Add file drag-and-drop to regression testing checklist 2025-12-19 13:36:31 -07:00

cosmic-files

File manager for the COSMIC desktop environment

Build the project from source

# Clone the project using `git`
git clone https://github.com/pop-os/cosmic-files
# Change to the directory that was created by `git`
cd cosmic-files
# Build an optimized version using `cargo`, this may take a while
cargo build --release
# Run the optimized version using `cargo`
cargo run --release

Community and Contributing

The COSMIC desktop environment is maintained by System76 for use in Pop!_OS. A list of all COSMIC projects can be found in the cosmic-epoch project's README. If you would like to discuss COSMIC and Pop!_OS, please consider joining the Pop!_OS Chat. More information and links can be found on the Pop!_OS Website.

License

This project is licensed under GPLv3