Commit f0876551 authored by Amin Bandali's avatar Amin Bandali

profileview: add 'is swarm' indicator to profile view

GitLab: #1268
Change-Id: I9b521b0b5e10535f0024f1233fcdc2dcde76ddf1
parent c6e70793
......@@ -56,6 +56,7 @@ struct _ProfileViewPrivate
GtkWidget* username_label;
GtkWidget* id_label;
GtkWidget* qr_image;
GtkWidget* is_swarm_label;
};
G_DEFINE_TYPE_WITH_PRIVATE(ProfileView, profile_view, GTK_TYPE_DIALOG)
......@@ -101,6 +102,7 @@ profile_view_class_init(ProfileViewClass *klass)
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), ProfileView, username_label);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), ProfileView, id_label);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), ProfileView, qr_image);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS(klass), ProfileView, is_swarm_label);
}
static bool
......@@ -157,6 +159,9 @@ build_view(ProfileView* view)
g_free(surface);
g_free(cr);
auto is_swarm = convOpt->get().mode != lrc::api::conversation::Mode::NON_SWARM;
gtk_label_set_text(GTK_LABEL(priv->is_swarm_label), is_swarm ? _("Yes") : _("No"));
gtk_window_set_title(GTK_WINDOW(view), std::string("Profile - " + alias.toStdString()).c_str());
gtk_window_set_modal(GTK_WINDOW(view), false);
}
......
......@@ -171,6 +171,36 @@
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Is swarm</property>
<style>
<class name="sub_section_title"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="is_swarm_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="selectable">True</property>
<style>
<class name="value"/>
</style>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<placeholder/>
</child>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment