Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
-
81436bee
by wurstsalat at 2022-09-29T23:01:58+02:00
2 changed files:
Changes:
| ... | ... | @@ -155,7 +155,10 @@ def _on_chat_selected(self, |
| 155 | 155 | jid: JID) -> None:
|
| 156 | 156 | |
| 157 | 157 | self._chat_stack.show_chat(account, jid)
|
| 158 | - self._search_view.set_context(account, jid)
|
|
| 158 | + |
|
| 159 | + if self._search_revealer.get_reveal_child():
|
|
| 160 | + self._search_view.set_context(account, jid)
|
|
| 161 | + |
|
| 159 | 162 | self.emit('chat-selected', workspace_id, account, jid)
|
| 160 | 163 | |
| 161 | 164 | def _on_chat_unselected(self, _chat_list_stack: ChatListStack) -> None:
|
| ... | ... | @@ -170,7 +173,6 @@ def _on_search_history(self, |
| 170 | 173 | self._search_view.set_context(self._chat_control.contact.account,
|
| 171 | 174 | self._chat_control.contact.jid)
|
| 172 | 175 | |
| 173 | - self._search_view.clear()
|
|
| 174 | 176 | self._search_revealer.set_reveal_child(True)
|
| 175 | 177 | self._search_view.set_focus()
|
| 176 | 178 |
| ... | ... | @@ -78,11 +78,10 @@ def __init__(self) -> None: |
| 78 | 78 | app.ged.register_event_handler('account-disabled',
|
| 79 | 79 | ged.GUI1,
|
| 80 | 80 | self._on_account_state)
|
| 81 | - self._update_calendar()
|
|
| 82 | 81 | self.show_all()
|
| 83 | 82 | |
| 84 | 83 | def _on_account_state(self, _event: Any) -> None:
|
| 85 | - self.clear()
|
|
| 84 | + self._clear()
|
|
| 86 | 85 | |
| 87 | 86 | @staticmethod
|
| 88 | 87 | def _header_func(row: ResultRow, before: ResultRow) -> None:
|
| ... | ... | @@ -100,9 +99,9 @@ def _header_func(row: ResultRow, before: ResultRow) -> None: |
| 100 | 99 | |
| 101 | 100 | def _on_hide_clicked(self, _button: Gtk.Button) -> None:
|
| 102 | 101 | self.emit('hide-search')
|
| 103 | - self.clear()
|
|
| 102 | + self._clear()
|
|
| 104 | 103 | |
| 105 | - def clear(self) -> None:
|
|
| 104 | + def _clear(self) -> None:
|
|
| 106 | 105 | self._ui.search_entry.set_text('')
|
| 107 | 106 | self._clear_results()
|
| 108 | 107 | |
| ... | ... | @@ -357,6 +356,8 @@ def _on_row_activated(_listbox: SearchView, row: ResultRow) -> None: |
| 357 | 356 | |
| 358 | 357 | def set_focus(self) -> None:
|
| 359 | 358 | self._ui.search_entry.grab_focus()
|
| 359 | + self._clear()
|
|
| 360 | + self._update_calendar()
|
|
| 360 | 361 | |
| 361 | 362 | def set_context(self, account: Optional[str], jid: Optional[JID]) -> None:
|
| 362 | 363 | self._account = account
|