feat(bar): scale icon size with font size

This commit changes the way icons are displayed on the bar.

There was an issue with how app icons were sized using shrink_to_fit.

This has been changed to use fit_to_exact_size instead, relying on the
font size as a starting point and scaling it to 1.4 of its size, making
the icons to appear larger.

The same scaling was done to all the widget icons as well to make them
look unified.
This commit is contained in:
Csaba
2024-12-17 12:58:36 -08:00
committed by LGUG2Z
parent 804faef229
commit 3c0b12f9af
13 changed files with 124 additions and 134 deletions
+6 -6
View File
@@ -270,9 +270,6 @@ impl Komobar {
let theme_color = *self.bg_color.borrow();
self.render_config
.replace(config.new_renderconfig(theme_color));
self.bg_color
.replace(theme_color.try_apply_alpha(config.transparency_alpha));
@@ -281,6 +278,9 @@ impl Komobar {
Self::set_font_size(ctx, *font_size);
}
self.render_config
.replace(config.new_renderconfig(ctx, theme_color));
let mut komorebi_widget = None;
let mut komorebi_widget_idx = None;
let mut komorebi_notification_state = previous_notification_state;
@@ -503,7 +503,7 @@ impl eframe::App for Komobar {
ui.horizontal_centered(|ui| {
// Left-aligned widgets layout
ui.with_layout(Layout::left_to_right(Align::Center), |ui| {
let mut render_conf = *render_config;
let mut render_conf = render_config.clone();
render_conf.alignment = Some(Alignment::Left);
render_config.apply_on_alignment(ui, |ui| {
@@ -515,7 +515,7 @@ impl eframe::App for Komobar {
// Right-aligned widgets layout
ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
let mut render_conf = *render_config;
let mut render_conf = render_config.clone();
render_conf.alignment = Some(Alignment::Right);
render_config.apply_on_alignment(ui, |ui| {
@@ -532,7 +532,7 @@ impl eframe::App for Komobar {
.show(ctx, |ui| {
Frame::none().show(ui, |ui| {
ui.horizontal_centered(|ui| {
let mut render_conf = *render_config;
let mut render_conf = render_config.clone();
render_conf.alignment = Some(Alignment::Center);
render_config.apply_on_alignment(ui, |ui| {