Panel applets jammy (#41)
This commit is contained in:
parent
162ff02b12
commit
82ac6aac1c
11 changed files with 1845 additions and 62 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -17,7 +17,7 @@ use cosmic_settings_page::{self as page, section, Section};
|
|||
use slotmap::SlotMap;
|
||||
use std::{borrow::Cow, collections::HashMap};
|
||||
|
||||
mod applets;
|
||||
pub mod applets;
|
||||
|
||||
pub struct Page {
|
||||
config_helper: Option<cosmic_config::Config>,
|
||||
|
|
@ -383,6 +383,7 @@ pub enum Message {
|
|||
Applets,
|
||||
OutputAdded(String, WlOutput),
|
||||
OutputRemoved(WlOutput),
|
||||
PanelConfig(CosmicPanelConfig),
|
||||
}
|
||||
|
||||
impl Page {
|
||||
|
|
@ -390,7 +391,7 @@ impl Page {
|
|||
match message {
|
||||
Message::AutoHidePanel(enabled) => {
|
||||
let helper = self.config_helper.as_ref().unwrap();
|
||||
let panel_config = self.panel_config.as_mut().unwrap();
|
||||
let mut panel_config = self.panel_config.as_mut().unwrap();
|
||||
|
||||
panel_config.autohide = enabled.then_some(AutoHide {
|
||||
wait_time: 1000,
|
||||
|
|
@ -402,7 +403,7 @@ impl Page {
|
|||
}
|
||||
Message::PanelAnchor(anchor) => {
|
||||
let helper = self.config_helper.as_ref().unwrap();
|
||||
let panel_config = self.panel_config.as_mut().unwrap();
|
||||
let mut panel_config = self.panel_config.as_mut().unwrap();
|
||||
|
||||
panel_config.anchor = anchor;
|
||||
|
||||
|
|
@ -410,7 +411,7 @@ impl Page {
|
|||
}
|
||||
Message::Output(name) => {
|
||||
let helper = self.config_helper.as_ref().unwrap();
|
||||
let panel_config = self.panel_config.as_mut().unwrap();
|
||||
let mut panel_config = self.panel_config.as_mut().unwrap();
|
||||
|
||||
panel_config.output = match name {
|
||||
s if s == fl!("all") => CosmicPanelOuput::All,
|
||||
|
|
@ -421,7 +422,7 @@ impl Page {
|
|||
}
|
||||
Message::AnchorGap(enabled) => {
|
||||
let helper = self.config_helper.as_ref().unwrap();
|
||||
let panel_config = self.panel_config.as_mut().unwrap();
|
||||
let mut panel_config = self.panel_config.as_mut().unwrap();
|
||||
|
||||
panel_config.anchor_gap = enabled;
|
||||
|
||||
|
|
@ -429,7 +430,7 @@ impl Page {
|
|||
}
|
||||
Message::PanelSize(size) => {
|
||||
let helper = self.config_helper.as_ref().unwrap();
|
||||
let panel_config = self.panel_config.as_mut().unwrap();
|
||||
let mut panel_config = self.panel_config.as_mut().unwrap();
|
||||
|
||||
panel_config.size = size;
|
||||
|
||||
|
|
@ -437,7 +438,7 @@ impl Page {
|
|||
}
|
||||
Message::Appearance(a) => {
|
||||
let helper = self.config_helper.as_ref().unwrap();
|
||||
let panel_config = self.panel_config.as_mut().unwrap();
|
||||
let mut panel_config = self.panel_config.as_mut().unwrap();
|
||||
|
||||
panel_config.background = a.into();
|
||||
|
||||
|
|
@ -445,7 +446,7 @@ impl Page {
|
|||
}
|
||||
Message::ExtendToEdge(enabled) => {
|
||||
let helper = self.config_helper.as_ref().unwrap();
|
||||
let panel_config = self.panel_config.as_mut().unwrap();
|
||||
let mut panel_config = self.panel_config.as_mut().unwrap();
|
||||
|
||||
panel_config.expand_to_edges = enabled;
|
||||
|
||||
|
|
@ -453,7 +454,7 @@ impl Page {
|
|||
}
|
||||
Message::Opacity(opacity) => {
|
||||
let helper = self.config_helper.as_ref().unwrap();
|
||||
let panel_config = self.panel_config.as_mut().unwrap();
|
||||
let mut panel_config = self.panel_config.as_mut().unwrap();
|
||||
|
||||
panel_config.opacity = opacity;
|
||||
|
||||
|
|
@ -467,6 +468,9 @@ impl Page {
|
|||
Message::OutputRemoved(output) => {
|
||||
self.outputs.remove(&output.id());
|
||||
}
|
||||
Message::PanelConfig(c) => {
|
||||
self.panel_config = Some(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ pub enum Message {
|
|||
Desktop(desktop::Message),
|
||||
Panel(desktop::panel::Message),
|
||||
DesktopWallpaper(desktop::wallpaper::Message),
|
||||
Applet(desktop::panel::applets::Message),
|
||||
External { id: String, message: Vec<u8> },
|
||||
Page(Entity),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue