Implement font method for ComboBox
This commit is contained in:
parent
1c12bad866
commit
69ac47f463
4 changed files with 39 additions and 37 deletions
|
|
@ -43,8 +43,9 @@ where
|
|||
cursor_position: Point,
|
||||
options: &[T],
|
||||
hovered_option: Option<usize>,
|
||||
text_size: u16,
|
||||
padding: u16,
|
||||
text_size: u16,
|
||||
font: Font,
|
||||
style: &Style,
|
||||
) -> Self::Output {
|
||||
use std::f32;
|
||||
|
|
@ -83,7 +84,7 @@ where
|
|||
..bounds
|
||||
},
|
||||
size: f32::from(text_size),
|
||||
font: Font::Default,
|
||||
font,
|
||||
color: if is_selected {
|
||||
style.selected_text_color
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -29,8 +29,9 @@ where
|
|||
bounds: Rectangle,
|
||||
cursor_position: Point,
|
||||
selected: Option<String>,
|
||||
text_size: u16,
|
||||
padding: u16,
|
||||
text_size: u16,
|
||||
font: Font,
|
||||
style: &Box<dyn StyleSheet>,
|
||||
) -> Self::Output {
|
||||
let is_mouse_over = bounds.contains(cursor_position);
|
||||
|
|
@ -69,7 +70,7 @@ where
|
|||
let label = Primitive::Text {
|
||||
content: label,
|
||||
size: f32::from(text_size),
|
||||
font: Font::Default,
|
||||
font,
|
||||
color: style.text_color,
|
||||
bounds: Rectangle {
|
||||
x: bounds.x + f32::from(padding),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue