Commit b548fc9b authored by Julian Sparber's avatar Julian Sparber Committed by Daniel Garcia Moreno

messages-history: remove blue selection and add more space inside each row

parent dc0f1e12
......@@ -154,7 +154,7 @@ color: @error_color;
color: @theme_selected_fg_color; }
.messages-history > row {
padding: 0 6px;
padding: 6px;
}
.autocomplete {
......
......@@ -1402,7 +1402,6 @@ 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();
......@@ -1420,7 +1419,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(),
_ => { is_small_widget = false; mb.widget()},
_ => mb.widget(),
}
}
......@@ -1428,9 +1427,6 @@ 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);
}
if last == LastViewed::Inline {
let divider: gtk::ListBoxRow = widgets::divider::new("New Messages");
......
......@@ -25,6 +25,7 @@ pub fn new(text: &str) -> gtk::ListBoxRow {
divider.pack_start(&right_separator, true, true, 0);
divider_row.add(&divider);
divider_row.set_selectable(false);
divider_row.show_all();
divider_row
......
......@@ -48,7 +48,7 @@ impl<'a> MessageBox<'a> {
}
}
pub fn widget(&self) -> gtk::Box {
pub fn widget(&self) -> gtk::ListBoxRow {
// msg
// +--------+---------+
// | avatar | content |
......@@ -58,18 +58,19 @@ 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, 0);
msg_widget.pack_start(&content, true, true, 0);
msg_widget.show_all();
let row = gtk::ListBoxRow::new();
row.set_selectable(false);
row.set_margin_top(12);
row.add(&msg_widget);
row.show_all();
msg_widget
row
}
pub fn small_widget(&self) -> gtk::Box {
pub fn small_widget(&self) -> gtk::ListBoxRow {
// msg
// +--------+---------+
// | | content |
......@@ -77,14 +78,15 @@ 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, 50);
msg_widget.show_all();
let row = gtk::ListBoxRow::new();
row.set_selectable(false);
row.add(&msg_widget);
row.show_all();
msg_widget
row
}
fn build_room_msg_content(&self, small: bool) -> gtk::Box {
......
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