mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-09-17 15:21:26 +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;
|
||||
@@ -73,7 +74,13 @@ impl Memory {
|
||||
}
|
||||
|
||||
impl BarWidget for Memory {
|
||||
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 output = self.output();
|
||||
if !output.is_empty() {
|
||||
@@ -102,7 +109,7 @@ impl BarWidget for Memory {
|
||||
TextFormat::simple(font_id, 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