improv: add window border

This commit is contained in:
Vukašin Vojinović 2024-11-03 19:16:37 +01:00 committed by Michael Murphy
parent 36b3cfa13a
commit 127ce17b85
26 changed files with 130 additions and 114 deletions

View file

@ -2,14 +2,15 @@
use iced::widget::Container;
use iced::Size;
use iced_core::alignment;
use iced_core::event::{self, Event};
use iced_core::layout;
use iced_core::mouse;
use iced_core::overlay;
use iced_core::renderer;
use iced_core::widget::Tree;
use iced_core::{Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Vector, Widget};
use iced_core::{
Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Vector, Widget,
};
use iced_widget::container;
pub use iced_widget::container::{Catalog, Style};
@ -104,14 +105,14 @@ where
/// Sets the content alignment for the horizontal axis of the [`Container`].
#[must_use]
pub fn align_x(mut self, alignment: alignment::Horizontal) -> Self {
pub fn align_x(mut self, alignment: Alignment) -> Self {
self.container = self.container.align_x(alignment);
self
}
/// Sets the content alignment for the vertical axis of the [`Container`].
#[must_use]
pub fn align_y(mut self, alignment: alignment::Vertical) -> Self {
pub fn align_y(mut self, alignment: Alignment) -> Self {
self.container = self.container.align_y(alignment);
self
}
@ -130,6 +131,13 @@ where
self
}
/// Centers the contents in the horizontal and vertical axis of the [`Container`].
#[must_use]
pub fn center(mut self, length: Length) -> Self {
self.container = self.container.center(length);
self
}
/// Sets the style of the [`Container`].
#[must_use]
pub fn class(mut self, style: impl Into<crate::style::Container<'a>>) -> Self {