Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f720fa00f4 | ||
|
|
1f5da251dc |
No files matched your search
+967
-68
File diff suppressed because it is too large.
Load diff
+32
-9
@@ -8,7 +8,7 @@ use std::env;
|
|||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use iced::widget::container;
|
use iced::widget::{button, container};
|
||||||
use iced::{Border, Color, Theme};
|
use iced::{Border, Color, Theme};
|
||||||
|
|
||||||
/// Accent red used for destructive/close affordances in both themes.
|
/// Accent red used for destructive/close affordances in both themes.
|
||||||
@@ -131,6 +131,37 @@ pub fn tab(theme: &Theme, active: bool) -> container::Style {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Style for the currently selected option in a group of choice buttons.
|
||||||
|
pub fn selected_option(theme: &Theme, _status: button::Status) -> button::Style {
|
||||||
|
let palette = theme.extended_palette();
|
||||||
|
|
||||||
|
button::Style {
|
||||||
|
background: Some(palette.primary.base.color.into()),
|
||||||
|
text_color: palette.primary.base.text,
|
||||||
|
border: Border {
|
||||||
|
color: palette.primary.base.color,
|
||||||
|
width: 1.0,
|
||||||
|
radius: 4.0.into(),
|
||||||
|
},
|
||||||
|
..button::Style::default()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Style for an unselected choice button: outlined so it reads as a button
|
||||||
|
/// rather than a plain text label.
|
||||||
|
pub fn outlined_option(theme: &Theme, status: button::Status) -> button::Style {
|
||||||
|
let palette = theme.extended_palette();
|
||||||
|
|
||||||
|
button::Style {
|
||||||
|
border: Border {
|
||||||
|
color: palette.background.strong.color,
|
||||||
|
width: 1.0,
|
||||||
|
radius: 4.0.into(),
|
||||||
|
},
|
||||||
|
..button::text(theme, status)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Style for the settings window frame.
|
/// Style for the settings window frame.
|
||||||
pub fn settings_frame(theme: &Theme) -> container::Style {
|
pub fn settings_frame(theme: &Theme) -> container::Style {
|
||||||
let palette = theme.extended_palette();
|
let palette = theme.extended_palette();
|
||||||
@@ -146,14 +177,6 @@ pub fn settings_frame(theme: &Theme) -> container::Style {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Style for a label that sits over the outline of an input.
|
|
||||||
pub fn field_label(theme: &Theme) -> container::Style {
|
|
||||||
container::Style {
|
|
||||||
background: Some(theme.extended_palette().background.weak.color.into()),
|
|
||||||
..container::Style::default()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::Preference;
|
use super::Preference;
|
||||||
|
|||||||
Reference in new issue
Block a user