chore: update subsurface settings
This commit is contained in:
parent
31d676a4f2
commit
44cf45ad4d
1 changed files with 15 additions and 5 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
use cosmic::app::Core;
|
use cosmic::app::Core;
|
||||||
|
use cosmic::cctk::wayland_protocols::xdg::shell::client::xdg_positioner::Gravity;
|
||||||
use cosmic::iced::event::listen_with;
|
use cosmic::iced::event::listen_with;
|
||||||
use cosmic::iced::window::Id;
|
use cosmic::iced::window::Id;
|
||||||
use cosmic::iced::{self, Length, Limits, Task};
|
use cosmic::iced::{self, Length, Limits, Task};
|
||||||
|
|
@ -209,15 +210,24 @@ impl cosmic::Application for Window {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|_| {
|
|layout| {
|
||||||
|
let bounds = layout.bounds();
|
||||||
|
let pos = bounds.position();
|
||||||
|
let size = bounds.size();
|
||||||
|
|
||||||
cosmic::app::message::subsurface(
|
cosmic::app::message::subsurface(
|
||||||
|app: &mut Window| subsurface::SctkSubsurfaceSettings {
|
move |app: &mut Window| subsurface::SctkSubsurfaceSettings {
|
||||||
parent: window::Id::RESERVED,
|
parent: window::Id::RESERVED,
|
||||||
id: app.subsurface_id,
|
id: app.subsurface_id,
|
||||||
loc: iced_core::Point { x: -100., y: 0. },
|
loc: iced::Point {
|
||||||
size: Some((10., 10.).into()),
|
x: bounds.width / 2.,
|
||||||
|
y: bounds.height,
|
||||||
|
},
|
||||||
|
size: None,
|
||||||
z: 1,
|
z: 1,
|
||||||
steal_keyboard_focus: true,
|
steal_keyboard_focus: false,
|
||||||
|
offset: (0, 0),
|
||||||
|
gravity: Gravity::Bottom,
|
||||||
},
|
},
|
||||||
Some(Box::new(|_: &'_ Window| {
|
Some(Box::new(|_: &'_ Window| {
|
||||||
Element::from(autosize::autosize(
|
Element::from(autosize::autosize(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue