git_ui: Update git panel commit editor, start on quick commit

- Fixes commit editor issues & updates style
- Starts on quick commit (not hooked up to anything)
- Updates some panel styles
- Adds SwitchWithLabel
- 
Release Notes:

- N/A
This commit is contained in:
Nate Butler 2025-02-10 10:52:09 -05:00 committed by GitHub
parent 69d415c8d0
commit de8d4d00ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 586 additions and 120 deletions

View file

@ -22,6 +22,7 @@ pub struct IconButton {
icon_size: IconSize,
icon_color: Color,
selected_icon: Option<IconName>,
selected_icon_color: Option<Color>,
indicator: Option<Indicator>,
indicator_border_color: Option<Hsla>,
alpha: Option<f32>,
@ -36,6 +37,7 @@ impl IconButton {
icon_size: IconSize::default(),
icon_color: Color::Default,
selected_icon: None,
selected_icon_color: None,
indicator: None,
indicator_border_color: None,
alpha: None,
@ -69,6 +71,12 @@ impl IconButton {
self
}
/// Sets the icon color used when the button is in a selected state.
pub fn selected_icon_color(mut self, color: impl Into<Option<Color>>) -> Self {
self.selected_icon_color = color.into();
self
}
pub fn indicator(mut self, indicator: Indicator) -> Self {
self.indicator = Some(indicator);
self
@ -181,6 +189,7 @@ impl RenderOnce for IconButton {
.disabled(is_disabled)
.toggle_state(is_selected)
.selected_icon(self.selected_icon)
.selected_icon_color(self.selected_icon_color)
.when_some(selected_style, |this, style| this.selected_style(style))
.when_some(self.indicator, |this, indicator| {
this.indicator(indicator)