Tweak hyperlink color
This commit is contained in:
parent
dd2f50e8ed
commit
75e2752a47
2 changed files with 7 additions and 1 deletions
|
@ -129,6 +129,9 @@ pub struct Visuals {
|
||||||
/// needs to look different from other interactive stuff.
|
/// needs to look different from other interactive stuff.
|
||||||
pub dark_bg_color: Srgba, // TODO: remove, rename, or clarify what it is for
|
pub dark_bg_color: Srgba, // TODO: remove, rename, or clarify what it is for
|
||||||
|
|
||||||
|
/// The color used for `Hyperlink`,
|
||||||
|
pub hyperlink_color: Srgba,
|
||||||
|
|
||||||
pub window_corner_radius: f32,
|
pub window_corner_radius: f32,
|
||||||
|
|
||||||
pub resize_corner_size: f32,
|
pub resize_corner_size: f32,
|
||||||
|
@ -270,6 +273,7 @@ impl Default for Visuals {
|
||||||
widgets: Default::default(),
|
widgets: Default::default(),
|
||||||
selection: Default::default(),
|
selection: Default::default(),
|
||||||
dark_bg_color: Srgba::black_alpha(140),
|
dark_bg_color: Srgba::black_alpha(140),
|
||||||
|
hyperlink_color: Srgba::from_rgb(90, 170, 255),
|
||||||
window_corner_radius: 10.0,
|
window_corner_radius: 10.0,
|
||||||
resize_corner_size: 12.0,
|
resize_corner_size: 12.0,
|
||||||
text_cursor_width: 2.0,
|
text_cursor_width: 2.0,
|
||||||
|
@ -473,6 +477,7 @@ impl Visuals {
|
||||||
widgets,
|
widgets,
|
||||||
selection,
|
selection,
|
||||||
dark_bg_color,
|
dark_bg_color,
|
||||||
|
hyperlink_color,
|
||||||
window_corner_radius,
|
window_corner_radius,
|
||||||
resize_corner_size,
|
resize_corner_size,
|
||||||
text_cursor_width,
|
text_cursor_width,
|
||||||
|
@ -485,6 +490,7 @@ impl Visuals {
|
||||||
ui.collapsing("widgets", |ui| widgets.ui(ui));
|
ui.collapsing("widgets", |ui| widgets.ui(ui));
|
||||||
ui.collapsing("selection", |ui| selection.ui(ui));
|
ui.collapsing("selection", |ui| selection.ui(ui));
|
||||||
ui_color(ui, dark_bg_color, "dark_bg_color");
|
ui_color(ui, dark_bg_color, "dark_bg_color");
|
||||||
|
ui_color(ui, hyperlink_color, "hyperlink_color");
|
||||||
ui.add(Slider::f32(window_corner_radius, 0.0..=20.0).text("window_corner_radius"));
|
ui.add(Slider::f32(window_corner_radius, 0.0..=20.0).text("window_corner_radius"));
|
||||||
ui.add(Slider::f32(resize_corner_size, 0.0..=20.0).text("resize_corner_size"));
|
ui.add(Slider::f32(resize_corner_size, 0.0..=20.0).text("resize_corner_size"));
|
||||||
ui.add(Slider::f32(text_cursor_width, 0.0..=2.0).text("text_cursor_width"));
|
ui.add(Slider::f32(text_cursor_width, 0.0..=2.0).text("text_cursor_width"));
|
||||||
|
|
|
@ -257,7 +257,6 @@ impl Widget for Hyperlink {
|
||||||
text,
|
text,
|
||||||
text_style,
|
text_style,
|
||||||
} = self;
|
} = self;
|
||||||
let color = color::LIGHT_BLUE;
|
|
||||||
let text_style = text_style.unwrap_or_else(|| ui.style().body_text_style);
|
let text_style = text_style.unwrap_or_else(|| ui.style().body_text_style);
|
||||||
let font = &ui.fonts()[text_style];
|
let font = &ui.fonts()[text_style];
|
||||||
let galley = font.layout_multiline(text, ui.available_width());
|
let galley = font.layout_multiline(text, ui.available_width());
|
||||||
|
@ -272,6 +271,7 @@ impl Widget for Hyperlink {
|
||||||
ui.ctx().output().open_url = Some(url.clone());
|
ui.ctx().output().open_url = Some(url.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let color = ui.style().visuals.hyperlink_color;
|
||||||
let visuals = ui.style().interact(&response);
|
let visuals = ui.style().interact(&response);
|
||||||
|
|
||||||
if response.hovered {
|
if response.hovered {
|
||||||
|
|
Loading…
Reference in a new issue