From e88b0d40278e8a6faf3a55d13c2c33846212583e Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Sat, 19 Oct 2024 22:41:12 +0200 Subject: [PATCH 1/3] Add `clear` to `WidgetList` --- src/widget.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/widget.rs b/src/widget.rs index 8668f21..1f07110 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -2160,6 +2160,11 @@ impl WidgetList { self.ordered.truncate(length); } + /// Clear the list + pub fn clear(&mut self) { + self.ordered.clear(); + } + /// Returns `self` as a vertical [`Stack`] of rows. #[must_use] pub fn into_rows(self) -> Stack { From 76fb062107655eceac3dec7d987034ed6a609f9c Mon Sep 17 00:00:00 2001 From: Fabian Keller Date: Tue, 22 Oct 2024 09:57:39 +0200 Subject: [PATCH 2/3] Fix some docstrings in window module --- src/window.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/window.rs b/src/window.rs index 422fd48..cb5bc08 100644 --- a/src/window.rs +++ b/src/window.rs @@ -117,7 +117,7 @@ pub trait PlatformWindowImplementation { self.winit().map_or(true, |win| win.is_resizable()) } - /// Returns true if the window can have its size changed. + /// Returns the underlying window theme. /// /// The provided implementation returns [`winit::window::Window::theme`], or /// dark if this window has no winit window. @@ -248,7 +248,7 @@ pub trait PlatformWindow { fn handle(&self) -> WindowHandle; /// Returns the unique id of the [`Kludgine`] instance used by this window. fn kludgine_id(&self) -> KludgineId; - /// Returns the dynamic that is synchrnoized with the window's focus. + /// Returns the dynamic that is synchronized with the window's focus. fn focused(&self) -> &Dynamic; /// Returns the dynamic that is synchronized with the window's occlusion /// status. @@ -800,7 +800,7 @@ where self } - /// Sets `position` to be a dynamic synchronized with this window's outer + /// Sets `position` to be a dynamic synchronized with this window's outer /// position. /// /// If `automatic_layout` is true, the initial value of `position` will be @@ -829,7 +829,7 @@ where self } - /// Sets `position` to be a dynamic synchronized with this window's inner + /// Sets `position` to be a dynamic synchronized with this window's inner /// position. /// /// When the window is moved, this dynamic will contain its new position. From ce836b2746ff46fed7cb0a97116a9fe2705d2e99 Mon Sep 17 00:00:00 2001 From: Fabian Keller Date: Tue, 22 Oct 2024 10:01:58 +0200 Subject: [PATCH 3/3] Use consistent symbol to refer to winit window --- src/window.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/window.rs b/src/window.rs index 422fd48..bc7cfd6 100644 --- a/src/window.rs +++ b/src/window.rs @@ -31,7 +31,7 @@ use kludgine::app::winit::event::{ use kludgine::app::winit::keyboard::{ Key, KeyLocation, ModifiersState, NamedKey, NativeKeyCode, PhysicalKey, SmolStr, }; -use kludgine::app::winit::window::{self, Cursor, Fullscreen, Icon, WindowButtons, WindowLevel}; +use kludgine::app::winit::window::{Cursor, Fullscreen, Icon, WindowButtons, WindowLevel}; use kludgine::app::{winit, WindowAttributes, WindowBehavior as _}; use kludgine::cosmic_text::{fontdb, Family, FamilyOwned}; use kludgine::drawing::Drawing; @@ -3177,16 +3177,16 @@ impl Not for ThemeMode { } } -impl From for ThemeMode { - fn from(value: window::Theme) -> Self { +impl From for ThemeMode { + fn from(value: winit::window::Theme) -> Self { match value { - window::Theme::Light => Self::Light, - window::Theme::Dark => Self::Dark, + winit::window::Theme::Light => Self::Light, + winit::window::Theme::Dark => Self::Dark, } } } -impl From for window::Theme { +impl From for winit::window::Theme { fn from(value: ThemeMode) -> Self { match value { ThemeMode::Light => Self::Light,