Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions i18n/en/cosmic_ext_tweaks.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ size = Size
size-description = The height of the panel and applets
padding = Padding
padding-description = Padding is the space between the contents and the borders of the dock or panel.
margin = Margin
margin-description = Margin is the space between the panel and the edges of the screen.
spacing = Spacing
spacing-description = Spacing is the space between the icons in the dock or panel.
animation-speed = Animation speed
Expand Down
3 changes: 2 additions & 1 deletion i18n/es-419/cosmic_ext_tweaks.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ size-description = La altura del panel y los applets

padding = Relleno
padding-description = El relleno es el espacio entre los iconos y el borde del dock o panel.

margin = Margen
margin-description = Margen es el espacio entre el panel y los bordes de la pantalla.
spacing = Espaciado
spacing-description = El espacio es la distancia entre los iconos en el dock o panel.

Expand Down
3 changes: 2 additions & 1 deletion i18n/es-MX/cosmic_ext_tweaks.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ size-description = La altura del panel y los applets

padding = Relleno
padding-description = El relleno es el espacio entre los iconos y el borde del dock o panel.

margin = Margen
margin-description = Margen es el espacio entre el panel y los bordes de la pantalla.
spacing = Espaciado
spacing-description = El espacio es la distancia entre los iconos en el dock o panel.

Expand Down
3 changes: 2 additions & 1 deletion i18n/es/cosmic_ext_tweaks.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ size-description = La altura del panel y los applets

padding = Relleno
padding-description = El relleno es el espacio entre los iconos y el borde del dock o panel.

margin = Margen
margin-description = Margen es el espacio entre el panel y los bordes de la pantalla.
spacing = Espaciado
spacing-description = El espacio es la distancia entre los iconos en el dock o panel.

Expand Down
3 changes: 2 additions & 1 deletion i18n/fr/cosmic_ext_tweaks.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ size-description = La taille du panneau et des applets

padding = Écarts
padding-description = L'écart entre le contenu et les bordures du dock et du panneau.

margin = Margin
margin-description = Margin is the space between the panel and the edges of the screen.
spacing = Espacement
spacing-description = L'espacement est l'espace entre les icônes dans le dock ou le panneau.

Expand Down
3 changes: 2 additions & 1 deletion i18n/ja/cosmic_ext_tweaks.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ size-description = The height of the panel and applets

padding = 余白
padding-description = 内容と枠線の間の空間です。

margin = Margin
margin-description = Margin is the space between the panel and the edges of the screen.
spacing = 間隔
spacing-description = アイコンの間の空間です。

Expand Down
3 changes: 2 additions & 1 deletion i18n/nl/cosmic_ext_tweaks.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ size-description = The height of the panel and applets

padding = Opvulling
padding-description = De ruimte tussen de inhoud en de randen van de dock of het paneel aanpassen.

margin = Margin
margin-description = Margin is the space between the panel and the edges of the screen.
spacing = Spatiëring
spacing-description = De ruimte tussen de pictogrammen in de dock of het paneel aanpassen.

Expand Down
3 changes: 2 additions & 1 deletion i18n/pt-BR/cosmic_ext_tweaks.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ size-description = The height of the panel and applets

padding = Preenchimento
padding-description = O preenchimento é o espaço entre o conteúdo e as bordas da dock ou do painel.

margin = Margin
margin-description = Margin is the space between the panel and the edges of the screen.
spacing = Espaçamento
spacing-description = O espaçamento é o espaço entre os ícones na dock ou no painel.

Expand Down
3 changes: 2 additions & 1 deletion i18n/ro/cosmic_ext_tweaks.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ size-description = The height of the panel and applets

padding = Margine interioară
padding-description = Marginea interioară este spațiul dintre conținut și marginile dock-ului sau panoului.

margin = Margin
margin-description = Margin is the space between the panel and the edges of the screen.
spacing = Spațiere
spacing-description = Spațierea este distanța dintre pictogramele din dock sau panou.

Expand Down
3 changes: 2 additions & 1 deletion i18n/sr-Cyrl/cosmic_ext_tweaks.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ size-description = The height of the panel and applets

padding = Пуњење
padding-description = Пуњење је простор између садржаја и ивица дока или панела.

margin = Margin
margin-description = Margin is the space between the panel and the edges of the screen.
spacing = Размак
spacing-description = Размак је простор између иконица на доку или панелу.

Expand Down
3 changes: 2 additions & 1 deletion i18n/sr-Latn/cosmic_ext_tweaks.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ size-description = The height of the panel and applets

padding = Punjenje
padding-description = Punjenje je prostor između sadržaja i ivica doka ili panela.

margin = Margin
margin-description = Margin is the space between the panel and the edges of the screen.
spacing = Razmak
spacing-description = Razmak je prostor između ikonica na doku ili panelu.

Expand Down
3 changes: 2 additions & 1 deletion i18n/sv/cosmic_ext_tweaks.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ size-description = The height of the panel and applets

padding = Utfyllnad
padding-description = Utfyllnad är utrymmet mellan innehållet och kanterna på dockan eller panelen.

margin = Margin
margin-description = Margin is the space between the panel and the edges of the screen.
spacing = Utfyllnad
spacing-description = Avståndet är utrymmet mellan ikonerna i dockan eller panelen.

Expand Down
2 changes: 2 additions & 0 deletions res/icons/bundled/object-layout-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl Application for App {
Cosmic::init(core, flags)
}

fn header_start(&self) -> Vec<Element<Self::Message>> {
fn header_start<'a>(&'a self) -> Vec<Element<'a, Self::Message>> {
Cosmic::header_start(self)
}

Expand All @@ -85,19 +85,19 @@ impl Application for App {
Cosmic::on_nav_select(self, id)
}

fn context_drawer(&self) -> Option<ContextDrawer<Self::Message>> {
fn context_drawer<'a>(&'a self) -> Option<ContextDrawer<'a, Self::Message>> {
Cosmic::context_drawer(self)
}

fn dialog(&self) -> Option<Element<Self::Message>> {
fn dialog<'a>(&'a self) -> Option<Element<'a, Self::Message>> {
Cosmic::dialog(self)
}

fn view(&self) -> Element<Self::Message> {
fn view<'a>(&'a self) -> Element<'a, Self::Message> {
Cosmic::view(self)
}

fn footer(&self) -> Option<Element<Self::Message>> {
fn footer<'a>(&'a self) -> Option<Element<'a, Self::Message>> {
Cosmic::footer(self)
}

Expand All @@ -118,7 +118,7 @@ impl App {
)])
}

fn settings(&self) -> Element<Message> {
fn settings<'a>(&'a self) -> Element<'a, Message> {
let app_theme_selected = match self.config.app_theme {
core::config::AppTheme::Dark => 1,
core::config::AppTheme::Light => 2,
Expand Down
2 changes: 1 addition & 1 deletion src/app/context_drawer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::app::App;
use super::Cosmic;

impl Cosmic {
pub fn context_drawer(app: &App) -> Option<ContextDrawer<Message>> {
pub fn context_drawer<'a>(app: &'a App) -> Option<ContextDrawer<'a, Message>> {
if !app.core().window.show_context {
return None;
}
Expand Down
1 change: 1 addition & 0 deletions src/app/core/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ impl IconCache {
bundle!("dark-mode-symbolic", 18);
bundle!("resize-mode-symbolic", 18);
bundle!("view-coverflow-symbolic", 18);
bundle!("object-layout-symbolic", 18);
bundle!("snapshots-symbolic", 18);
bundle!("checkmark-symbolic", 16);
bundle!("recycling-bin-symbolic", 16);
Expand Down
2 changes: 1 addition & 1 deletion src/app/dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub enum DialogPage {
}

impl Cosmic {
pub fn dialog(app: &App) -> Option<Element<Message>> {
pub fn dialog<'a>(app: &'a App) -> Option<Element<'a, Message>> {
let spacing = cosmic::theme::spacing();
let dialog_page = match app.cosmic.dialog_pages.front() {
Some(some) => some,
Expand Down
2 changes: 1 addition & 1 deletion src/app/footer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::app::pages::{
use crate::fl;

impl Cosmic {
pub fn footer(app: &App) -> Option<Element<Message>> {
pub fn footer<'a>(app: &'a App) -> Option<Element<'a, Message>> {
let spacing = cosmic::theme::spacing();

match app.cosmic.nav_model.active_data::<Page>()? {
Expand Down
2 changes: 1 addition & 1 deletion src/app/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::app::core::icons;
use crate::fl;

impl Cosmic {
pub fn header_start(app: &App) -> Vec<Element<Message>> {
pub fn header_start<'a>(app: &'a App) -> Vec<Element<'a, Message>> {
let menu_bar = menu::bar(vec![menu::Tree::with_children(
RcElementWrapper::new(menu::root(fl!("view")).into()),
menu::items(
Expand Down
22 changes: 22 additions & 0 deletions src/app/pages/dock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub struct Dock {
pub dock_helper: Option<Config>,
pub dock_config: Option<CosmicPanelConfig>,
pub padding: u32,
pub margin: u16,
pub spacing: u32,
autohide: AutoHide,
}
Expand All @@ -27,6 +28,7 @@ impl Default for Dock {
.clone()
.map(|config| config.padding)
.unwrap_or(0);
let margin = dock_config.clone().map(|config| config.margin).unwrap_or(0);
let spacing = dock_config
.clone()
.map(|config| config.spacing)
Expand All @@ -39,6 +41,7 @@ impl Default for Dock {
dock_helper,
dock_config,
padding,
margin,
spacing,
autohide,
}
Expand All @@ -48,6 +51,7 @@ impl Default for Dock {
#[derive(Debug, Clone)]
pub enum Message {
SetPadding(u32),
SetMargin(u16),
SetSpacing(u32),
SetWaitTime(u32),
SetTransitionTime(u32),
Expand All @@ -71,6 +75,17 @@ impl Dock {
.spacing(spacing.space_xxs),
),
)
.add(
widget::settings::item::builder(fl!("margin"))
.description(fl!("margin-description"))
.icon(icons::get_icon("object-layout-symbolic", 18))
.control(
widget::row()
.push(widget::slider(0..=20, self.margin, Message::SetMargin))
.push(widget::text::text(format!("{} px", self.margin)))
.spacing(spacing.space_xxs),
),
)
.add(
widget::settings::item::builder(fl!("spacing"))
.description(fl!("spacing-description"))
Expand Down Expand Up @@ -166,6 +181,13 @@ impl Dock {
log::error!("Error updating dock padding: {}", err);
}
}
Message::SetMargin(margin) => {
self.margin = margin;
let update = dock_config.set_margin(dock_helper, self.margin);
if let Err(err) = update {
log::error!("Error updating dock margin: {}", err);
}
}
Message::SetSpacing(spacing) => {
self.spacing = spacing;
let update = dock_config.set_spacing(dock_helper, self.spacing);
Expand Down
6 changes: 3 additions & 3 deletions src/app/pages/layouts/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ impl Layout {
}
}

pub fn preview(
&self,
pub fn preview<'a>(
&'a self,
spacing: &cosmic::cosmic_theme::Spacing,
item_width: usize,
preview_height: u16,
selected_layout: &Option<Layout>,
) -> Element<Message> {
) -> Element<'a, Message> {
let mut button = widget::button::custom(self.preview.view(&spacing, preview_height))
.on_press(Message::Select(self.clone()))
.class(cosmic::style::Button::Image)
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/layouts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Layouts {
Ok(())
}

pub fn view(&self) -> Element<Message> {
pub fn view<'a>(&'a self) -> Element<'a, Message> {
let spacing = cosmic::theme::spacing();
let grid = widget::responsive(move |size| {
let GridMetrics {
Expand Down
25 changes: 25 additions & 0 deletions src/app/pages/panel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub struct Panel {
pub panel_helper: Option<Config>,
pub panel_config: Option<CosmicPanelConfig>,
pub padding: u32,
pub margin: u16,
pub spacing: u32,
pub show_panel: bool,
pub cosmic_panel_config: CosmicPanel,
Expand Down Expand Up @@ -96,6 +97,10 @@ impl Default for Panel {
.clone()
.map(|config| config.padding)
.unwrap_or(0);
let margin = panel_config
.clone()
.map(|config| config.margin)
.unwrap_or(0);
let spacing = panel_config
.clone()
.map(|config| config.spacing)
Expand Down Expand Up @@ -124,6 +129,7 @@ impl Default for Panel {
panel_helper,
panel_config,
padding,
margin,
spacing,
show_panel,
cosmic_panel_config,
Expand All @@ -140,6 +146,7 @@ impl Default for Panel {
#[derive(Debug, Clone)]
pub enum Message {
SetPadding(u32),
SetMargin(u16),
SetSpacing(u32),
ShowPanel(bool),
ForceIcons(bool),
Expand Down Expand Up @@ -196,6 +203,17 @@ impl Panel {
.spacing(spacing.space_xxs),
),
)
.add(
widget::settings::item::builder(fl!("margin"))
.description(fl!("margin-description"))
.icon(icons::get_icon("object-layout-symbolic", 18))
.control(
widget::row()
.push(widget::slider(0..=20, self.margin, Message::SetMargin))
.push(widget::text::text(format!("{} px", self.margin)))
.spacing(spacing.space_xxs),
),
)
.add(
widget::settings::item::builder(fl!("spacing"))
.description(fl!("spacing-description"))
Expand Down Expand Up @@ -291,6 +309,13 @@ impl Panel {
log::error!("Error updating panel padding: {}", err);
}
}
Message::SetMargin(margin) => {
self.margin = margin;
let update = panel_config.set_margin(panel_helper, self.margin);
if let Err(err) = update {
log::error!("Error updating panel margin: {}", err);
}
}
Message::SetSpacing(spacing) => {
self.spacing = spacing;
let update = panel_config.set_spacing(panel_helper, self.spacing);
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/snapshots/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub enum Message {
}

impl Snapshots {
pub fn view(&self) -> Element<Message> {
pub fn view<'a>(&'a self) -> Element<'a, Message> {
let spacing = cosmic::theme::spacing();
let snapshots = self
.snapshots
Expand Down
2 changes: 1 addition & 1 deletion src/app/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::app::{message::Message, page::Page, App};
use super::Cosmic;

impl Cosmic {
pub fn view(app: &App) -> Element<Message> {
pub fn view<'a>(app: &'a App) -> Element<'a, Message> {
let spacing = cosmic::theme::spacing();
let entity = app.cosmic.nav_model.active();
let nav_page = app
Expand Down
Loading