fix(dialog): header close button
This commit is contained in:
parent
15e1337e63
commit
19c2cefd8a
2 changed files with 40 additions and 22 deletions
30
Cargo.lock
generated
30
Cargo.lock
generated
|
|
@ -1450,7 +1450,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"atomicwrites",
|
||||
"cosmic-config-derive",
|
||||
|
|
@ -1472,7 +1472,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config-derive"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 2.0.104",
|
||||
|
|
@ -1634,7 +1634,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-theme"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"almost",
|
||||
"cosmic-config",
|
||||
|
|
@ -3134,7 +3134,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced"
|
||||
version = "0.14.0-dev"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"dnd",
|
||||
"iced_accessibility",
|
||||
|
|
@ -3152,7 +3152,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_accessibility"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"accesskit_winit",
|
||||
|
|
@ -3161,7 +3161,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_core"
|
||||
version = "0.14.0-dev"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"bitflags 2.9.1",
|
||||
"bytes",
|
||||
|
|
@ -3185,7 +3185,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_futures"
|
||||
version = "0.14.0-dev"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"iced_core",
|
||||
|
|
@ -3211,7 +3211,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_graphics"
|
||||
version = "0.14.0-dev"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"bitflags 2.9.1",
|
||||
"bytemuck",
|
||||
|
|
@ -3233,7 +3233,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_renderer"
|
||||
version = "0.14.0-dev"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"iced_graphics",
|
||||
"iced_tiny_skia",
|
||||
|
|
@ -3245,7 +3245,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_runtime"
|
||||
version = "0.14.0-dev"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"cosmic-client-toolkit",
|
||||
|
|
@ -3260,7 +3260,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_tiny_skia"
|
||||
version = "0.14.0-dev"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"cosmic-text",
|
||||
|
|
@ -3276,7 +3276,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_wgpu"
|
||||
version = "0.14.0-dev"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"as-raw-xcb-connection",
|
||||
"bitflags 2.9.1",
|
||||
|
|
@ -3307,7 +3307,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_widget"
|
||||
version = "0.14.0-dev"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"cosmic-client-toolkit",
|
||||
"dnd",
|
||||
|
|
@ -3326,7 +3326,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_winit"
|
||||
version = "0.14.0-dev"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"cosmic-client-toolkit",
|
||||
"dnd",
|
||||
|
|
@ -4285,7 +4285,7 @@ checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
|
|||
[[package]]
|
||||
name = "libcosmic"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#aaa4b83577a70c15af8b91d1fb161e2a2931596b"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#50367b96e3bb9a2a2a62a6c51cd71fc2858e61ed"
|
||||
dependencies = [
|
||||
"apply",
|
||||
"ashpd",
|
||||
|
|
|
|||
32
src/app.rs
32
src/app.rs
|
|
@ -299,6 +299,7 @@ impl MenuAction for NavMenuAction {
|
|||
pub enum Message {
|
||||
AddToSidebar(Option<Entity>),
|
||||
AppTheme(AppTheme),
|
||||
CloseId(window::Id),
|
||||
CloseToast(widget::ToastId),
|
||||
Compress(Option<Entity>),
|
||||
Config(Config),
|
||||
|
|
@ -311,6 +312,7 @@ pub enum Message {
|
|||
DesktopViewOptions,
|
||||
DialogCancel,
|
||||
DialogComplete,
|
||||
DragId(window::Id),
|
||||
Eject,
|
||||
FileDialogMessage(DialogMessage),
|
||||
DialogPush(DialogPage),
|
||||
|
|
@ -2396,7 +2398,7 @@ impl Application for App {
|
|||
}
|
||||
Message::DesktopViewOptions => {
|
||||
let mut settings = window::Settings {
|
||||
decorations: true,
|
||||
decorations: false,
|
||||
min_size: Some(Size::new(360.0, 180.0)),
|
||||
resizable: true,
|
||||
size: Size::new(480.0, 444.0),
|
||||
|
|
@ -3246,7 +3248,7 @@ impl Application for App {
|
|||
let mut commands = Vec::with_capacity(selected_paths.len());
|
||||
for path in selected_paths {
|
||||
let mut settings = window::Settings {
|
||||
decorations: true,
|
||||
decorations: false,
|
||||
min_size: Some(Size::new(360.0, 180.0)),
|
||||
resizable: true,
|
||||
size: Size::new(480.0, 600.0),
|
||||
|
|
@ -4276,6 +4278,12 @@ impl Application for App {
|
|||
}
|
||||
}
|
||||
}
|
||||
Message::CloseId(id) => {
|
||||
return window::close(id);
|
||||
}
|
||||
Message::DragId(id) => {
|
||||
return window::drag(id);
|
||||
}
|
||||
}
|
||||
|
||||
Task::none()
|
||||
|
|
@ -5335,11 +5343,21 @@ impl Application for App {
|
|||
}
|
||||
};
|
||||
|
||||
widget::container(widget::scrollable(content))
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.class(theme::Container::WindowBackground)
|
||||
.into()
|
||||
widget::container(
|
||||
widget::column::column()
|
||||
.push(Element::from(
|
||||
widget::header_bar()
|
||||
.on_close(Message::CloseId(id))
|
||||
.on_drag(Message::DragId(id))
|
||||
.build(),
|
||||
))
|
||||
.push(widget::scrollable(content))
|
||||
.width(Length::Fill),
|
||||
)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.class(theme::Container::WindowBackground)
|
||||
.into()
|
||||
}
|
||||
|
||||
fn system_theme_update(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue