print: Add libadwaita-rs features missing upstream

This should be reverted when porting to new release that
supports those features.

Part-of: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/240>
This commit is contained in:
Sophie Herold 2023-07-16 22:20:30 +02:00 • committed by Christopher Davis
parent 8dcf208d70
commit ae23db6967

View file

@ -464,3 +464,26 @@ impl LpPrint {
cairo_context.paint().unwrap();
}
}
trait AdwSpinRowExt {
fn set_range(&self, min: f64, max: f64);
}
use glib::translate::*;
impl AdwSpinRowExt for adw::SpinRow {
fn set_range(&self, min: f64, max: f64) {
unsafe {
adw_spin_row_set_range(self.to_glib_none().0, min, max);
}
}
}
#[link(name = "adwaita-1")]
extern "C" {
pub fn adw_spin_row_set_range(
self_: *mut adw::ffi::AdwSpinRow,
min: std::ffi::c_double,
max: std::ffi::c_double,
);
}