Commit 05ea5fbd authored by Michael Gratton's avatar Michael Gratton 🍸 Committed by Michael Gratton
Browse files

client: Revert folder list expander change

This undoes the expander-related changes introduced in !618, to fix
regressions such as #1177 and #1184.
parent 3f6a8581
Pipeline #272949 passed with stages
in 20 minutes and 30 seconds
......@@ -136,7 +136,6 @@ client_vala_sources = files(
'sidebar/sidebar-common.vala',
'sidebar/sidebar-count-cell-renderer.vala',
'sidebar/sidebar-entry.vala',
'sidebar/sidebar-expander-renderer.vala',
'sidebar/sidebar-tree.vala',
'util/util-avatar.vala',
......
/* Copyright © 2020 Purism SPC
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
*/
/**
* Cell renderer for the expander in the sidebar.
*/
public class SidebarExpanderRenderer : Gtk.CellRendererPixbuf {
public signal void toggle(Gtk.TreePath path);
public weak Gtk.Widget widget { get; set; }
public SidebarExpanderRenderer(Gtk.Widget widget) {
this.widget = widget;
xalign = 1;
mode = Gtk.CellRendererMode.ACTIVATABLE;
notify["is-expanded"].connect (update_arrow);
update_arrow();
}
private void update_arrow() {
if (is_expanded)
this.icon_name = "go-down-symbolic";
else
this.icon_name = "go-next-symbolic";
}
public override bool activate (Gdk.Event event,
Gtk.Widget widget,
string path,
Gdk.Rectangle background_area,
Gdk.Rectangle cell_area,
Gtk.CellRendererState flags) {
toggle(new Gtk.TreePath.from_string (path));
return true;
}
}
......@@ -115,18 +115,10 @@ public class Sidebar.Tree : Gtk.TreeView {
end_column.set_cell_data_func(unread_renderer, counter_renderer_function);
end_column.pack_start(unread_renderer, false);
end_column.add_attribute(unread_renderer, "counter", Columns.COUNTER);
// Expander arrows.
SidebarExpanderRenderer expander_renderer = new SidebarExpanderRenderer(this);
expander_renderer.toggle.connect(toggle_branch_expansion);
end_column.set_cell_data_func(expander_renderer, expander_renderer_function);
end_column.pack_start(expander_renderer, false);
append_column(end_column);
set_headers_visible(false);
set_enable_search(false);
set_search_column(-1);
set_show_expanders(false);
set_reorderable(false);
set_enable_tree_lines(false);
set_grid_lines(Gtk.TreeViewGridLines.NONE);
......@@ -171,10 +163,6 @@ public class Sidebar.Tree : Gtk.TreeView {
renderer.visible = !(wrapper.entry is Sidebar.Header);
}
public void expander_renderer_function(Gtk.CellLayout layout, Gtk.CellRenderer renderer, Gtk.TreeModel model, Gtk.TreeIter iter) {
renderer.visible = renderer.is_expander;
}
public void counter_renderer_function(Gtk.CellLayout layout, Gtk.CellRenderer renderer, Gtk.TreeModel model, Gtk.TreeIter iter) {
EntryWrapper? wrapper = get_wrapper_at_iter(iter);
if (wrapper == null) {
......
......@@ -18,10 +18,6 @@
min-width: 250px;
}
.geary-folder-frame .sidebar .cell {
padding: 9px 6px;
}
.geary-conversation-frame > border {
border-left-width: 0;
border-top-width: 0;
......@@ -29,15 +25,10 @@
min-width: 360px;
}
treeview.sidebar {
border: none;
}
geary-conversation-viewer {
min-width: 360px;
}
/* For 3-pane mode only */
.geary-sidebar-pane-separator.vertical .conversation-frame > border {
border-bottom-width: 0;
}
......@@ -402,6 +393,20 @@ dialog.geary-remove-confirm .dialog-action-box {
/* FolderList.Tree */
treeview.sidebar {
border: none;
}
treeview.sidebar .cell {
padding: 9px 6px;
}
treeview.sidebar .cell:dir(ltr) {
padding-left: 0px;
}
treeview.sidebar .cell:dir(rtl) {
padding-right: 0px;
}
treeview.sidebar:drop(active).after,
treeview.sidebar:drop(active).before,
treeview.sidebar:drop(active).into {
......
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