Do not panic if active_layouts is empty, fixes #550
This commit is contained in:
parent
8637169d9e
commit
bfb2745176
2 changed files with 10 additions and 2 deletions
|
|
@ -604,7 +604,11 @@ impl App {
|
|||
widget::container(
|
||||
widget::button::custom(
|
||||
widget::text(
|
||||
self.common.active_layouts[self.common.current_keyboard_layout].name(),
|
||||
self.common
|
||||
.active_layouts
|
||||
.get(self.common.current_keyboard_layout)
|
||||
.map(|x| x.name())
|
||||
.unwrap_or_default(),
|
||||
)
|
||||
.ellipsize(Ellipsize::End(EllipsizeHeightLimit::Lines(1)))
|
||||
.height(16)
|
||||
|
|
|
|||
|
|
@ -421,7 +421,11 @@ impl App {
|
|||
widget::container(
|
||||
widget::button::custom(
|
||||
widget::text(
|
||||
self.common.active_layouts[self.common.current_keyboard_layout].name(),
|
||||
self.common
|
||||
.active_layouts
|
||||
.get(self.common.current_keyboard_layout)
|
||||
.map(|x| x.name())
|
||||
.unwrap_or_default(),
|
||||
)
|
||||
.ellipsize(Ellipsize::End(EllipsizeHeightLimit::Lines(1)))
|
||||
.height(16)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue