[Xfce4-commits] <postler:master> Only scroll selected message after showing viewer
Christian Dywan
noreply at xfce.org
Fri Jan 21 17:28:05 CET 2011
Updating branch refs/heads/master
to d0cacc3aed4455de7f28ef0124c9939f8c81e0a2 (commit)
from 06c430be07c11f6fdc592b135fde66afff3b4dbc (commit)
commit d0cacc3aed4455de7f28ef0124c9939f8c81e0a2
Author: Christian Dywan <christian at twotoasts.de>
Date: Fri Jan 21 17:25:54 2011 +0100
Only scroll selected message after showing viewer
postler/postler-bureau.vala | 13 ++++++++++++-
postler/postler-messages.vala | 6 ------
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index 5d107eb..f802fb7 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -692,9 +692,20 @@ public class Postler.Bureau : Gtk.Window {
viewer.hide ();
});
messages.notify["selected-location"].connect ((object, pspec) => {
- if (messages.selected_location != null) {
+ if (messages.selected_location != null && !viewer.visible) {
content.clear ();
viewer.show ();
+ /* Ensure that the selection is visible, in case of resizing */
+ Gtk.TreeIter iter = Gtk.TreeIter ();
+ GLib.List<Gtk.TreePath> paths;
+ paths = messages.get_selection ().get_selected_rows (null);
+ var path = paths.nth_data (0);
+ if (path != null && messages.model.get_iter (out iter, path)) {
+ GLib.Idle.add (() => {
+ messages.scroll_to_cell (path, null, false, 0, 0);
+ return false;
+ });
+ }
}
});
vpaned.pack2 (viewer, false, true);
diff --git a/postler/postler-messages.vala b/postler/postler-messages.vala
index 10446a4..2d058aa 100644
--- a/postler/postler-messages.vala
+++ b/postler/postler-messages.vala
@@ -56,12 +56,6 @@ public class Postler.Messages : Gtk.TreeView {
string location;
sort.get (sort_iter, Columns.LOCATION, out location);
selected_location = location;
- /* Ensure that the selection is visible, in case of resizing */
- GLib.Idle.add (() => {
- var path = sort.get_path (sort_iter);
- scroll_to_cell (path, null, false, 0, 0);
- return false;
- });
} else
selected_location = null;
}
More information about the Xfce4-commits
mailing list