...
 
Commits (2)
......@@ -1009,13 +1009,21 @@
</object>
</child>
<child type="title">
<object class="GtkSearchEntry" id="directory_search_entry">
<object class="HdyColumn">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="width_chars">30</property>
<property name="primary_icon_name">edit-find-symbolic</property>
<property name="primary_icon_activatable">False</property>
<property name="primary_icon_sensitive">False</property>
<property name="hexpand">True</property>
<property name="maximum_width">290</property>
<property name="linear_growth_width">290</property>
<child>
<object class="GtkSearchEntry" id="directory_search_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="primary_icon_name">edit-find-symbolic</property>
<property name="primary_icon_activatable">False</property>
<property name="primary_icon_sensitive">False</property>
</object>
</child>
</object>
</child>
<child>
......
......@@ -122,12 +122,55 @@ impl<'a> RoomBox<'a> {
});
join_button.set_property_width_request(JOIN_BUTTON_WIDTH);
let bottom_join_button = gtk::Button::new_with_label(i18n("Join").as_str());
let room_id = room.id.clone();
let backend = self.op.backend.clone();
bottom_join_button.connect_clicked(move |_| {
backend.send(BKCommand::JoinRoom(room_id.clone())).unwrap();
});
bottom_join_button.set_property_width_request(JOIN_BUTTON_WIDTH);
let bottom_icon =
gtk::Image::new_from_icon_name("system-users-symbolic", gtk::IconSize::Menu.into());
bottom_icon
.get_style_context()
.map(|c| c.add_class("dim-label"));
let bottom_count = gtk::Label::new(&format!("{}", room.n_members)[..]);
bottom_count
.get_style_context()
.map(|c| c.add_class("dim-label"));
let bottom_container = gtk::Box::new(gtk::Orientation::Horizontal, 6);
bottom_container.add(&bottom_join_button);
bottom_container.add(&bottom_icon);
bottom_container.add(&bottom_count);
// Show all the children within but not the container
bottom_container.show_all();
bottom_container.set_no_show_all(true);
details_box.add(&bottom_container);
membership_grid.attach(&members_icon, 1, 0, 1, 1);
membership_grid.attach(&members_count, 2, 0, 1, 1);
membership_grid.attach(&join_button, 0, 1, 4, 1);
membership_grid
.bind_property("visible", &bottom_container, "visible")
.flags(glib::BindingFlags::SYNC_CREATE)
.flags(glib::BindingFlags::INVERT_BOOLEAN)
.build()
.unwrap();
widget_box.pack_start(&membership_grid, false, false, 18);
let weak_grid = membership_grid.downgrade();
widget_box.connect_size_allocate(move |_, allocation| {
let grid = upgrade_weak!(weak_grid, ());
grid.set_visible(allocation.width >= 500);
});
widget_box.show_all();
widget_box
}
......