diff options
author | fiaxh <git@lightrise.org> | 2022-10-03 19:14:45 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2022-10-03 19:14:45 +0200 |
commit | 21ab48e09aa6b0ade8f25bdc93f89f8d3aa462e7 (patch) | |
tree | 177680f1821666022afd9e5334084a8b90d47d50 /main/src/ui/add_conversation | |
parent | 146af3152475f12c9b19a92c4779a53f6fc517ce (diff) | |
download | dino-21ab48e09aa6b0ade8f25bdc93f89f8d3aa462e7.tar.gz dino-21ab48e09aa6b0ade8f25bdc93f89f8d3aa462e7.zip |
Fix channel join button not getting sensitive
Diffstat (limited to 'main/src/ui/add_conversation')
-rw-r--r-- | main/src/ui/add_conversation/conference_details_fragment.vala | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/main/src/ui/add_conversation/conference_details_fragment.vala b/main/src/ui/add_conversation/conference_details_fragment.vala index 721c660e..618d19ab 100644 --- a/main/src/ui/add_conversation/conference_details_fragment.vala +++ b/main/src/ui/add_conversation/conference_details_fragment.vala @@ -12,17 +12,7 @@ protected class ConferenceDetailsFragment : Box { public signal void joined(); - public bool done { - get { - try { - Jid parsed_jid = new Jid(jid); - return parsed_jid.localpart != null && parsed_jid.resourcepart == null && nick != null; - } catch (InvalidJidError e) { - return false; - } - } - private set {} - } + public bool done { get; private set; } public Account account { owned get { return account_combobox.selected; } @@ -118,8 +108,14 @@ protected class ConferenceDetailsFragment : Box { // nick_entry.key_release_event.connect(on_nick_key_release_event); // password_entry.key_release_event.connect(on_password_key_release_event); -// jid_entry.key_release_event.connect(() => { done = true; return false; }); // just for notifying -// nick_entry.key_release_event.connect(() => { done = true; return false; }); + var jid_entry_controller = new EventControllerKey(); + jid_entry_controller.key_released.connect(() => { check_if_done(); }); + jid_entry.add_controller(jid_entry_controller); + + var nick_entry_controller = new EventControllerKey(); + nick_entry_controller.key_released.connect(() => { check_if_done(); }); + nick_entry.add_controller(nick_entry_controller); + notification_button.clicked.connect(() => { notification_revealer.set_reveal_child(false); }); @@ -195,6 +191,15 @@ protected class ConferenceDetailsFragment : Box { notification_revealer.set_reveal_child(true); } + private void check_if_done() { + try { + Jid parsed_jid = new Jid(jid); + done = parsed_jid.localpart != null && parsed_jid.resourcepart == null && nick != null; + } catch (InvalidJidError e) { + done = false; + } + } + // private bool on_jid_key_release_event(EventKey event) { // jid_label.label = jid_entry.text; // if (event.keyval == Key.Return) jid_stack.set_visible_child_name("label"); |