mirror of
https://github.com/danbulant/cushy
synced 2026-06-07 08:32:14 +00:00
Tweaking highlight color and focus ring drawing
This commit is contained in:
parent
9182b04c0d
commit
b3bef345a5
4 changed files with 5 additions and 5 deletions
|
|
@ -473,7 +473,7 @@ impl<'context, 'window, 'clip, 'gfx, 'pass> GraphicsContext<'context, 'window, '
|
||||||
}
|
}
|
||||||
|
|
||||||
let color = styles.get(&HighlightColor, self);
|
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.
|
/// Renders the default focus ring for this widget.
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ macro_rules! define_components {
|
||||||
|
|
||||||
impl ComponentDefinition for $component {
|
impl ComponentDefinition for $component {
|
||||||
type ComponentType = $type;
|
type ComponentType = $type;
|
||||||
|
|
||||||
define_components!($type, $($default)*);
|
define_components!($type, $($default)*);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -144,7 +144,7 @@ impl ComponentDefinition for HighlightColor {
|
||||||
type ComponentType = Color;
|
type ComponentType = Color;
|
||||||
|
|
||||||
fn default_value(&self, context: &WidgetContext<'_, '_>) -> Color {
|
fn default_value(&self, context: &WidgetContext<'_, '_>) -> Color {
|
||||||
context.theme().primary.color
|
context.theme().primary.color.with_alpha(128)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ use crate::value::{IntoValue, Value};
|
||||||
use crate::widget::{MakeWidget, WidgetRef, WrapperWidget};
|
use crate::widget::{MakeWidget, WidgetRef, WrapperWidget};
|
||||||
use crate::window::ThemeMode;
|
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)]
|
#[derive(Debug)]
|
||||||
pub struct ModeSwitch {
|
pub struct ModeSwitch {
|
||||||
mode: Value<ThemeMode>,
|
mode: Value<ThemeMode>,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ use crate::styles::ThemePair;
|
||||||
use crate::value::{IntoValue, Value};
|
use crate::value::{IntoValue, Value};
|
||||||
use crate::widget::{MakeWidget, WidgetRef, WrapperWidget};
|
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)]
|
#[derive(Debug)]
|
||||||
pub struct Themed {
|
pub struct Themed {
|
||||||
theme: Value<ThemePair>,
|
theme: Value<ThemePair>,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue