Skip to content

Commit

Permalink
feat: add build_pattern for iced_layershell
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Dec 3, 2024
1 parent a08d676 commit a673742
Show file tree
Hide file tree
Showing 4 changed files with 1,125 additions and 2 deletions.
52 changes: 52 additions & 0 deletions iced_layershell/src/build_pattern.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
mod application;
mod daemon;
use std::borrow::Cow;

use iced::{Font, Pixels};

use crate::settings::{LayerShellSettings, VirtualKeyboardSettings};

/// The renderer of some [`Program`].
pub trait Renderer: iced_core::text::Renderer + iced_graphics::compositor::Default {}

impl<T> Renderer for T where T: iced_core::text::Renderer + iced_graphics::compositor::Default {}

#[derive(Debug, Default)]
pub struct MainSettings {
/// The identifier of the application.
///
/// If provided, this identifier may be used to identify the application or
/// communicate with it through the windowing system.
pub id: Option<String>,

/// settings for layer shell
pub layer_settings: LayerShellSettings,
/// The data needed to initialize an [`Application`].
///
/// The fonts to load on boot.
pub fonts: Vec<Cow<'static, [u8]>>,

/// The default [`Font`] to be used.
///
/// By default, it uses [`Family::SansSerif`](iced::font::Family::SansSerif).
pub default_font: Font,

/// The text size that will be used by default.
///
/// The default value is `16.0`.
pub default_text_size: Pixels,

/// If set to true, the renderer will try to perform antialiasing for some
/// primitives.
///
/// Enabling it can produce a smoother result in some widgets, like the
/// `Canvas`, at a performance cost.
///
/// By default, it is disabled.
///
pub antialiasing: bool,

pub virtual_keyboard_support: Option<VirtualKeyboardSettings>,
}
pub use application::application;
pub use daemon::daemon;
Loading

0 comments on commit a673742

Please sign in to comment.