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

View file

@ -312,7 +312,6 @@ enum Message {
SearchSubmit,
TabMessage(tab::Message),
TabRescan(Vec<tab::Item>),
ViewSelect(segmented_button::Entity),
}
pub struct MounterData(MounterKey, MounterItem);
@ -360,7 +359,6 @@ struct App {
search_input: String,
tab: Tab,
key_binds: HashMap<KeyBind, Action>,
view_model: segmented_button::SingleSelectModel,
watcher_opt: Option<(Debouncer<RecommendedWatcher, FileIdMap>, HashSet<PathBuf>)>,
}
@ -588,18 +586,6 @@ impl Application for App {
let mut tab = Tab::new(location, tab_config);
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 {
core,
flags,
@ -620,7 +606,6 @@ impl Application for App {
search_input: String::new(),
tab,
key_binds: HashMap::new(),
view_model,
watcher_opt: None,
};
@ -1169,13 +1154,6 @@ impl Application for App {
// Reset focus on location change
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()