Skip to content

Commit

Permalink
fix(padding): match divider padding to designs
Browse files Browse the repository at this point in the history
Also includes some other minor spacing fixes, and adds settings buttons for network and tiling.
  • Loading branch information
git-f0x committed Sep 19, 2024
1 parent 0a32d27 commit 2a5c8ad
Show file tree
Hide file tree
Showing 37 changed files with 674 additions and 517 deletions.
883 changes: 467 additions & 416 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions cosmic-app-list/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ impl DockItem {
.into(),
};

let icon_button = cosmic::widget::button(icon_wrapper)
let icon_button = button::custom(icon_wrapper)
.padding(app_icon.padding)
.selected(is_focused)
.style(app_list_icon_style(is_focused));
Expand Down Expand Up @@ -456,7 +456,7 @@ where
Msg: 'static + Clone,
{
let border = 1.0;
cosmic::widget::button(
button::custom(
container(
column![
container(if let Some(img) = img {
Expand Down Expand Up @@ -1715,7 +1715,7 @@ impl cosmic::Application for CosmicAppList {
fn menu_button<'a, Message>(
content: impl Into<Element<'a, Message>>,
) -> cosmic::widget::Button<'a, Message> {
cosmic::widget::button(content)
button::custom(content)
.height(36)
.style(Button::AppletMenu)
.padding(menu_control_padding())
Expand Down Expand Up @@ -1774,7 +1774,7 @@ impl cosmic::Application for CosmicAppList {
.on_press(Message::Exec(exec.into(), None)),
);
}
content = content.push(divider::horizontal::default());
content = content.push(divider::horizontal::light());
}

if !toplevels.is_empty() {
Expand All @@ -1791,7 +1791,7 @@ impl cosmic::Application for CosmicAppList {
);
}
content = content.push(list_col);
content = content.push(divider::horizontal::default());
content = content.push(divider::horizontal::light());
}

let svg_accent = Rc::new(|theme: &cosmic::Theme| {
Expand Down Expand Up @@ -1820,7 +1820,7 @@ impl cosmic::Application for CosmicAppList {
);

if toplevels.len() > 0 {
content = content.push(divider::horizontal::default());
content = content.push(divider::horizontal::light());
content = match toplevels.len() {
1 => content.push(
menu_button(text::body(fl!("quit")))
Expand Down
18 changes: 14 additions & 4 deletions cosmic-applet-audio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ use cosmic::{
},
cctk::sctk::reexports::{calloop, protocols::xdg::shell::client::xdg_positioner::Anchor},

Check warning on line 18 in cosmic-applet-audio/src/lib.rs

View workflow job for this annotation

GitHub Actions / linting

unused imports: `Rectangle` and `protocols::xdg::shell::client::xdg_positioner::Anchor`

warning: unused imports: `Rectangle` and `protocols::xdg::shell::client::xdg_positioner::Anchor` --> cosmic-applet-audio/src/lib.rs:18:38 | 18 | cctk::sctk::reexports::{calloop, protocols::xdg::shell::client::xdg_positioner::Anchor}, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 24 | window, Alignment, Length, Limits, Rectangle, Subscription, | ^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
cosmic_config::CosmicConfigEntry,
cosmic_theme::Spacing,
iced::{
self,
widget::{self, column, row, slider},
window, Alignment, Length, Limits, Rectangle, Subscription,
},
iced_runtime::core::alignment::Horizontal,
iced_style::application,
theme,
widget::{button, divider, horizontal_space, icon, text, Column, Row},
Element, Renderer, Theme,
};
Expand Down Expand Up @@ -665,6 +667,9 @@ impl cosmic::Application for Audio {
input.mute = value;
}
}
sub_pulse::Event::DefaultSink(_) => {}
sub_pulse::Event::DefaultSource(_) => {}
sub_pulse::Event::CardInfo(_) => {}
},
};

Expand Down Expand Up @@ -735,6 +740,10 @@ impl cosmic::Application for Audio {
}

fn view_window(&self, _id: window::Id) -> Element<Message> {
let Spacing {
space_xxs, space_s, ..
} = theme::active().cosmic().spacing;

let audio_disabled = matches!(self.pulse_state, PulseState::Disconnected(_));
let out_mute = self.current_output_mute();
let in_mute = self.current_input_mute();
Expand Down Expand Up @@ -790,7 +799,7 @@ impl cosmic::Application for Audio {
.spacing(12)
.align_items(Alignment::Center)
),
padded_control(divider::horizontal::default()),
padded_control(divider::horizontal::default()).padding([space_xxs, space_s]),
revealer(
self.is_open == IsOpen::Output,
fl!("output"),
Expand Down Expand Up @@ -906,7 +915,8 @@ impl cosmic::Application for Audio {
.into(),
);

audio_content = audio_content.push(padded_control(divider::horizontal::default()));
audio_content = audio_content
.push(padded_control(divider::horizontal::default()).padding([space_xxs, space_s]));
audio_content = audio_content.push(
Row::with_children(elements)
.align_items(Alignment::Center)
Expand All @@ -916,7 +926,7 @@ impl cosmic::Application for Audio {
}
let content = column![
audio_content,
padded_control(divider::horizontal::default()),
padded_control(divider::horizontal::default()).padding([space_xxs, space_s]),
padded_control(
anim!(
// toggler
Expand All @@ -930,7 +940,7 @@ impl cosmic::Application for Audio {
.width(Length::Fill)
)
.padding([8, 24]),
padded_control(divider::horizontal::default()),
padded_control(divider::horizontal::default()).padding([space_xxs, space_s]),
menu_button(text::body(fl!("sound-settings"))).on_press(Message::OpenSettings)
]
.align_items(Alignment::Start)
Expand Down
3 changes: 1 addition & 2 deletions cosmic-applet-battery/i18n/de/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Cosmic Taste
battery = Akku
battery-desc = Reduzierter Stromverbrauch und Leistung.
balanced = Ausgeglichen
Expand All @@ -12,4 +11,4 @@ hours = h
until-empty = bis leer
power-settings = Energie- und Akkueinstellungen...
dgpu-running = Dedizierte GPU ist aktiv und kann die Akkulaufzeit reduzieren
dgpu-applications = Anwendungen, die die dedizierte GPU {$gpu_name} nutzen
dgpu-applications = Anwendungen, die die dedizierte GPU {$gpu_name} nutzen
5 changes: 2 additions & 3 deletions cosmic-applet-battery/i18n/en/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Cosmic Button
battery = Battery
battery-desc = Reduced power usage and performance.
balanced = Balanced
Expand All @@ -10,6 +9,6 @@ seconds = s
minutes = m
hours = h
until-empty = until empty
power-settings = Power and Battery Settings...
power-settings = Power & Battery settings...
dgpu-running = Discrete GPU is active and can reduce battery life
dgpu-applications = Applications using {$gpu_name} discrete GPU
dgpu-applications = Applications using {$gpu_name} discrete GPU
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Botón de Cosmic
battery = Ahorro de energía
battery-desc = Rendimiento y uso de energía reducido.
balanced = Balanceado
Expand Down
1 change: 0 additions & 1 deletion cosmic-applet-battery/i18n/es-ES/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Botón Cosmic
battery = Batería
battery-desc = Rendimiento y consumo de alimentación reducidos.
balanced = Balanceado
Expand Down
1 change: 0 additions & 1 deletion cosmic-applet-battery/i18n/fa/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = دکمه Cosmic
battery = باتری
battery-desc = کاهش مصرف برق و عملکرد.
balanced = متعادل
Expand Down
1 change: 0 additions & 1 deletion cosmic-applet-battery/i18n/fi/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Cosmic Painike
battery = Akku
battery-desc = Vähentynyt virrankulutus ja suorituskyky.
balanced = Tasapainoitettu
Expand Down
3 changes: 1 addition & 2 deletions cosmic-applet-battery/i18n/fr/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Bouton Cosmic
battery = Batterie
battery-desc = Performance et consommation réduites.
balanced = Équilibré
Expand All @@ -12,4 +11,4 @@ hours = h
until-empty = avant la décharge totale
power-settings = Paramètres d'alimentation...
dgpu-running = Le GPU dédié est actif et peu réduire l'autonomie de la batterie
dgpu-applications = Applications utilisant le GPU dédié {$gpu_name}
dgpu-applications = Applications utilisant le GPU dédié {$gpu_name}
3 changes: 1 addition & 2 deletions cosmic-applet-battery/i18n/hu/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Cosmic Gomb
battery = Akkumulátor
battery-desc = Csökkentett energiafogyasztás és teljesítmény.
balanced = Kiegyensúlyozott
Expand All @@ -12,4 +11,4 @@ hours = h
until-empty = lemerülésig
power-settings = Tápellátás és akkumulátor beállítások...
dgpu-running = A dedikált GPU aktív, és csökkentheti az akkumulátor élettartamát
dgpu-applications = A {$gpu_name} dedikált GPU-t használó alkalmazások
dgpu-applications = A {$gpu_name} dedikált GPU-t használó alkalmazások
5 changes: 2 additions & 3 deletions cosmic-applet-battery/i18n/id/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Tombol Cosmic
battery = Baterai
battery-desc = Penggunaan daya dan kinerja yang dikurangi.
balanced = Seimbang
Expand All @@ -7,9 +6,9 @@ performance = Kinerja Tinggi
performance-desc = Kinerja dan penggunaan daya yang tinggi.
max-charge = Tingkatkan masa pakai baterai Anda dengan mengatur nilai pengisian maksimum 80%
seconds = d
minutes = m
minutes = m
hours = j
until-empty = hingga kosong
power-settings = Pengaturan Daya dan Baterai...
dgpu-running = GPU Diskrit aktif dan dapat mengurangi masa pakai baterai
dgpu-applications = Aplikasi yang menggunakan {$gpu_name} GPU Diskrit
dgpu-applications = Aplikasi yang menggunakan {$gpu_name} GPU Diskrit
3 changes: 1 addition & 2 deletions cosmic-applet-battery/i18n/it/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Pulsante Cosmic
battery = Batteria
battery-desc = Consumi e performance ridotte.
balanced = Bilanciato
Expand All @@ -12,4 +11,4 @@ hours = h
until-empty = fino alla scarica
power-settings = Impostazioni energetiche
dgpu-running = La GPU discreta è attiva e può ridurre la durata della batteria.
dgpu-applications = Applicazioni che stanno usando la GPU discreta {$gpu_name}
dgpu-applications = Applicazioni che stanno usando la GPU discreta {$gpu_name}
1 change: 0 additions & 1 deletion cosmic-applet-battery/i18n/ja/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Cosmicボタン
battery = バッテリー
battery-desc = 性能と消費は低くなります。
balanced = バランス
Expand Down
1 change: 0 additions & 1 deletion cosmic-applet-battery/i18n/nl/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Cosmic Knop
battery = Batterij
battery-desc = Verminderd stroom verbruik en prestatie.
balanced = Gebalanceerd
Expand Down
1 change: 0 additions & 1 deletion cosmic-applet-battery/i18n/pl/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Przycisk Cosmic
battery = Na Baterii
battery-desc = Zmniejszone zużycie energii i zmniejszona wydajność.
balanced = Zbalansowany
Expand Down
1 change: 0 additions & 1 deletion cosmic-applet-battery/i18n/pt-BR/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Botão Cosmic
battery = Bateria
battery-desc = Uso reduzido de energia e desempenho.
balanced = Equilibrado
Expand Down
1 change: 0 additions & 1 deletion cosmic-applet-battery/i18n/pt/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Botão Cosmic
battery = Bateria
battery-desc = Uso reduzido de energia e desempenho.
balanced = Equilibrado
Expand Down
3 changes: 1 addition & 2 deletions cosmic-applet-battery/i18n/ru/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Кнопка Cosmic
battery = Аккумулятор
battery-desc = Пониженные энергопотребление и производительность.
balanced = Сбалансированный
Expand All @@ -12,4 +11,4 @@ hours = ч.
until-empty = до полного разряда
power-settings = Параметры питания и аккумулятора...
dgpu-running = Дискретная видеокарта активна и может сократить время автономной работы
dgpu-applications = Приложения, использующие видеокарту {$gpu_name}
dgpu-applications = Приложения, использующие видеокарту {$gpu_name}
3 changes: 1 addition & 2 deletions cosmic-applet-battery/i18n/sk/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Cosmic Button
battery = Batéria
battery-desc = Obmedzená spotreba energie a výkonu.
balanced = Vyvážený
Expand All @@ -12,4 +11,4 @@ hours = h
until-empty = pokiaľ prázdne
power-settings = Nastavenia napájania a batérie...
dgpu-running = Diskrétne GPU sa práve používa. To môže ovplyvniť životnosť batérie.
dgpu-applications = Aplikácie, ktoré používajú {$gpu_name} diskrétne GPU
dgpu-applications = Aplikácie, ktoré používajú {$gpu_name} diskrétne GPU
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Cosmic дугме
battery = Батерија
battery-desc = Смањене перформансе и потрошња батерије.
balanced = Балансирано
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Cosmic dugme
battery = Baterija
battery-desc = Smanjene performanse i potrošnja baterije.
balanced = Balansirano
Expand Down
1 change: 0 additions & 1 deletion cosmic-applet-battery/i18n/tr/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Cosmic Düğmesi
battery = Pil
battery-desc = Daha az güç tüketimi ve başarım.
balanced = Dengeli
Expand Down
1 change: 0 additions & 1 deletion cosmic-applet-battery/i18n/uk/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Кнопка Cosmic
battery = Акумулятор
battery-desc = Зменшення споживання енергії та продуктивності.
balanced = Збалансовано
Expand Down
1 change: 0 additions & 1 deletion cosmic-applet-battery/i18n/zh-CN/cosmic_applet_battery.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cosmic-applet-button = Cosmic 按钮
battery = 省电
battery-desc = 降低功耗和性能
balanced = 平衡
Expand Down
Loading

0 comments on commit 2a5c8ad

Please sign in to comment.