Skip to content

Commit

Permalink
Tweaking highlight color and focus ring drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
ecton committed Nov 12, 2023
1 parent 9182b04 commit b3bef34
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/styles/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ macro_rules! define_components {

impl ComponentDefinition for $component {
type ComponentType = $type;

define_components!($type, $($default)*);
}
};
Expand Down Expand Up @@ -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)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/mode_switch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/themed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down

0 comments on commit b3bef34

Please sign in to comment.