Commit 3a92de6e authored by Julian Sparber's avatar Julian Sparber

fix spacing around messages

parent f355fdc3
......@@ -42,8 +42,13 @@
margin: 3px;
}
.username {
row .username {
font-weight: bold;
font-size: small;
}
row:not(:selected) .username {
color: #4a90d9
}
.room-title {
......
......@@ -1103,6 +1103,7 @@ impl AppOp {
if msg.room == self.active_room.clone().unwrap_or_default() {
if let Some(r) = self.rooms.get(&self.active_room.clone().unwrap_or_default()) {
let m;
let mut is_small_widget = true;
{
let mb = widgets::MessageBox::new(r, &msg, &self);
let entry = msg_entry.clone();
......@@ -1120,7 +1121,7 @@ impl AppOp {
m = match calc_prev {
Some(ref p) if self.should_group(&msg, p) => mb.small_widget(),
Some(_) if self.has_small_mtype(&msg) => mb.small_widget(),
_ => mb.widget(),
_ => { is_small_widget = false; mb.widget()},
}
}
......@@ -1128,6 +1129,9 @@ impl AppOp {
MsgPos::Bottom => messages.add(&m),
MsgPos::Top => messages.insert(&m, 1),
};
if !is_small_widget {
m.get_parent().unwrap().set_margin_top(12);
}
self.shown_messages += 1;
}
self.remove_tmp_room_message(&msg);
......
......@@ -58,6 +58,9 @@ impl<'a> MessageBox<'a> {
let content = self.build_room_msg_content(false);
let avatar = self.build_room_msg_avatar();
msg_widget.set_margin_top(2);
msg_widget.set_margin_bottom(2);
msg_widget.pack_start(&avatar, false, false, 5);
msg_widget.pack_start(&content, true, true, 0);
......@@ -74,6 +77,9 @@ impl<'a> MessageBox<'a> {
let msg_widget = gtk::Box::new(gtk::Orientation::Horizontal, 5);
let content = self.build_room_msg_content(true);
msg_widget.set_margin_top(2);
msg_widget.set_margin_bottom(2);
msg_widget.pack_start(&content, true, true, 55);
msg_widget.show_all();
......@@ -93,6 +99,7 @@ impl<'a> MessageBox<'a> {
if !small {
let info = self.build_room_msg_info(self.msg);
info.set_margin_bottom(2);
content.pack_start(&info, false, false, 0);
}
......
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