summaryrefslogtreecommitdiffstats
path: root/native/src/widget/combo_box.rs
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/widget/combo_box.rs')
-rw-r--r--native/src/widget/combo_box.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/native/src/widget/combo_box.rs b/native/src/widget/combo_box.rs
index f6da076a..84789789 100644
--- a/native/src/widget/combo_box.rs
+++ b/native/src/widget/combo_box.rs
@@ -17,6 +17,7 @@ where
width: Length,
padding: u16,
text_size: Option<u16>,
+ font: Renderer::Font,
style: <Renderer as self::Renderer>::Style,
}
@@ -45,7 +46,8 @@ where
width: Length::Shrink,
text_size: None,
padding: Renderer::DEFAULT_PADDING,
- style: <Renderer as self::Renderer>::Style::default(),
+ font: Default::default(),
+ style: Default::default(),
}
}
@@ -70,6 +72,11 @@ where
self
}
+ pub fn font(mut self, font: Renderer::Font) -> Self {
+ self.font = font;
+ self
+ }
+
/// Sets the style of the [`ComboBox`].
///
/// [`ComboBox`]: struct.ComboBox.html
@@ -200,8 +207,9 @@ where
layout.bounds(),
cursor_position,
self.selected.as_ref().map(ToString::to_string),
- self.text_size.unwrap_or(renderer.default_size()),
self.padding,
+ self.text_size.unwrap_or(renderer.default_size()),
+ self.font,
&self.style,
)
}
@@ -244,8 +252,9 @@ pub trait Renderer: text::Renderer + menu::Renderer {
bounds: Rectangle,
cursor_position: Point,
selected: Option<String>,
- text_size: u16,
padding: u16,
+ text_size: u16,
+ font: Self::Font,
style: &<Self as Renderer>::Style,
) -> Self::Output;
}