Skip to content

Commit

Permalink
Fix game list row changing height when notes icon is present
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkennerly committed Jul 25, 2024
1 parent 750056e commit 02e0ba9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/gui/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ fn template(content: Text, action: Option<Message>, style: Option<style::Button>
.into()
}

fn template_bare(content: Text, action: Option<Message>, style: Option<style::Button>) -> Element {
Button::new(content.horizontal_alignment(alignment::Horizontal::Center))
.on_press_maybe(action)
.style(style.unwrap_or(style::Button::Primary))
.padding(0)
.into()
}

pub fn primary<'a>(content: String, action: Option<Message>) -> Element<'a> {
Button::new(text(content).horizontal_alignment(alignment::Horizontal::Center))
.on_press_maybe(action)
Expand Down Expand Up @@ -470,7 +478,7 @@ pub fn validate_backups<'a>(ongoing: &Operation) -> Element<'a> {
}

pub fn show_game_notes<'a>(game: String, notes: Vec<manifest::Note>) -> Element<'a> {
template(
template_bare(
Icon::Info.text_narrow(),
Some(Message::ShowGameNotes { game, notes }),
Some(style::Button::Bare),
Expand Down

0 comments on commit 02e0ba9

Please sign in to comment.