mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-22 07:08:42 -06:00
stuff
This commit is contained in:
parent
3f99151d93
commit
03f1d75d3c
|
@ -1,4 +1,4 @@
|
||||||
// "The essentials":
|
// Layout stuff:
|
||||||
|
|
||||||
#[cfg(feature = "builtin_container")]
|
#[cfg(feature = "builtin_container")]
|
||||||
pub mod container;
|
pub mod container;
|
||||||
|
@ -12,7 +12,7 @@ pub mod spacer;
|
||||||
#[cfg(feature = "builtin_elements")]
|
#[cfg(feature = "builtin_elements")]
|
||||||
pub mod br;
|
pub mod br;
|
||||||
|
|
||||||
// "The basics":
|
// Basic elements:
|
||||||
|
|
||||||
#[cfg(feature = "builtin_elements")]
|
#[cfg(feature = "builtin_elements")]
|
||||||
pub mod text;
|
pub mod text;
|
||||||
|
@ -20,9 +20,15 @@ pub mod text;
|
||||||
#[cfg(feature = "builtin_elements")]
|
#[cfg(feature = "builtin_elements")]
|
||||||
pub mod image;
|
pub mod image;
|
||||||
|
|
||||||
|
// "Extras":
|
||||||
|
// (meant to be replaced if needed)
|
||||||
|
|
||||||
#[cfg(feature = "builtin_elements")]
|
#[cfg(feature = "builtin_elements")]
|
||||||
pub mod progress_bar;
|
pub mod progress_bar;
|
||||||
|
|
||||||
|
#[cfg(feature = "builtin_elements")]
|
||||||
|
pub mod slider;
|
||||||
|
|
||||||
// Wrappers:
|
// Wrappers:
|
||||||
|
|
||||||
#[cfg(feature = "builtin_elements")]
|
#[cfg(feature = "builtin_elements")]
|
||||||
|
|
7
hui/src/element/builtin/slider.rs
Normal file
7
hui/src/element/builtin/slider.rs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
use crate::element::UiElement;
|
||||||
|
|
||||||
|
pub struct Slider {
|
||||||
|
pub value: f32,
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO
|
|
@ -53,3 +53,19 @@ impl SignalStore {
|
||||||
self.sig.clear();
|
self.sig.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO this, simplifies handling signals
|
||||||
|
|
||||||
|
pub struct SignalTrigger<R: UiSignal + 'static, A = ()>(pub(crate) Box<dyn Fn(A) -> R>);
|
||||||
|
|
||||||
|
impl<R: UiSignal + 'static, A> SignalTrigger<R, A> {
|
||||||
|
pub fn new<F: Fn(A) -> R + 'static>(f: F) -> Self {
|
||||||
|
Self(Box::new(f))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<R: UiSignal + 'static, A, T: Fn(A) -> R + 'static> From<T> for SignalTrigger<R, A> {
|
||||||
|
fn from(f: T) -> Self {
|
||||||
|
Self(Box::new(f))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue