mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-18 17:56:56 +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;
|
||||
@@ -115,7 +116,13 @@ impl Battery {
|
||||
}
|
||||
|
||||
impl BarWidget for Battery {
|
||||
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() {
|
||||
@@ -147,7 +154,7 @@ impl BarWidget for Battery {
|
||||
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| {
|
||||
ui.add(
|
||||
Label::new(layout_job)
|
||||
.selectable(false)
|
||||
|
||||
Reference in New Issue
Block a user