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

Show an icon in direct rooms

I've removed the circle around the direct chat avatar and add an icon
after the avatar and before the room name to differ quickly between
direct and normal rooms.
parent ba4d51f2
......@@ -69,11 +69,9 @@
font-size: x-small;
}
.direct {
border: 3px solid alpha(@theme_selected_bg_color, 0.70);
border-radius: 20px;
.direct-chat {
color: alpha(@theme_fg_color, 0.5);
}
.room-list list row:selected .direct {
border: 3px solid @theme_selected_fg_color;
.room-list list row:selected .direct-chat {
color: alpha(@theme_selected_fg_color, 0.5);
}
......@@ -31,6 +31,7 @@ pub struct RoomRow {
baseu: Url,
pub room: Room,
pub icon: widgets::Avatar,
pub direct: gtk::Image,
pub text: gtk::Label,
pub notifications: gtk::Label,
pub widget: gtk::EventBox,
......@@ -42,11 +43,9 @@ impl RoomRow {
let name = room.name.clone().unwrap_or_default();
let avatar = room.avatar.clone().unwrap_or_default();
let icon = widgets::Avatar::avatar_new(Some(ICON_SIZE));
if room.direct {
if let Some(style) = icon.get_style_context() {
style.add_class("direct");
}
let direct = gtk::Image::new_from_icon_name("avatar-default-symbolic", 1);
if let Some(style) = direct.get_style_context() {
style.add_class("direct-chat");
}
let text = gtk::Label::new(name.clone().as_str());
......@@ -91,6 +90,7 @@ impl RoomRow {
notifications,
baseu,
widget,
direct,
};
rr.connect_dnd();
......@@ -167,6 +167,9 @@ impl RoomRow {
}
b.pack_start(&self.icon, false, false, 5);
if self.room.direct {
b.pack_start(&self.direct, false, false, 0);
}
b.pack_start(&self.text, true, true, 0);
b.pack_start(&self.notifications, false, false, 5);
self.widget.show_all();
......
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