use crate::gui::animation::WindowAnimation;
use crate::gui::content::Content;
use crate::gui::effect::{PresetEffect, PresetEffectOptions};
use crate::gui::icon::WindowIcon;
use crate::gui::shape::WindowShape;
#[derive(Debug, Clone, Copy, Default)]
pub struct Position {
pub x: f64,
pub y: f64,
}
impl Position {
pub fn new(x: f64, y: f64) -> Self {
Self { x, y }
}
}
#[derive(Debug, Clone, Copy)]
pub struct Size {
pub width: u32,
pub height: u32,
}
impl Default for Size {
fn default() -> Self {
Self { width: 200, height: 200 }
}
}
impl Size {
pub fn new(width: u32, height: u32) -> Self {
Self { width, height }
}
}
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub enum WindowLevel {
#[default]
Normal,
Top,
AlwaysOnTop,
}
#[derive(Debug, Clone, Default)]
pub struct WindowConfig {
pub id: Option<String>,
pub title: Option<String>,
pub position: Position,
pub size: Size,
pub effect_margin: f32,
pub shape: WindowShape,
pub draggable: bool,
pub resizable: bool,
pub click_through: bool,
pub level: WindowLevel,
pub opacity: f32,
pub icon: Option<WindowIcon>,
pub content: Option<Content>,
pub widget_content: Option<crate::gui::widget::WidgetDef>,
pub effect: Option<(PresetEffect, PresetEffectOptions)>,
pub show_animation: Option<WindowAnimation>,
pub hide_animation: Option<WindowAnimation>,
}
impl WindowConfig {
pub fn new() -> Self {
Self { opacity: 1.0, ..Default::default() }
}
}