mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-09 06:25:23 +02:00
proper widget spacing based on alignment
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use crate::bar::Alignment;
|
||||
use crate::config::LabelPrefix;
|
||||
use crate::widget::BarWidget;
|
||||
use crate::widget::RenderConfig;
|
||||
@@ -79,7 +80,13 @@ impl Storage {
|
||||
}
|
||||
|
||||
impl BarWidget for Storage {
|
||||
fn render(&mut self, ctx: &Context, ui: &mut Ui, mut config: RenderConfig) {
|
||||
fn render(
|
||||
&mut self,
|
||||
ctx: &Context,
|
||||
ui: &mut Ui,
|
||||
mut config: RenderConfig,
|
||||
alignment: Alignment,
|
||||
) {
|
||||
if self.enable {
|
||||
let font_id = ctx
|
||||
.style()
|
||||
@@ -107,7 +114,7 @@ impl BarWidget for Storage {
|
||||
TextFormat::simple(font_id.clone(), ctx.style().visuals.text_color()),
|
||||
);
|
||||
|
||||
config.grouping.apply_on_widget(true, ui, |ui| {
|
||||
config.grouping.apply_on_widget(true, alignment, ui, |ui| {
|
||||
if ui
|
||||
.add(
|
||||
Label::new(layout_job)
|
||||
|
||||
Reference in New Issue
Block a user