From 69ac47f463fd5c392f1f8e788fcf89b1a76abcae Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 8 Jul 2020 07:04:20 +0200 Subject: Implement `font` method for `ComboBox` --- graphics/src/overlay/menu.rs | 5 +++-- graphics/src/widget/combo_box.rs | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'graphics/src') diff --git a/graphics/src/overlay/menu.rs b/graphics/src/overlay/menu.rs index 914baa6a..89a9cd03 100644 --- a/graphics/src/overlay/menu.rs +++ b/graphics/src/overlay/menu.rs @@ -43,8 +43,9 @@ where cursor_position: Point, options: &[T], hovered_option: Option, - 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 { diff --git a/graphics/src/widget/combo_box.rs b/graphics/src/widget/combo_box.rs index 078b5def..e7ed4e04 100644 --- a/graphics/src/widget/combo_box.rs +++ b/graphics/src/widget/combo_box.rs @@ -29,8 +29,9 @@ where bounds: Rectangle, cursor_position: Point, selected: Option, - text_size: u16, padding: u16, + text_size: u16, + font: Font, style: &Box, ) -> 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), -- cgit