gtk/style_context.rs
1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::StateFlags;
4use crate::StyleContext;
5use crate::prelude::*;
6use pango::FontDescription;
7
8mod sealed {
9 pub trait Sealed {}
10 impl<T: glib::object::IsA<crate::StyleContext>> Sealed for T {}
11}
12
13pub trait StyleContextExtManual: IsA<StyleContext> + sealed::Sealed + 'static {
14 #[doc(alias = "get_font")]
15 fn font(&self, state: StateFlags) -> FontDescription {
16 self.style_property_for_state("font", state)
17 .get()
18 .expect("font property is not pango::FontDescription")
19 }
20}
21
22impl<O: IsA<StyleContext>> StyleContextExtManual for O {}