dialog: remove dead view selection code

This commit is contained in:
Jeremy Soller 2024-09-11 14:32:12 -06:00
parent b851f3dd66
commit c8eb2b3024
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
2 changed files with 50 additions and 72 deletions

100
Cargo.lock generated
View file

@ -254,9 +254,9 @@ dependencies = [
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.87" version = "1.0.88"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356"
[[package]] [[package]]
name = "apply" name = "apply"
@ -463,7 +463,7 @@ dependencies = [
"futures-lite 2.3.0", "futures-lite 2.3.0",
"parking", "parking",
"polling 3.7.3", "polling 3.7.3",
"rustix 0.38.36", "rustix 0.38.37",
"slab", "slab",
"tracing", "tracing",
"windows-sys 0.59.0", "windows-sys 0.59.0",
@ -513,7 +513,7 @@ dependencies = [
"cfg-if", "cfg-if",
"event-listener 3.1.0", "event-listener 3.1.0",
"futures-lite 1.13.0", "futures-lite 1.13.0",
"rustix 0.38.36", "rustix 0.38.37",
"windows-sys 0.48.0", "windows-sys 0.48.0",
] ]
@ -532,7 +532,7 @@ dependencies = [
"cfg-if", "cfg-if",
"event-listener 5.3.1", "event-listener 5.3.1",
"futures-lite 2.3.0", "futures-lite 2.3.0",
"rustix 0.38.36", "rustix 0.38.37",
"tracing", "tracing",
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
@ -560,7 +560,7 @@ dependencies = [
"cfg-if", "cfg-if",
"futures-core", "futures-core",
"futures-io", "futures-io",
"rustix 0.38.36", "rustix 0.38.37",
"signal-hook-registry", "signal-hook-registry",
"slab", "slab",
"windows-sys 0.59.0", "windows-sys 0.59.0",
@ -594,7 +594,7 @@ name = "atomicwrites"
version = "0.4.2" version = "0.4.2"
source = "git+https://github.com/jackpot51/rust-atomicwrites#043ab4859d53ffd3d55334685303d8df39c9f768" source = "git+https://github.com/jackpot51/rust-atomicwrites#043ab4859d53ffd3d55334685303d8df39c9f768"
dependencies = [ dependencies = [
"rustix 0.38.36", "rustix 0.38.37",
"tempfile", "tempfile",
"windows-sys 0.48.0", "windows-sys 0.48.0",
] ]
@ -869,7 +869,7 @@ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"log", "log",
"polling 3.7.3", "polling 3.7.3",
"rustix 0.38.36", "rustix 0.38.37",
"slab", "slab",
"thiserror", "thiserror",
] ]
@ -883,7 +883,7 @@ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"log", "log",
"polling 3.7.3", "polling 3.7.3",
"rustix 0.38.36", "rustix 0.38.37",
"slab", "slab",
"thiserror", "thiserror",
] ]
@ -895,7 +895,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02"
dependencies = [ dependencies = [
"calloop 0.12.4", "calloop 0.12.4",
"rustix 0.38.36", "rustix 0.38.37",
"wayland-backend", "wayland-backend",
"wayland-client", "wayland-client",
] ]
@ -907,7 +907,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20"
dependencies = [ dependencies = [
"calloop 0.13.0", "calloop 0.13.0",
"rustix 0.38.36", "rustix 0.38.37",
"wayland-backend", "wayland-backend",
"wayland-client", "wayland-client",
] ]
@ -1213,7 +1213,7 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-config" name = "cosmic-config"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"atomicwrites", "atomicwrites",
"cosmic-config-derive", "cosmic-config-derive",
@ -1232,7 +1232,7 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-config-derive" name = "cosmic-config-derive"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"quote", "quote",
"syn 1.0.109", "syn 1.0.109",
@ -1339,7 +1339,7 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-theme" name = "cosmic-theme"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"almost", "almost",
"cosmic-config", "cosmic-config",
@ -1713,7 +1713,7 @@ dependencies = [
"bytemuck", "bytemuck",
"drm-ffi", "drm-ffi",
"drm-fourcc", "drm-fourcc",
"rustix 0.38.36", "rustix 0.38.37",
] ]
[[package]] [[package]]
@ -1723,7 +1723,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6" checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6"
dependencies = [ dependencies = [
"drm-sys", "drm-sys",
"rustix 0.38.36", "rustix 0.38.37",
] ]
[[package]] [[package]]
@ -2782,7 +2782,7 @@ dependencies = [
[[package]] [[package]]
name = "iced" name = "iced"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"dnd", "dnd",
"iced_accessibility", "iced_accessibility",
@ -2801,7 +2801,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_accessibility" name = "iced_accessibility"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"accesskit", "accesskit",
"accesskit_unix", "accesskit_unix",
@ -2811,7 +2811,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_core" name = "iced_core"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"dnd", "dnd",
@ -2833,7 +2833,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_futures" name = "iced_futures"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"futures", "futures",
"iced_core", "iced_core",
@ -2846,7 +2846,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_graphics" name = "iced_graphics"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"bytemuck", "bytemuck",
@ -2870,7 +2870,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_renderer" name = "iced_renderer"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"iced_graphics", "iced_graphics",
"iced_tiny_skia", "iced_tiny_skia",
@ -2882,7 +2882,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_runtime" name = "iced_runtime"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"dnd", "dnd",
"iced_accessibility", "iced_accessibility",
@ -2896,7 +2896,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_sctk" name = "iced_sctk"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"enum-repr", "enum-repr",
"float-cmp", "float-cmp",
@ -2923,7 +2923,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_style" name = "iced_style"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"iced_core", "iced_core",
"once_cell", "once_cell",
@ -2933,7 +2933,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_tiny_skia" name = "iced_tiny_skia"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"cosmic-text", "cosmic-text",
@ -2950,7 +2950,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_wgpu" name = "iced_wgpu"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"as-raw-xcb-connection", "as-raw-xcb-connection",
"bitflags 2.6.0", "bitflags 2.6.0",
@ -2965,7 +2965,7 @@ dependencies = [
"once_cell", "once_cell",
"raw-window-handle", "raw-window-handle",
"resvg", "resvg",
"rustix 0.38.36", "rustix 0.38.37",
"smithay-client-toolkit 0.19.2", "smithay-client-toolkit 0.19.2",
"tiny-xlib", "tiny-xlib",
"wayland-backend", "wayland-backend",
@ -2979,7 +2979,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_widget" name = "iced_widget"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"dnd", "dnd",
"iced_accessibility", "iced_accessibility",
@ -2997,7 +2997,7 @@ dependencies = [
[[package]] [[package]]
name = "iced_winit" name = "iced_winit"
version = "0.12.0" version = "0.12.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"dnd", "dnd",
"iced_accessibility", "iced_accessibility",
@ -3513,7 +3513,7 @@ checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439"
[[package]] [[package]]
name = "libcosmic" name = "libcosmic"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/pop-os/libcosmic.git#2faaeddb059ca17460779430097b19d4c3922b91" source = "git+https://github.com/pop-os/libcosmic.git#c497c227ce806dec84cf66ffcae07745374b1ef8"
dependencies = [ dependencies = [
"apply", "apply",
"ashpd 0.9.1", "ashpd 0.9.1",
@ -3543,7 +3543,7 @@ dependencies = [
"mime 0.3.17", "mime 0.3.17",
"palette", "palette",
"rfd", "rfd",
"rustix 0.38.36", "rustix 0.38.37",
"serde", "serde",
"shlex", "shlex",
"slotmap", "slotmap",
@ -4032,9 +4032,9 @@ dependencies = [
[[package]] [[package]]
name = "notify-rust" name = "notify-rust"
version = "4.11.1" version = "4.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26a1d03b6305ecefdd9c6c60150179bb8d9f0cd4e64bbcad1e41419e7bf5e414" checksum = "5134a72dc570b178bff81b01e81ab14a6fcc015391ed4b3b14853090658cd3a3"
dependencies = [ dependencies = [
"log", "log",
"mac-notification-sys", "mac-notification-sys",
@ -4585,7 +4585,7 @@ dependencies = [
"concurrent-queue", "concurrent-queue",
"hermit-abi 0.4.0", "hermit-abi 0.4.0",
"pin-project-lite", "pin-project-lite",
"rustix 0.38.36", "rustix 0.38.37",
"tracing", "tracing",
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
@ -5060,9 +5060,9 @@ dependencies = [
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "0.38.36" version = "0.38.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"errno", "errno",
@ -5332,7 +5332,7 @@ dependencies = [
"libc", "libc",
"log", "log",
"memmap2 0.9.4", "memmap2 0.9.4",
"rustix 0.38.36", "rustix 0.38.37",
"thiserror", "thiserror",
"wayland-backend", "wayland-backend",
"wayland-client", "wayland-client",
@ -5359,7 +5359,7 @@ dependencies = [
"log", "log",
"memmap2 0.9.4", "memmap2 0.9.4",
"pkg-config", "pkg-config",
"rustix 0.38.36", "rustix 0.38.37",
"thiserror", "thiserror",
"wayland-backend", "wayland-backend",
"wayland-client", "wayland-client",
@ -5431,7 +5431,7 @@ dependencies = [
"objc", "objc",
"raw-window-handle", "raw-window-handle",
"redox_syscall 0.4.1", "redox_syscall 0.4.1",
"rustix 0.38.36", "rustix 0.38.37",
"tiny-xlib", "tiny-xlib",
"wasm-bindgen", "wasm-bindgen",
"wayland-backend", "wayland-backend",
@ -5635,7 +5635,7 @@ dependencies = [
"cfg-if", "cfg-if",
"fastrand 2.1.1", "fastrand 2.1.1",
"once_cell", "once_cell",
"rustix 0.38.36", "rustix 0.38.37",
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
@ -6091,9 +6091,9 @@ checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656"
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.12" version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
[[package]] [[package]]
name = "unicode-linebreak" name = "unicode-linebreak"
@ -6407,7 +6407,7 @@ checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6"
dependencies = [ dependencies = [
"cc", "cc",
"downcast-rs", "downcast-rs",
"rustix 0.38.36", "rustix 0.38.37",
"scoped-tls", "scoped-tls",
"smallvec", "smallvec",
"wayland-sys", "wayland-sys",
@ -6420,7 +6420,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3f45d1222915ef1fd2057220c1d9d9624b7654443ea35c3877f7a52bd0a5a2d" checksum = "e3f45d1222915ef1fd2057220c1d9d9624b7654443ea35c3877f7a52bd0a5a2d"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"rustix 0.38.36", "rustix 0.38.37",
"wayland-backend", "wayland-backend",
"wayland-scanner", "wayland-scanner",
] ]
@ -6442,7 +6442,7 @@ version = "0.31.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a94697e66e76c85923b0d28a0c251e8f0666f58fc47d316c0f4da6da75d37cb" checksum = "3a94697e66e76c85923b0d28a0c251e8f0666f58fc47d316c0f4da6da75d37cb"
dependencies = [ dependencies = [
"rustix 0.38.36", "rustix 0.38.37",
"wayland-client", "wayland-client",
"xcursor", "xcursor",
] ]
@ -6532,7 +6532,7 @@ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"downcast-rs", "downcast-rs",
"io-lifetimes 2.0.3", "io-lifetimes 2.0.3",
"rustix 0.38.36", "rustix 0.38.37",
"wayland-backend", "wayland-backend",
"wayland-scanner", "wayland-scanner",
] ]
@ -7085,7 +7085,7 @@ dependencies = [
"percent-encoding", "percent-encoding",
"raw-window-handle", "raw-window-handle",
"redox_syscall 0.3.5", "redox_syscall 0.3.5",
"rustix 0.38.36", "rustix 0.38.37",
"sctk-adwaita", "sctk-adwaita",
"smithay-client-toolkit 0.18.1", "smithay-client-toolkit 0.18.1",
"smol_str", "smol_str",
@ -7156,7 +7156,7 @@ dependencies = [
"libc", "libc",
"libloading 0.8.5", "libloading 0.8.5",
"once_cell", "once_cell",
"rustix 0.38.36", "rustix 0.38.37",
"x11rb-protocol", "x11rb-protocol",
] ]
@ -7174,7 +7174,7 @@ checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f"
dependencies = [ dependencies = [
"libc", "libc",
"linux-raw-sys 0.4.14", "linux-raw-sys 0.4.14",
"rustix 0.38.36", "rustix 0.38.37",
] ]
[[package]] [[package]]

View file

@ -312,7 +312,6 @@ enum Message {
SearchSubmit, SearchSubmit,
TabMessage(tab::Message), TabMessage(tab::Message),
TabRescan(Vec<tab::Item>), TabRescan(Vec<tab::Item>),
ViewSelect(segmented_button::Entity),
} }
pub struct MounterData(MounterKey, MounterItem); pub struct MounterData(MounterKey, MounterItem);
@ -360,7 +359,6 @@ struct App {
search_input: String, search_input: String,
tab: Tab, tab: Tab,
key_binds: HashMap<KeyBind, Action>, key_binds: HashMap<KeyBind, Action>,
view_model: segmented_button::SingleSelectModel,
watcher_opt: Option<(Debouncer<RecommendedWatcher, FileIdMap>, HashSet<PathBuf>)>, watcher_opt: Option<(Debouncer<RecommendedWatcher, FileIdMap>, HashSet<PathBuf>)>,
} }
@ -588,18 +586,6 @@ impl Application for App {
let mut tab = Tab::new(location, tab_config); let mut tab = Tab::new(location, tab_config);
tab.mode = tab::Mode::Dialog(flags.kind.clone()); tab.mode = tab::Mode::Dialog(flags.kind.clone());
let view_model = segmented_button::SingleSelectModel::builder()
.insert(|b| {
b.icon(widget::icon::from_name("view-grid-symbolic"))
.data(tab::View::Grid)
})
.insert(|b| {
b.icon(widget::icon::from_name("view-list-symbolic"))
.data(tab::View::List)
.activate()
})
.build();
let mut app = App { let mut app = App {
core, core,
flags, flags,
@ -620,7 +606,6 @@ impl Application for App {
search_input: String::new(), search_input: String::new(),
tab, tab,
key_binds: HashMap::new(), key_binds: HashMap::new(),
view_model,
watcher_opt: None, watcher_opt: None,
}; };
@ -1169,13 +1154,6 @@ impl Application for App {
// Reset focus on location change // Reset focus on location change
return widget::text_input::focus(self.filename_id.clone()); return widget::text_input::focus(self.filename_id.clone());
} }
Message::ViewSelect(entity) => match self.view_model.data::<tab::View>(entity) {
Some(view) => {
self.tab.config.view = *view;
self.view_model.activate(entity);
}
None => {}
},
} }
Command::none() Command::none()