meow
This commit is contained in:
@@ -7,6 +7,7 @@ use iced::{Font, Pixels};
|
||||
use iced_layershell::reexport::{Anchor, KeyboardInteractivity};
|
||||
use iced_layershell::settings::{LayerShellSettings, Settings, StartMode};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// Bar text font, matching quickshell's `CaskaydiaCove NFM`.
|
||||
const DEFAULT_FONT: &str = "CaskaydiaCove NFM";
|
||||
@@ -37,6 +38,9 @@ pub struct Display {
|
||||
pub padding: f32,
|
||||
/// Gap between modules in the bar, logical px.
|
||||
pub spacing: f32,
|
||||
/// Path to a base16 YAML scheme to theme the bar with; system theme if
|
||||
/// absent.
|
||||
pub theme: Option<PathBuf>,
|
||||
}
|
||||
|
||||
impl Default for Display {
|
||||
@@ -48,6 +52,7 @@ impl Default for Display {
|
||||
default_text_size: DEFAULT_TEXT_SIZE,
|
||||
padding: DEFAULT_PADDING,
|
||||
spacing: DEFAULT_SPACING,
|
||||
theme: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ mod display;
|
||||
mod effect;
|
||||
mod messages;
|
||||
mod module;
|
||||
mod reusable_elements;
|
||||
mod service;
|
||||
mod wire;
|
||||
|
||||
@@ -17,5 +18,6 @@ pub use display::Display;
|
||||
pub use effect::ModuleEffect;
|
||||
pub use messages::*;
|
||||
pub use module::BarModule;
|
||||
pub use reusable_elements::pill;
|
||||
pub use service::Service;
|
||||
pub use wire::{Endpoint, Inbox, Namespace, Target, Wire};
|
||||
|
||||
@@ -19,9 +19,9 @@ impl ClockKind {
|
||||
}
|
||||
}
|
||||
|
||||
/// Clock tick payload: the value plus the kind that produced it.
|
||||
/// Clock tick: the kind is the variant, the rendered time the parameter.
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
pub struct ClockPayload {
|
||||
pub kind: ClockKind,
|
||||
pub value: String,
|
||||
pub enum ClockPayload {
|
||||
Mins(String),
|
||||
Seconds(String),
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
use iced::{border, widget::container, Theme};
|
||||
|
||||
const REF_RADIUS: f32 = 3.5;
|
||||
|
||||
/// The quickshell pill: rounded, filled with the theme background (the
|
||||
/// darkest colour the palette offers) so it reads as a solid block over the
|
||||
/// transparent bar.
|
||||
pub fn pill(theme: &Theme) -> container::Style {
|
||||
container::Style {
|
||||
background: Some(theme.palette().background.into()),
|
||||
text_color: Some(theme.palette().text),
|
||||
border: border::rounded(REF_RADIUS),
|
||||
..container::Style::default()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user