Skip to content

Commit

Permalink
Add tooltips for find buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Jan 9, 2024
1 parent f3a8fef commit 133b8ca
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
2 changes: 2 additions & 0 deletions i18n/en/cosmic_edit.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ enable-vim-bindings = Enable Vim bindings
# Find
find-placeholder = Find...
find-previous = Find previous
find-next = Find next
# Menu

Expand Down
28 changes: 18 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1891,16 +1891,24 @@ impl Application for App {
);
let find_widget = widget::row::with_children(vec![
text_input.into(),
button(icon_cache_get("go-up-symbolic", 16))
.on_press(Message::FindPrevious)
.padding(space_xxs)
.style(style::Button::Icon)
.into(),
button(icon_cache_get("go-down-symbolic", 16))
.on_press(Message::FindNext)
.padding(space_xxs)
.style(style::Button::Icon)
.into(),
widget::tooltip(
button(icon_cache_get("go-up-symbolic", 16))
.on_press(Message::FindPrevious)
.padding(space_xxs)
.style(style::Button::Icon),
fl!("find-previous"),
widget::tooltip::Position::Top,
)
.into(),
widget::tooltip(
button(icon_cache_get("go-down-symbolic", 16))
.on_press(Message::FindNext)
.padding(space_xxs)
.style(style::Button::Icon),
fl!("find-next"),
widget::tooltip::Position::Top,
)
.into(),
widget::horizontal_space(Length::Fill).into(),
button(icon_cache_get("window-close-symbolic", 16))
.on_press(Message::Find(None))
Expand Down

0 comments on commit 133b8ca

Please sign in to comment.