aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/call_window/call_encryption_button.vala
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/call_window/call_encryption_button.vala')
-rw-r--r--main/src/ui/call_window/call_encryption_button.vala28
1 files changed, 14 insertions, 14 deletions
diff --git a/main/src/ui/call_window/call_encryption_button.vala b/main/src/ui/call_window/call_encryption_button.vala
index 095db2b4..1b586f28 100644
--- a/main/src/ui/call_window/call_encryption_button.vala
+++ b/main/src/ui/call_window/call_encryption_button.vala
@@ -2,7 +2,7 @@ using Dino.Entities;
using Gtk;
using Pango;
-public class Dino.Ui.CallEncryptionButtonController {
+public class Dino.Ui.CallEncryptionButtonController : Object {
private bool has_been_set = false;
public bool controls_active { get; set; default=false; }
@@ -21,10 +21,10 @@ public class Dino.Ui.CallEncryptionButtonController {
public void set_icon(bool encrypted, string? icon_name) {
if (encrypted) {
button.icon_name = icon_name ?? "changes-prevent-symbolic";
- button.get_style_context().remove_class("unencrypted");
+ button.remove_css_class("unencrypted");
} else {
button.icon_name = icon_name ?? "changes-allow-symbolic";
- button.get_style_context().add_class("unencrypted");
+ button.add_css_class("unencrypted");
}
has_been_set = true;
update_opacity();
@@ -35,23 +35,23 @@ public class Dino.Ui.CallEncryptionButtonController {
button.set_popover(popover);
if (audio_encryption == null) {
- popover.set_child(new Label("This call is unencrypted.") { visible=true } );
+ popover.set_child(new Label("This call is unencrypted.") );
return;
}
if (title != null && !show_keys) {
- popover.set_child(new Label(title) { use_markup=true, visible=true } );
+ popover.set_child(new Label(title) { use_markup=true } );
return;
}
- Box box = new Box(Orientation.VERTICAL, 10) { visible=true };
- box.append(new Label("<b>%s</b>".printf(title ?? "This call is end-to-end encrypted.")) { use_markup=true, xalign=0, visible=true });
+ Box box = new Box(Orientation.VERTICAL, 10);
+ box.append(new Label("<b>%s</b>".printf(title ?? "This call is end-to-end encrypted.")) { use_markup=true, xalign=0 });
if (video_encryption == null) {
box.append(create_media_encryption_grid(audio_encryption));
} else {
- box.append(new Label("<b>Audio</b>") { use_markup=true, xalign=0, visible=true });
+ box.append(new Label("<b>Audio</b>") { use_markup=true, xalign=0 });
box.append(create_media_encryption_grid(audio_encryption));
- box.append(new Label("<b>Video</b>") { use_markup=true, xalign=0, visible=true });
+ box.append(new Label("<b>Video</b>") { use_markup=true, xalign=0 });
box.append(create_media_encryption_grid(video_encryption));
}
popover.set_child(box);
@@ -62,14 +62,14 @@ public class Dino.Ui.CallEncryptionButtonController {
}
private Grid create_media_encryption_grid(Xmpp.Xep.Jingle.ContentEncryption? encryption) {
- Grid ret = new Grid() { row_spacing=3, column_spacing=5, visible=true };
+ Grid ret = new Grid() { row_spacing=3, column_spacing=5 };
if (encryption.peer_key.length > 0) {
- ret.attach(new Label("Peer call key") { xalign=0, visible=true }, 1, 2, 1, 1);
- ret.attach(new Label("<span font_family='monospace'>" + format_fingerprint(encryption.peer_key) + "</span>") { use_markup=true, max_width_chars=25, ellipsize=EllipsizeMode.MIDDLE, xalign=0, hexpand=true, visible=true }, 2, 2, 1, 1);
+ ret.attach(new Label("Peer call key") { xalign=0 }, 1, 2, 1, 1);
+ ret.attach(new Label("<span font_family='monospace'>" + format_fingerprint(encryption.peer_key) + "</span>") { use_markup=true, max_width_chars=25, ellipsize=EllipsizeMode.MIDDLE, xalign=0, hexpand=true }, 2, 2, 1, 1);
}
if (encryption.our_key.length > 0) {
- ret.attach(new Label("Your call key") { xalign=0, visible=true }, 1, 3, 1, 1);
- ret.attach(new Label("<span font_family='monospace'>" + format_fingerprint(encryption.our_key) + "</span>") { use_markup=true, max_width_chars=25, ellipsize=EllipsizeMode.MIDDLE, xalign=0, hexpand=true, visible=true }, 2, 3, 1, 1);
+ ret.attach(new Label("Your call key") { xalign=0 }, 1, 3, 1, 1);
+ ret.attach(new Label("<span font_family='monospace'>" + format_fingerprint(encryption.our_key) + "</span>") { use_markup=true, max_width_chars=25, ellipsize=EllipsizeMode.MIDDLE, xalign=0, hexpand=true }, 2, 3, 1, 1);
}
return ret;
}