Add window blur, organize Settings, and reduce launcher memory
This commit is contained in:
1 parent
bbc2f226d8
commit
07a8e50f47
17 files changed
+260
-88
No files matched your search
@@ -33,7 +33,6 @@ pub(super) enum Message {
|
||||
pub(super) struct Launcher {
|
||||
pub id: window::Id,
|
||||
pub(super) output: String,
|
||||
top: f32,
|
||||
input: cosmic::widget::Id,
|
||||
query: String,
|
||||
category: Option<Category>,
|
||||
@@ -138,7 +137,13 @@ impl FereseShell {
|
||||
};
|
||||
let name = output.name.clone().unwrap_or(name);
|
||||
let wl_output = output.output.clone();
|
||||
let top = output.size.map_or(240., |(_, h)| h as f32 * 0.3);
|
||||
let (output_width, output_height) = output.size.unwrap_or((1920, 1080));
|
||||
// Reserve the largest browse view once, avoiding buffer reallocations during springs.
|
||||
let width = 720u32.min(output_width.max(1) as u32);
|
||||
let height = 404u32.min((output_height - 32).max(1) as u32);
|
||||
let top = ((output_height as f32 * 0.3) as i32)
|
||||
.min(output_height - height as i32 - 16)
|
||||
.max(0);
|
||||
let dismissed = Task::batch([self.destroy_menu(), self.destroy_system_modal(true)]);
|
||||
let id = window::Id::unique();
|
||||
let mut progress = AnimatedValue::new(0.);
|
||||
@@ -151,7 +156,6 @@ impl FereseShell {
|
||||
self.launcher = Some(Launcher {
|
||||
id,
|
||||
output: name,
|
||||
top,
|
||||
input: cosmic::widget::Id::unique(),
|
||||
query: String::new(),
|
||||
category: None,
|
||||
@@ -191,11 +195,15 @@ impl FereseShell {
|
||||
id,
|
||||
layer: Layer::Overlay,
|
||||
keyboard_interactivity: KeyboardInteractivity::Exclusive,
|
||||
anchor: Anchor::TOP | Anchor::BOTTOM | Anchor::LEFT | Anchor::RIGHT,
|
||||
anchor: Anchor::TOP,
|
||||
output: IcedOutput::Output(wl_output.clone()),
|
||||
namespace: "ferese-launcher".into(),
|
||||
exclusive_zone: -1,
|
||||
size: Some((None, None)),
|
||||
size: Some((Some(width), Some(height))),
|
||||
margin: IcedMargin {
|
||||
top,
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
},
|
||||
Some(Box::new(move |app| app.view_launcher(id))),
|
||||
|
||||
@@ -484,15 +484,6 @@ impl FereseShell {
|
||||
}
|
||||
body = body.push(container(rows).padding([0, 12]));
|
||||
}
|
||||
let available_height = self
|
||||
.outputs
|
||||
.iter()
|
||||
.find(|o| o.name.as_deref() == Some(&launcher.output))
|
||||
.and_then(|o| o.size)
|
||||
.map(|(_, h)| h as f32);
|
||||
let top = available_height.map_or(launcher.top, |h| {
|
||||
(h * 0.3).min(h - launcher.height.current as f32 - 16.).max(16.)
|
||||
});
|
||||
let mut background = color_with_opacity(self.config.theme.surface_popover, opacity);
|
||||
if self.config.theme.high_contrast || self.config.theme.reduce_transparency {
|
||||
background.a = opacity;
|
||||
@@ -521,11 +512,7 @@ impl FereseShell {
|
||||
launcher.regions.clone(),
|
||||
))
|
||||
.width(Length::Fill)
|
||||
.align_x(cosmic::iced::Alignment::Center)
|
||||
.padding(cosmic::iced::Padding {
|
||||
top,
|
||||
..Default::default()
|
||||
});
|
||||
.align_x(cosmic::iced::Alignment::Center);
|
||||
let dismiss = message(Message::Dismiss(id));
|
||||
let backdrop = mouse_area(Space::new().width(Length::Fill).height(Length::Fill))
|
||||
.on_press(dismiss.clone())
|
||||
|
||||
Reference in new issue
Block a user