Commit c8cfb684 authored by Daniel García Moreno's avatar Daniel García Moreno

Styles for Invite Accept/Reject dialog

See #34
parent 5470f687
......@@ -19,76 +19,6 @@
<mime-type>image/gif</mime-type>
</mime-types>
</object>
<object class="GtkMessageDialog" id="invite_dialog">
<property name="can_focus">False</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property>
<property name="urgency_hint">True</property>
<property name="deletable">False</property>
<property name="gravity">center</property>
<property name="transient_for">main_window</property>
<property name="attached_to">main_window</property>
<property name="message_type">question</property>
<property name="text" translatable="yes">Invitation</property>
<property name="secondary_text" translatable="yes">You've been invited to join to "", you can accept or reject</property>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="homogeneous">True</property>
<property name="layout_style">expand</property>
<child>
<object class="GtkButton" id="invite_accept">
<property name="label" translatable="yes">Accept</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="invite_reject">
<property name="label" translatable="yes">Reject</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<style>
<class name="destructive-action"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<child>
<placeholder/>
</child>
<style>
<class name="leave-room"/>
</style>
</object>
<object class="GtkPopoverMenu" id="members_popover">
<property name="can_focus">False</property>
<child>
......@@ -1373,6 +1303,73 @@ Join a room to start to chat</property>
</object>
</child>
</object>
<object class="GtkMessageDialog" id="invite_dialog">
<property name="can_focus">False</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property>
<property name="urgency_hint">True</property>
<property name="deletable">False</property>
<property name="gravity">center</property>
<property name="transient_for">main_window</property>
<property name="attached_to">main_window</property>
<property name="message_type">question</property>
<property name="text" translatable="yes">Invitation</property>
<property name="secondary_text" translatable="yes">You've been invited to join to "", you can accept or reject</property>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="homogeneous">True</property>
<property name="layout_style">expand</property>
<child>
<object class="GtkButton" id="invite_reject">
<property name="label" translatable="yes">Reject</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="invite_accept">
<property name="label" translatable="yes">Accept</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<child>
<placeholder/>
</child>
<style>
<class name="leave-room"/>
</style>
</object>
<object class="GtkMessageDialog" id="leave_room_dialog">
<property name="can_focus">False</property>
<property name="resizable">False</property>
......
......@@ -684,17 +684,18 @@ impl AppOp {
.expect("Can't find invite_dialog in ui file.");
let room_name = r.name.clone().unwrap_or_default();
let title = format!("Join to {}?", room_name);
let title = format!("Join {}?", room_name);
let secondary;
if let Some(ref sender) = r.inv_sender {
let sender_name = sender.get_alias().unwrap_or(sender.uid.clone());
secondary = format!("You've been invited to join to \"{}\" room by \"{}\"",
secondary = format!("You've been invited to join to <b>{}</b> room by <b>{}</b>",
room_name, sender_name);
} else {
secondary = format!("You've been invited to join to \"{}\"", room_name);
secondary = format!("You've been invited to join to <b>{}</b>", room_name);
}
dialog.set_property_text(Some(&title));
dialog.set_property_secondary_use_markup(true);
dialog.set_property_secondary_text(Some(&secondary));
let accept = self.gtk_builder
......
......@@ -50,7 +50,7 @@ impl RoomRow {
let n = room.notifications;
let h = room.highlight;
let ntext = match room.inv {
true => String::from(" "),
true => String::from(""),
false => format!("{}", n),
};
let notifications = gtk::Label::new(&ntext[..]);
......
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