kitgit

tirbofish/dropbear · commit

e0632fe9cac4c227ac16fb8c8490b830891e46a5

feature: did a little bit here and there

Unverified

Thribhu K <4tkbytes@pm.me> · 2026-02-01 05:51

view full diff

diff --git a/crates/kino-ui/src/lib.rs b/crates/kino-ui/src/lib.rs
index 8354703..febd76d 100644
--- a/crates/kino-ui/src/lib.rs
+++ b/crates/kino-ui/src/lib.rs
@@ -243,6 +243,7 @@ impl KinoState {
                         device,
                         queue,
                         self.renderer.texture_bind_group_layout(),
+                        self.renderer.format,
                     );
                     return self.assets.add_texture_with_label(label, fallback);
                 }
@@ -262,6 +263,7 @@ impl KinoState {
             raw.as_ref(),
             width,
             height,
+            self.renderer.format,
         );
         self.assets.add_texture_with_label(label, texture)
     }
@@ -271,7 +273,8 @@ impl KinoState {
         self.assets.get_texture_handle(label)
     }
 
-    pub(crate) fn input(&self) -> &KinoWinitWindowing {
+    /// Returns a reference to the windowing. Used for input detection.
+    pub fn input(&self) -> &KinoWinitWindowing {
         &self.windowing
     }
 
@@ -348,11 +351,23 @@ impl KinoState {
 
 /// The id of the widget, often being a hash.
 #[derive(Clone, Copy, Hash, Eq, PartialEq, Debug)]
-pub struct WidgetId(pub u64);
+pub struct WidgetId(u64);
 
 impl WidgetId {
-    pub fn from_str(str: &str) -> Self {
-        str.into()
+    /// Creates a new [`WidgetId`] from an object that can be hashed.
+    pub fn new<H: Hash>(value: H) -> Self {
+        let mut hasher = DefaultHasher::new();
+        value.hash(&mut hasher);
+        WidgetId(hasher.finish())
+    }
+
+    /// Creates a new [`WidgetId`] from a simple u64 value.
+    pub fn from_raw(value: u64) -> Self {
+        WidgetId(value)

Large diffs are not rendered by default. Showing the first 50 of 476 lines. Show full diff