Skip to content

Commit

Permalink
fix tab bar left rendering with icon
Browse files Browse the repository at this point in the history
  • Loading branch information
genusistimelord committed Dec 27, 2023
1 parent 43c38cb commit bc9e78f
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/native/tab_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ where
.size(size)
.font(font.unwrap_or_default())
.horizontal_alignment(alignment::Horizontal::Center)
.vertical_alignment(alignment::Vertical::Bottom)
.vertical_alignment(alignment::Vertical::Center)
.shaping(text::Shaping::Advanced)
.width(Length::Shrink)
}

fn layout_text<Renderer>(text: &str, size: f32, font: Option<Font>) -> Text<'_, Renderer>
Expand All @@ -381,8 +382,9 @@ where
.size(size)
.font(font.unwrap_or_default())
.horizontal_alignment(alignment::Horizontal::Center)
.vertical_alignment(alignment::Vertical::Bottom)
.vertical_alignment(alignment::Vertical::Center)
.shaping(text::Shaping::Advanced)
.width(Length::Shrink)
}

let row = self
Expand Down Expand Up @@ -438,13 +440,13 @@ where
column = column.push(
Row::new()
.align_items(Alignment::Center)
.push(layout_text(
text,
.push(layout_icon(
icon,
self.icon_size + 1.0,
self.font,
))
.push(layout_icon(
icon,
.push(layout_text(
text,
self.text_size + 1.0,
self.text_font,
)),
Expand All @@ -454,13 +456,13 @@ where
column = column
.push(layout_text(
text,
self.icon_size + 1.0,
self.font,
self.text_size + 1.0,
self.text_font,
))
.push(layout_icon(
icon,
self.text_size + 1.0,
self.text_font,
self.icon_size + 1.0,
self.font,
));
}
}
Expand Down

0 comments on commit bc9e78f

Please sign in to comment.