Skip to content

Commit

Permalink
Merge pull request #362 from sarub0b0/update-split-direction-for-mult…
Browse files Browse the repository at this point in the history
…i-select-popup

feat(ui/multiple_select): Improve logic for determining split direction in multi-select popup
  • Loading branch information
sarub0b0 committed Jul 2, 2023
2 parents 06b2c03 + 4b44bb3 commit a48d612
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ui/widget/complex/multiple_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,11 @@ impl<'a> SelectForm<'a> {
}

fn update_layout(&mut self, chunk: Rect) {
if 65 < chunk.width {
self.direction = Direction::Horizontal;
} else {
// 等幅フォントのとき 幅:高さ = 1:2
if chunk.width < chunk.height * 4 {
self.direction = Direction::Vertical;
} else {
self.direction = Direction::Horizontal;
};
}

Expand Down

0 comments on commit a48d612

Please sign in to comment.