diff options
author | fiaxh <git@lightrise.org> | 2022-05-14 14:45:59 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2022-07-27 20:34:20 +0200 |
commit | f44cbe02c17df1f02ad49c63cd784fec0ea02d85 (patch) | |
tree | 4cab9b5f84d88769d19b0698e24b318f50b6144e /plugins/omemo/src | |
parent | 2b3ce5fc95c63ed7d54e207db0585c8b8bbcd603 (diff) | |
download | dino-f44cbe02c17df1f02ad49c63cd784fec0ea02d85.tar.gz dino-f44cbe02c17df1f02ad49c63cd784fec0ea02d85.zip |
Improve Gtk4 port
Diffstat (limited to 'plugins/omemo/src')
4 files changed, 15 insertions, 15 deletions
diff --git a/plugins/omemo/src/ui/bad_messages_populator.vala b/plugins/omemo/src/ui/bad_messages_populator.vala index ca0bd35d..3cb3375b 100644 --- a/plugins/omemo/src/ui/bad_messages_populator.vala +++ b/plugins/omemo/src/ui/bad_messages_populator.vala @@ -159,8 +159,8 @@ public class BadMessagesWidget : Box { } else { warning_text += _("%s does not trust this device. That means, you might be missing messages.").printf(who); } - Label label = new Label(warning_text) { margin_start=70, margin_end=70, justify=Justification.CENTER, use_markup=true, selectable=true, wrap=true, wrap_mode=Pango.WrapMode.WORD_CHAR, hexpand=true, visible=true }; - label.get_style_context().add_class("dim-label"); + Label label = new Label(warning_text) { margin_start=70, margin_end=70, justify=Justification.CENTER, use_markup=true, selectable=true, wrap=true, wrap_mode=Pango.WrapMode.WORD_CHAR, hexpand=true }; + label.add_css_class("dim-label"); this.append(label); label.activate_link.connect(() => { diff --git a/plugins/omemo/src/ui/contact_details_dialog.vala b/plugins/omemo/src/ui/contact_details_dialog.vala index 80943824..ab216c58 100644 --- a/plugins/omemo/src/ui/contact_details_dialog.vala +++ b/plugins/omemo/src/ui/contact_details_dialog.vala @@ -109,7 +109,7 @@ public class ContactDetailsDialog : Gtk.Dialog { qrcode_image.set_from_pixbuf(qr_pixbuf); qrcode_image.margin_top = qrcode_image.margin_end = qrcode_image.margin_bottom = qrcode_image.margin_start = QUIET_ZONE_MODULES*MODULE_SIZE_PX; - qrcode_popover.get_style_context().add_class("qrcode-container"); + qrcode_popover.add_css_class("qrcode-container"); show_qrcode_button.popover = qrcode_popover; } @@ -260,12 +260,12 @@ public class ContactDetailsDialog : Gtk.Dialog { Button accept_button = new Button() { visible = true, valign = Align.CENTER, hexpand = true }; accept_button.set_icon_name("emblem-ok-symbolic"); // using .image = sets .image-button. Together with .suggested/destructive action that breaks the button Adwaita - accept_button.get_style_context().add_class("suggested-action"); + accept_button.add_css_class("suggested-action"); accept_button.tooltip_text = _("Accept key"); Button reject_button = new Button() { visible = true, valign = Align.CENTER, hexpand = true }; reject_button.set_icon_name("action-unavailable-symbolic"); - reject_button.get_style_context().add_class("destructive-action"); + reject_button.add_css_class("destructive-action"); reject_button.tooltip_text = _("Reject key"); accept_button.clicked.connect(() => { @@ -285,13 +285,13 @@ public class ContactDetailsDialog : Gtk.Dialog { }); string res = fingerprint_markup(fingerprint_from_base64(device[plugin.db.identity_meta.identity_key_public_base64])); - Label fingerprint_label = new Label(res) { use_markup=true, justify=Justification.RIGHT, visible=true, halign = Align.START, valign = Align.CENTER, hexpand = false }; + Label fingerprint_label = new Label(res) { use_markup=true, justify=Justification.RIGHT, halign = Align.START, valign = Align.CENTER, hexpand = false }; box.append(fingerprint_label); Box control_box = new Box(Gtk.Orientation.HORIZONTAL, 0) { visible = true, hexpand = true }; control_box.append(accept_button); control_box.append(reject_button); - control_box.get_style_context().add_class("linked"); // .linked: Visually link the accept / reject buttons + control_box.add_css_class("linked"); // .linked: Visually link the accept / reject buttons box.append(control_box); lbr.set_child(box); @@ -304,7 +304,7 @@ public class ContactDetailsDialog : Gtk.Dialog { public class FingerprintRow : ListBoxRow { private Image trust_image = new Image() { visible = true, halign = Align.END }; - private Label fingerprint_label = new Label("") { use_markup=true, justify=Justification.RIGHT, visible=true, halign = Align.START, valign = Align.CENTER, hexpand = false }; + private Label fingerprint_label = new Label("") { use_markup=true, justify=Justification.RIGHT, halign = Align.START, valign = Align.CENTER, hexpand = false }; private Label trust_label = new Label(null) { visible = true, hexpand = true, xalign = 0 }; public Row row; @@ -333,17 +333,17 @@ public class FingerprintRow : ListBoxRow { case TrustLevel.TRUSTED: trust_image.icon_name = "emblem-ok-symbolic"; trust_label.set_markup("<span color='#1A63D9'>%s</span>".printf(_("Accepted"))); - fingerprint_label.get_style_context().remove_class("dim-label"); + fingerprint_label.remove_css_class("dim-label"); break; case TrustLevel.UNTRUSTED: trust_image.icon_name = "action-unavailable-symbolic"; trust_label.set_markup("<span color='#D91900'>%s</span>".printf(_("Rejected"))); - fingerprint_label.get_style_context().add_class("dim-label"); + fingerprint_label.add_css_class("dim-label"); break; case TrustLevel.VERIFIED: trust_image.icon_name = "security-high-symbolic"; trust_label.set_markup("<span color='#1A63D9'>%s</span>".printf(_("Verified"))); - fingerprint_label.get_style_context().remove_class("dim-label"); + fingerprint_label.remove_css_class("dim-label"); break; } diff --git a/plugins/omemo/src/ui/device_notification_populator.vala b/plugins/omemo/src/ui/device_notification_populator.vala index 9f40353d..fafe7a24 100644 --- a/plugins/omemo/src/ui/device_notification_populator.vala +++ b/plugins/omemo/src/ui/device_notification_populator.vala @@ -69,8 +69,8 @@ private class ConversationNotification : MetaConversationNotification { this.jid = jid; this.account = account; - Box box = new Box(Orientation.HORIZONTAL, 5) { visible=true }; - Button manage_button = new Button.with_label(_("Manage")) { visible=true }; + Box box = new Box(Orientation.HORIZONTAL, 5); + Button manage_button = new Button.with_label(_("Manage")); manage_button.clicked.connect(() => { manage_button.activate(); ContactDetailsDialog dialog = new ContactDetailsDialog(plugin, account, jid); @@ -80,7 +80,7 @@ private class ConversationNotification : MetaConversationNotification { }); dialog.present(); }); - box.append(new Label(_("This contact has new devices")) { margin_end=10, visible=true }); + box.append(new Label(_("This contact has new devices")) { margin_end=10 }); box.append(manage_button); widget = box; } diff --git a/plugins/omemo/src/ui/manage_key_dialog.vala b/plugins/omemo/src/ui/manage_key_dialog.vala index a4b61f70..19f16a59 100644 --- a/plugins/omemo/src/ui/manage_key_dialog.vala +++ b/plugins/omemo/src/ui/manage_key_dialog.vala @@ -105,7 +105,7 @@ public class ManageKeyDialog : Gtk.Dialog { Pango.AttrList desc_attrs = new Pango.AttrList(); desc_attrs.insert(Pango.attr_scale_new(0.8)); lbl_desc.attributes = desc_attrs; - lbl_desc.get_style_context().add_class("dim-label"); + lbl_desc.add_css_class("dim-label"); box.append(lbl_title); box.append(lbl_desc); |