Commit 93b663d5 authored by Christopher Davis's avatar Christopher Davis 🌱

directory: Adapt room directory for mobile sizes

Makes it so that the room directory can scale down to mobile
sizes.
parent fbf8162f
Pipeline #97048 failed with stages
in 8 minutes and 11 seconds
......@@ -79,6 +79,16 @@
font-size: x-small;
}
frame.room-directory > border {
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
.room-directory {
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
.room-directory row {
padding-top: 18px;
padding-bottom: 18px;
......
......@@ -634,9 +634,11 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkHeaderBar">
<object class="HdyHeaderBar">
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<property name="width_request">360</property>
<property name="centering_policy">HDY_CENTERING_POLICY_STRICT</property>
<child>
<object class="GtkButton" id="back_button">
<property name="visible">True</property>
......@@ -658,56 +660,98 @@
</object>
</child>
<child type="title">
<object class="GtkSearchEntry" id="directory_search_entry">
<object class="HdyColumn">
<property name="can_focus">False</property>
<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="maximum_width">288</property>
<property name="linear_growth_width">288</property>
<child>
<object class="GtkSearchEntry" id="directory_search_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">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>
<object class="GtkMenuButton" id="server_chooser_menu">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="popover">server_chooser_popover</property>
<object class="HdySqueezer">
<child>
<object class="GtkBox">
<object class="GtkMenuButton" id="server_chooser_menu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="popover">server_chooser_popover</property>
<child>
<object class="GtkLabel" id="directory_choice_label">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Default Matrix Server</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="directory_choice_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Default Matrix Server</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">pan-down-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<child>
<object class="GtkMenuButton" id="server_chooser_menu_small">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="popover">server_chooser_popover</property>
<property name="hexpand">False</property>
<property name="halign">end</property>
<child>
<object class="GtkImage">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">pan-down-symbolic</property>
<property name="spacing">6</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">network-server-symbolic</property>
</object>
</child>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">pan-down-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
......
......@@ -33,10 +33,13 @@ impl App {
column.set_hexpand(true);
column.set_vexpand(true);
column.set_margin_top(24);
column.set_margin_start(12);
column.set_margin_end(12);
let frame = gtk::Frame::new(None);
frame.set_shadow_type(gtk::ShadowType::In);
frame.add(&listbox);
frame.get_style_context().add_class("room-directory");
column.add(&frame);
listbox.show();
frame.show();
......
......@@ -83,6 +83,8 @@ impl<'a> RoomBox<'a> {
}
let alias_label = gtk::Label::new(None);
alias_label.set_line_wrap(true);
alias_label.set_line_wrap_mode(pango::WrapMode::WordChar);
alias_label.set_markup(&format!(
"<span alpha=\"60%\">{}</span>",
room.alias.clone().unwrap_or_default()
......@@ -102,10 +104,8 @@ impl<'a> RoomBox<'a> {
}
details_box.add(&alias_label);
widget_box.pack_start(&details_box, true, true, 0);
let membership_grid = gtk::Grid::new();
membership_grid.set_row_spacing(6);
membership_grid.set_column_spacing(6);
let members_icon = gtk::Image::new_from_icon_name(
Some("system-users-symbolic"),
......@@ -124,11 +124,13 @@ impl<'a> RoomBox<'a> {
});
join_button.set_property_width_request(JOIN_BUTTON_WIDTH);
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.attach(&join_button, 0, 0, 4, 1);
membership_grid.attach(&members_icon, 5, 0, 1, 1);
membership_grid.attach(&members_count, 6, 0, 1, 1);
widget_box.pack_start(&membership_grid, false, false, 18);
details_box.add(&membership_grid);
widget_box.pack_start(&details_box, true, true, 0);
widget_box.show_all();
widget_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