Unify shell corner radius and speed up Settings page switching
This commit is contained in:
1 parent
ef912daeba
commit
e5e2b74a25
10 files changed
+164
-91
No files matched your search
@@ -1109,10 +1109,20 @@ impl App {
|
||||
column([])
|
||||
.spacing(6)
|
||||
.push(
|
||||
widget::dropdown(families, selected, move |index| {
|
||||
let family = if index == 0 { "" } else { &families[index] };
|
||||
Message::SelectFont(selection_path.clone(), family.to_owned())
|
||||
})
|
||||
cosmic::iced::widget::pick_list(
|
||||
families,
|
||||
selected.map(|index| families[index].clone()),
|
||||
move |family: String| {
|
||||
let value = if family == "Default font" {
|
||||
String::new()
|
||||
} else {
|
||||
family
|
||||
};
|
||||
Message::SelectFont(selection_path.clone(), value)
|
||||
},
|
||||
)
|
||||
.font(self.font)
|
||||
.text_size(12)
|
||||
.width(225),
|
||||
)
|
||||
.push(
|
||||
|
||||
@@ -376,17 +376,6 @@ fn clock_fields() -> Vec<Field> {
|
||||
" px",
|
||||
false,
|
||||
),
|
||||
range(
|
||||
"desktop_widgets.clock.radius",
|
||||
"Background radius",
|
||||
"Used only when a background is set.",
|
||||
16.0,
|
||||
0.0,
|
||||
128.0,
|
||||
1.0,
|
||||
" px",
|
||||
false,
|
||||
),
|
||||
choice(
|
||||
"desktop_widgets.clock.alignment",
|
||||
"Text alignment",
|
||||
@@ -541,17 +530,6 @@ pub fn note_fields(index: usize) -> Vec<Field> {
|
||||
" px",
|
||||
false,
|
||||
),
|
||||
range(
|
||||
format!("{prefix}.radius"),
|
||||
"Corner radius",
|
||||
"Logical pixels; centered axes ignore margins.",
|
||||
16.0,
|
||||
0.0,
|
||||
128.0,
|
||||
1.0,
|
||||
" px",
|
||||
false,
|
||||
),
|
||||
Field::new(
|
||||
format!("{prefix}.alignment"),
|
||||
"Text alignment",
|
||||
@@ -567,6 +545,17 @@ pub fn note_fields(index: usize) -> Vec<Field> {
|
||||
pub fn fields(page: Page) -> Vec<Field> {
|
||||
match page {
|
||||
Page::Appearance => vec![
|
||||
range(
|
||||
"theme.geometry.shell_radius",
|
||||
"Shell corner radius",
|
||||
"Rounds the bar, menus, notifications, desktop widgets and hover backgrounds. Window corners are separate.",
|
||||
14.0,
|
||||
0.0,
|
||||
32.0,
|
||||
1.0,
|
||||
" px",
|
||||
false,
|
||||
),
|
||||
text(
|
||||
"theme.colors.accent",
|
||||
"Accent color",
|
||||
@@ -690,17 +679,6 @@ pub fn fields(page: Page) -> Vec<Field> {
|
||||
" px",
|
||||
true,
|
||||
),
|
||||
range(
|
||||
"theme.geometry.top_bar_radius",
|
||||
"Corner radius",
|
||||
"The shape of the floating bar.",
|
||||
0.0,
|
||||
0.0,
|
||||
24.0,
|
||||
1.0,
|
||||
" px",
|
||||
false,
|
||||
),
|
||||
range(
|
||||
"theme.surface.bar.opacity",
|
||||
"Opacity",
|
||||
|
||||
@@ -438,7 +438,7 @@ pub fn preview(snapshot: &Snapshot) -> Element<'static, Message> {
|
||||
let bar_y = snapshot.number("theme.geometry.top_bar_margin_top", 0.) * 0.5 + 12.;
|
||||
let bar_margin = snapshot.number("theme.geometry.top_bar_margin_horizontal", 0.) * 0.5 + 14.;
|
||||
let bar_height = snapshot.number("theme.geometry.top_bar_height", 30.) * 0.65;
|
||||
let bar_radius = snapshot.number("theme.geometry.top_bar_radius", 0.) * 0.65;
|
||||
let bar_radius = snapshot.number("theme.geometry.shell_radius", 14.) * 0.65;
|
||||
let opacity = snapshot.number("theme.surface.bar.opacity", 0.78);
|
||||
let right = 340. + gap / 2.;
|
||||
let left_width = 288. - gap / 2.;
|
||||
|
||||
Reference in new issue
Block a user