Browse Source

content: Use LabelWithWidgets to display inviter

merge-requests/1327/merge
Julian Sparber 5 years ago
parent
commit
47fc7cc383
  1. 12
      data/resources/ui/content-invite.ui
  2. 5
      src/session/content/invite.rs

12
data/resources/ui/content-invite.ui

@ -80,10 +80,10 @@
</object>
</child>
<child>
<object class="GtkBox">
<property name="halign">center</property>
<object class="LabelWithWidgets">
<property name="label" translatable="yes">&lt;widget&gt; invited you</property>
<child>
<object class="Pill" id="inviter">
<object class="Pill">
<binding name="user">
<lookup name="inviter">
<lookup name="room">ContentInvite</lookup>
@ -91,12 +91,6 @@
</binding>
</object>
</child>
<child>
<object class="GtkLabel">
<!-- Translators: the space at the beginning is there on purpose -->
<property name="label" translatable="yes"> invited you</property>
</object>
</child>
</object>
</child>
<child>

5
src/session/content/invite.rs

@ -1,5 +1,5 @@
use crate::{
components::{Pill, SpinnerButton},
components::{LabelWithWidgets, Pill, SpinnerButton},
session::{categories::CategoryType, room::Room},
};
use adw::subclass::prelude::*;
@ -23,8 +23,6 @@ mod imp {
#[template_child]
pub headerbar: TemplateChild<adw::HeaderBar>,
#[template_child]
pub inviter: TemplateChild<adw::HeaderBar>,
#[template_child]
pub room_topic: TemplateChild<gtk::Label>,
#[template_child]
pub accept_button: TemplateChild<SpinnerButton>,
@ -41,6 +39,7 @@ mod imp {
fn class_init(klass: &mut Self::Class) {
Pill::static_type();
SpinnerButton::static_type();
LabelWithWidgets::static_type();
Self::bind_template(klass);
klass.set_accessible_role(gtk::AccessibleRole::Group);

Loading…
Cancel
Save