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
@@ -315,6 +315,20 @@ impl App {
|
||||
.padding(12)
|
||||
.class(crate::visuals::surface(palette.card, 14.)),
|
||||
);
|
||||
let mut shell = widget::column([])
|
||||
.spacing(4)
|
||||
.push(self.panel_heading("Shell appearance", 15.));
|
||||
for field in crate::schema::fields(Page::Bar)
|
||||
.into_iter()
|
||||
.filter(|field| field.path.starts_with("theme."))
|
||||
{
|
||||
shell = shell.push(self.field(field));
|
||||
}
|
||||
rows = rows.push(
|
||||
widget::container(shell)
|
||||
.padding(12)
|
||||
.class(crate::visuals::surface(palette.card, 14.)),
|
||||
);
|
||||
}
|
||||
PanelPage::Arrange => return self.panel_workspace(),
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ impl Page {
|
||||
Self::Appearance => "A desktop that feels like yours.",
|
||||
Self::Accessibility => "Make the desktop easier to see and use.",
|
||||
Self::Wallpaper => "Set the scene for your workspace.",
|
||||
Self::Bar => "Arrange panel items and groups.",
|
||||
Self::Bar => "Arrange your panel and change the shell's appearance.",
|
||||
Self::Notifications => "Stay informed on your terms.",
|
||||
Self::LockScreen => "Your desktop, safely put away.",
|
||||
Self::Windows => "Window layouts, spacing and focus effects.",
|
||||
@@ -392,19 +392,6 @@ pub fn fields(page: Page) -> Vec<Field> {
|
||||
"system follows your desktop timezone; or enter an IANA timezone.",
|
||||
"system",
|
||||
),
|
||||
range(
|
||||
"theme.geometry.shell_radius",
|
||||
"Shell corner radius",
|
||||
"Rounds the bar, menus, notifications and hover backgrounds. Window corners are separate.",
|
||||
RangeSpec {
|
||||
default: 14.0,
|
||||
min: 0.0,
|
||||
max: 32.0,
|
||||
step: 1.0,
|
||||
suffix: " px",
|
||||
integer: false,
|
||||
},
|
||||
),
|
||||
text(
|
||||
"theme.accent",
|
||||
"Accent color",
|
||||
@@ -418,37 +405,10 @@ pub fn fields(page: Page) -> Vec<Field> {
|
||||
"auto",
|
||||
&[("auto", "Gradient"), ("solid", "Solid")],
|
||||
),
|
||||
choice(
|
||||
"theme.border.style",
|
||||
"Inactive border style",
|
||||
"Gradients retain the border color's transparency.",
|
||||
"auto",
|
||||
&[("auto", "Gradient"), ("solid", "Solid")],
|
||||
),
|
||||
choice(
|
||||
"theme.material.style",
|
||||
"Surface style",
|
||||
"Choose the finish for the bar and menus.",
|
||||
"solid",
|
||||
&[("solid", "Solid"), ("translucent", "Translucent")],
|
||||
),
|
||||
range(
|
||||
"theme.material.opacity",
|
||||
"Shell opacity",
|
||||
"Background opacity for the bar, popovers, menus, notifications and sharing dialog. Text and icons stay opaque.",
|
||||
RangeSpec {
|
||||
default: ferese_config::DEFAULT_MATERIAL_OPACITY,
|
||||
min: 0.0,
|
||||
max: 1.0,
|
||||
step: 0.01,
|
||||
suffix: "",
|
||||
integer: false,
|
||||
},
|
||||
),
|
||||
range(
|
||||
"theme.material.blur_radius",
|
||||
"Background blur",
|
||||
"Softness behind translucent surfaces.",
|
||||
"Softness behind translucent shell surfaces and windows. Zero disables blur.",
|
||||
RangeSpec {
|
||||
default: 12.0,
|
||||
min: 0.0,
|
||||
@@ -464,19 +424,6 @@ pub fn fields(page: Page) -> Vec<Field> {
|
||||
"Use the name of an installed font family.",
|
||||
"Inter",
|
||||
),
|
||||
range(
|
||||
"theme.geometry.focus_ring_width",
|
||||
"Focus border",
|
||||
"A subtle outline around the active window.",
|
||||
RangeSpec {
|
||||
default: 2.0,
|
||||
min: 0.0,
|
||||
max: 4.0,
|
||||
step: 0.5,
|
||||
suffix: " px",
|
||||
integer: false,
|
||||
},
|
||||
),
|
||||
],
|
||||
Page::Wallpaper => vec![
|
||||
text(
|
||||
@@ -521,6 +468,39 @@ pub fn fields(page: Page) -> Vec<Field> {
|
||||
),
|
||||
],
|
||||
Page::Bar => vec![
|
||||
range(
|
||||
"theme.geometry.shell_radius",
|
||||
"Shell corner radius",
|
||||
"Rounds the bar, menus, notifications and hover backgrounds. Window corners are separate.",
|
||||
RangeSpec {
|
||||
default: 14.0,
|
||||
min: 0.0,
|
||||
max: 32.0,
|
||||
step: 1.0,
|
||||
suffix: " px",
|
||||
integer: false,
|
||||
},
|
||||
),
|
||||
choice(
|
||||
"theme.material.style",
|
||||
"Surface style",
|
||||
"Choose the finish for the panel, launcher, menus and notifications.",
|
||||
"solid",
|
||||
&[("solid", "Solid"), ("translucent", "Translucent")],
|
||||
),
|
||||
range(
|
||||
"theme.material.opacity",
|
||||
"Shell opacity",
|
||||
"Background opacity for the bar, popovers, menus, notifications and sharing dialog. Text and icons stay opaque.",
|
||||
RangeSpec {
|
||||
default: ferese_config::DEFAULT_MATERIAL_OPACITY,
|
||||
min: 0.0,
|
||||
max: 1.0,
|
||||
step: 0.01,
|
||||
suffix: "",
|
||||
integer: false,
|
||||
},
|
||||
),
|
||||
range(
|
||||
"panels.0.geometry.height",
|
||||
"Height",
|
||||
@@ -651,6 +631,32 @@ pub fn fields(page: Page) -> Vec<Field> {
|
||||
integer: false,
|
||||
},
|
||||
),
|
||||
choice(
|
||||
"theme.border.style",
|
||||
"Inactive border style",
|
||||
"Gradients retain the border color's transparency.",
|
||||
"auto",
|
||||
&[("auto", "Gradient"), ("solid", "Solid")],
|
||||
),
|
||||
range(
|
||||
"theme.geometry.focus_ring_width",
|
||||
"Focus border",
|
||||
"A subtle outline around the active window.",
|
||||
RangeSpec {
|
||||
default: 2.0,
|
||||
min: 0.0,
|
||||
max: 4.0,
|
||||
step: 0.5,
|
||||
suffix: " px",
|
||||
integer: false,
|
||||
},
|
||||
),
|
||||
toggle(
|
||||
"input.focus_follows_mouse",
|
||||
"Focus follows pointer",
|
||||
"Focus visible windows without raising or scrolling. Click to bring them into view.",
|
||||
false,
|
||||
),
|
||||
toggle(
|
||||
"appearance.focus_effect.enabled",
|
||||
"Window focus effects",
|
||||
@@ -683,6 +689,12 @@ pub fn fields(page: Page) -> Vec<Field> {
|
||||
integer: false,
|
||||
},
|
||||
),
|
||||
toggle(
|
||||
"appearance.focus_effect.blur",
|
||||
"Window blur",
|
||||
"Soften the background behind translucent windows. Adjust the amount in Appearance.",
|
||||
true,
|
||||
),
|
||||
range(
|
||||
"appearance.focus_effect.inactive_dim",
|
||||
"Inactive window dimming",
|
||||
@@ -770,12 +782,6 @@ pub fn fields(page: Page) -> Vec<Field> {
|
||||
integer: true,
|
||||
},
|
||||
),
|
||||
toggle(
|
||||
"input.focus_follows_mouse",
|
||||
"Focus follows pointer",
|
||||
"Focus visible windows without raising or scrolling. Click to bring them into view.",
|
||||
false,
|
||||
),
|
||||
toggle(
|
||||
"input.touchpad.tap",
|
||||
"Tap to click",
|
||||
|
||||
@@ -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