Place context drawer on the side of content, part of #109
This commit is contained in:
parent
1d879628f3
commit
55eb21911e
3 changed files with 32 additions and 30 deletions
42
Cargo.lock
generated
42
Cargo.lock
generated
|
|
@ -1212,7 +1212,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"atomicwrites",
|
||||
"cosmic-config-derive",
|
||||
|
|
@ -1231,7 +1231,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config-derive"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
|
|
@ -1340,7 +1340,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-theme"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"almost",
|
||||
"cosmic-config",
|
||||
|
|
@ -2783,7 +2783,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"dnd",
|
||||
"iced_accessibility",
|
||||
|
|
@ -2802,7 +2802,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_accessibility"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"accesskit_unix",
|
||||
|
|
@ -2812,7 +2812,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_core"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"dnd",
|
||||
|
|
@ -2834,7 +2834,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_futures"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"iced_core",
|
||||
|
|
@ -2847,7 +2847,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_graphics"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"bytemuck",
|
||||
|
|
@ -2871,7 +2871,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_renderer"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"iced_graphics",
|
||||
"iced_tiny_skia",
|
||||
|
|
@ -2883,7 +2883,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_runtime"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"dnd",
|
||||
"iced_accessibility",
|
||||
|
|
@ -2897,7 +2897,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_sctk"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"enum-repr",
|
||||
"float-cmp",
|
||||
|
|
@ -2924,7 +2924,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_style"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"iced_core",
|
||||
"once_cell",
|
||||
|
|
@ -2934,7 +2934,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_tiny_skia"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"cosmic-text",
|
||||
|
|
@ -2951,7 +2951,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_wgpu"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"as-raw-xcb-connection",
|
||||
"bitflags 2.6.0",
|
||||
|
|
@ -2980,7 +2980,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_widget"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"dnd",
|
||||
"iced_accessibility",
|
||||
|
|
@ -2998,7 +2998,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_winit"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"dnd",
|
||||
"iced_accessibility",
|
||||
|
|
@ -3514,7 +3514,7 @@ checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439"
|
|||
[[package]]
|
||||
name = "libcosmic"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#a962865230f3b9ecba40c0c09e9c279e832c9f10"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#ddb678ca6966dfdf10911feac5e5ac02d3b2b97e"
|
||||
dependencies = [
|
||||
"apply",
|
||||
"ashpd 0.9.1",
|
||||
|
|
@ -4722,9 +4722,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "quick-xml"
|
||||
version = "0.36.1"
|
||||
version = "0.36.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "96a05e2e8efddfa51a84ca47cec303fac86c8541b686d37cac5efc0e094417bc"
|
||||
checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"serde",
|
||||
|
|
@ -4833,7 +4833,7 @@ dependencies = [
|
|||
"dirs 5.0.1",
|
||||
"infer",
|
||||
"mime_guess",
|
||||
"quick-xml 0.36.1",
|
||||
"quick-xml 0.36.2",
|
||||
"serde",
|
||||
"thiserror",
|
||||
"url",
|
||||
|
|
@ -6540,7 +6540,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quick-xml 0.36.1",
|
||||
"quick-xml 0.36.2",
|
||||
"quote",
|
||||
]
|
||||
|
||||
|
|
|
|||
19
src/app.rs
19
src/app.rs
|
|
@ -1162,6 +1162,7 @@ impl Application for App {
|
|||
|
||||
/// Creates the application, and optionally emits command on initialize.
|
||||
fn init(mut core: Core, flags: Self::Flags) -> (Self, Command<Self::Message>) {
|
||||
core.window.context_is_overlay = false;
|
||||
match flags.mode {
|
||||
Mode::App => {}
|
||||
Mode::Desktop => {
|
||||
|
|
@ -1368,7 +1369,7 @@ impl Application for App {
|
|||
// Usually, the Escape key (for example) closes menus and panes one by one instead
|
||||
// of closing everything on one press
|
||||
if self.core.window.show_context {
|
||||
self.core.window.show_context = false;
|
||||
self.set_show_context(false);
|
||||
return Command::none();
|
||||
}
|
||||
if self.search_active {
|
||||
|
|
@ -1713,7 +1714,7 @@ impl Application for App {
|
|||
Ok(true) => {
|
||||
log::info!("connected to {:?}", uri);
|
||||
if matches!(self.context_page, ContextPage::NetworkDrive) {
|
||||
self.core.window.show_context = false;
|
||||
self.set_show_context(false);
|
||||
}
|
||||
}
|
||||
Ok(false) => {
|
||||
|
|
@ -1882,7 +1883,7 @@ impl Application for App {
|
|||
}
|
||||
|
||||
// Close Open With context view
|
||||
self.core.window.show_context = false;
|
||||
self.set_show_context(false);
|
||||
}
|
||||
Message::OpenInNewTab(entity_opt) => {
|
||||
return Command::batch(self.selected_paths(entity_opt).into_iter().filter_map(
|
||||
|
|
@ -2257,7 +2258,7 @@ impl Application for App {
|
|||
//TODO: move to Command?
|
||||
if let tab::Message::ContextMenu(_point_opt) = tab_message {
|
||||
// Disable side context page
|
||||
self.core.window.show_context = false;
|
||||
self.set_show_context(false);
|
||||
}
|
||||
|
||||
let tab_commands = match self.tab_model.data_mut::<Tab>(entity) {
|
||||
|
|
@ -2274,7 +2275,7 @@ impl Application for App {
|
|||
tab::Command::AddNetworkDrive => {
|
||||
let context_page = ContextPage::NetworkDrive;
|
||||
self.context_page = context_page;
|
||||
self.core.window.show_context = true;
|
||||
self.set_show_context(true);
|
||||
self.set_context_title(context_page.title());
|
||||
}
|
||||
tab::Command::ChangeLocation(tab_title, tab_path, selection_path) => {
|
||||
|
|
@ -2301,7 +2302,7 @@ impl Application for App {
|
|||
tab::Command::LocationProperties(index) => {
|
||||
self.context_page =
|
||||
ContextPage::Properties(Some(ContextItem::BreadCrumbs(index)));
|
||||
self.core.window.show_context = true;
|
||||
self.set_show_context(true);
|
||||
self.set_context_title(self.context_page.title());
|
||||
}
|
||||
tab::Command::MoveToTrash(paths) => {
|
||||
|
|
@ -2402,10 +2403,10 @@ impl Application for App {
|
|||
Message::ToggleContextPage(context_page) => {
|
||||
//TODO: ensure context menus are closed
|
||||
if self.context_page == context_page {
|
||||
self.core.window.show_context = !self.core.window.show_context;
|
||||
self.set_show_context(!self.core.window.show_context);
|
||||
} else {
|
||||
self.context_page = context_page;
|
||||
self.core.window.show_context = true;
|
||||
self.set_show_context(true);
|
||||
}
|
||||
self.set_context_title(context_page.title());
|
||||
}
|
||||
|
|
@ -2625,7 +2626,7 @@ impl Application for App {
|
|||
|
||||
NavMenuAction::Properties(entity) => {
|
||||
self.context_page = ContextPage::Properties(Some(ContextItem::NavBar(entity)));
|
||||
self.core.window.show_context = true;
|
||||
self.set_show_context(true);
|
||||
self.set_context_title(self.context_page.title());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -574,6 +574,7 @@ impl Application for App {
|
|||
|
||||
/// Creates the application, and optionally emits command on initialize.
|
||||
fn init(mut core: Core, flags: Self::Flags) -> (Self, Command<Message>) {
|
||||
core.window.context_is_overlay = false;
|
||||
core.window.show_close = false;
|
||||
core.window.show_maximize = false;
|
||||
core.window.show_minimize = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue