[fractal/fractal-next] verification: Label cancel/decline btn based on state
- From: Julian Sparber <jsparber src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal/fractal-next] verification: Label cancel/decline btn based on state
- Date: Wed, 19 Jan 2022 12:31:40 +0000 (UTC)
commit 34eebf18424dfc341c2e6e1159505bbbf6a2ac17
Author: Julian Sparber <julian sparber net>
Date: Tue Jan 18 18:22:03 2022 +0100
verification: Label cancel/decline btn based on state
data/resources/ui/content-verification-info-bar.ui | 5 ++---
src/session/content/room_history/verification_info_bar.rs | 10 +++++++---
2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/data/resources/ui/content-verification-info-bar.ui
b/data/resources/ui/content-verification-info-bar.ui
index 79bd3a67..9567ed62 100644
--- a/data/resources/ui/content-verification-info-bar.ui
+++ b/data/resources/ui/content-verification-info-bar.ui
@@ -18,7 +18,7 @@
</object>
</child>
<child>
- <object class="GtkButton" id="button">
+ <object class="GtkButton" id="accept_btn">
<property name="action-name">verification.accept</property>
<property name="valign">center</property>
<style>
@@ -27,9 +27,8 @@
</object>
</child>
<child type="end">
- <object class="GtkButton">
+ <object class="GtkButton" id="cancel_btn">
<property name="margin-end">12</property>
- <property name="label" translatable="yes">Decline</property>
<property name="action-name">verification.decline</property>
<property name="valign">center</property>
</object>
diff --git a/src/session/content/room_history/verification_info_bar.rs
b/src/session/content/room_history/verification_info_bar.rs
index b1175284..e180c5e2 100644
--- a/src/session/content/room_history/verification_info_bar.rs
+++ b/src/session/content/room_history/verification_info_bar.rs
@@ -18,7 +18,9 @@ mod imp {
#[template_child]
pub label: TemplateChild<gtk::Label>,
#[template_child]
- pub button: TemplateChild<gtk::Button>,
+ pub accept_btn: TemplateChild<gtk::Button>,
+ #[template_child]
+ pub cancel_btn: TemplateChild<gtk::Button>,
pub request: RefCell<Option<IdentityVerification>>,
pub state_handler: RefCell<Option<SignalHandlerId>>,
pub user_handler: RefCell<Option<SignalHandlerId>>,
@@ -161,11 +163,13 @@ impl VerificationInfoBar {
"<b>{}</b> wants to be verified",
request.user().display_name()
));
- priv_.button.set_label(&gettext("Verify"));
+ priv_.accept_btn.set_label(&gettext("Verify"));
+ priv_.cancel_btn.set_label(&gettext("Decline"));
true
} else {
priv_.label.set_label(&gettext("Verification in progess"));
- priv_.button.set_label(&gettext("Continue"));
+ priv_.accept_btn.set_label(&gettext("Continue"));
+ priv_.cancel_btn.set_label(&gettext("Cancel"));
true
}
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]