Tweaking highlight color and focus ring drawing

This commit is contained in:
Jonathan Johnson 2023-11-12 07:24:59 -08:00
parent 9182b04c0d
commit b3bef345a5
No known key found for this signature in database
GPG key ID: A66D6A34D6620579
4 changed files with 5 additions and 5 deletions

View file

@ -473,7 +473,7 @@ impl<'context, 'window, 'clip, 'gfx, 'pass> GraphicsContext<'context, 'window, '
}
let color = styles.get(&HighlightColor, self);
self.stroke_outline::<Lp>(color, StrokeOptions::default());
self.stroke_outline::<Lp>(color, StrokeOptions::lp_wide(Lp::points(2)));
}
/// Renders the default focus ring for this widget.

View file

@ -28,7 +28,7 @@ macro_rules! define_components {
impl ComponentDefinition for $component {
type ComponentType = $type;
define_components!($type, $($default)*);
}
};
@ -144,7 +144,7 @@ impl ComponentDefinition for HighlightColor {
type ComponentType = Color;
fn default_value(&self, context: &WidgetContext<'_, '_>) -> Color {
context.theme().primary.color
context.theme().primary.color.with_alpha(128)
}
}

View file

@ -3,7 +3,7 @@ use crate::value::{IntoValue, Value};
use crate::widget::{MakeWidget, WidgetRef, WrapperWidget};
use crate::window::ThemeMode;
/// A widget that applies a set of [`Styles`] to all contained widgets.
/// A widget that applies a set of [`ThemeMode`] to all contained widgets.
#[derive(Debug)]
pub struct ModeSwitch {
mode: Value<ThemeMode>,

View file

@ -3,7 +3,7 @@ use crate::styles::ThemePair;
use crate::value::{IntoValue, Value};
use crate::widget::{MakeWidget, WidgetRef, WrapperWidget};
/// A widget that applies a set of [`Styles`] to all contained widgets.
/// A widget that applies a [`ThemePair`] to all contained widgets.
#[derive(Debug)]
pub struct Themed {
theme: Value<ThemePair>,