forked from 1b-agent/opencadstudio-upstream
fix(form): unify style manager field styling
This commit is contained in:
1 parent
ddbfb8f72b
commit
42ba7f12a0
7 files changed
+23
-107
No files matched your search
@@ -8,7 +8,7 @@
|
||||
use crate::app::Message;
|
||||
use crate::t;
|
||||
use crate::ui::style::common::muted_style;
|
||||
use crate::ui::style::form::{dialog_button, form_radio};
|
||||
use crate::ui::style::form::{dialog_button, field_style_with_radius, form_radio};
|
||||
use iced::widget::{button, canvas, column, container, row, text, text_input, Space};
|
||||
use iced::{mouse, Background, Border, Element, Length, Point, Rectangle, Size, Theme};
|
||||
use std::borrow::Cow;
|
||||
@@ -119,26 +119,6 @@ fn cell<'a>(value: i16, selected: bool) -> Element<'a, Message> {
|
||||
.into()
|
||||
}
|
||||
|
||||
fn field_style(theme: &Theme, status: text_input::Status) -> text_input::Style {
|
||||
let palette = theme.palette();
|
||||
let border = match status {
|
||||
text_input::Status::Focused { .. } => palette.primary.base.color,
|
||||
_ => palette.background.neutral.color,
|
||||
};
|
||||
text_input::Style {
|
||||
background: Background::Color(palette.background.base.color),
|
||||
border: Border {
|
||||
color: border,
|
||||
width: 1.0,
|
||||
radius: 4.0.into(),
|
||||
},
|
||||
icon: palette.background.base.text,
|
||||
placeholder: palette.background.base.text.scale_alpha(0.48),
|
||||
value: palette.background.base.text,
|
||||
selection: palette.primary.base.color.scale_alpha(0.5),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn view_window<'a>(
|
||||
pdmode: i16,
|
||||
relative: bool,
|
||||
@@ -164,7 +144,7 @@ pub fn view_window<'a>(
|
||||
text_input("0", size_buf)
|
||||
.on_input(Message::PointStyleSizeInput)
|
||||
.on_submit(Message::PointStyleApplySize)
|
||||
.style(field_style)
|
||||
.style(|theme, status| field_style_with_radius(theme, status, 4.0))
|
||||
.size(13)
|
||||
.width(110),
|
||||
Space::new().width(6),
|
||||
|
||||
Reference in new issue
Block a user