aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2008-11-18 10:34:23 +0000
committerrowanbeentje <rowan@beent.je>2008-11-18 10:34:23 +0000
commit7cb7092431a98c369993608f504318fbd28ef5a6 (patch)
tree4e1ac27fba465c5797654ed2e0ddbdb40941fd82
parentc55412ca23dfba852f8bf4eae0c3249db32e90c8 (diff)
downloadsequelpro-7cb7092431a98c369993608f504318fbd28ef5a6.tar.gz
sequelpro-7cb7092431a98c369993608f504318fbd28ef5a6.tar.bz2
sequelpro-7cb7092431a98c369993608f504318fbd28ef5a6.zip
Experimental change: store the table content viewport before a refresh, and then restore it afterwards - ie suggestion (2) in http://groups.google.com/group/sequel-pro/browse_frm/thread/71541c6267fc08c1/2f4aeeaa7f15b268 .
I was initially in two minds as to whether this would be a good thing, but with r195/r196 removing the need to refresh for structural changes, this change does actually feel right to me - in fact, I now wish it didn't clear any filters/limit, and I'd like to preserve them as well. Any objections?
-rw-r--r--TableContent.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/TableContent.m b/TableContent.m
index 6c9c7341..8c72b724 100644
--- a/TableContent.m
+++ b/TableContent.m
@@ -319,7 +319,13 @@
reloads the table (performing a new mysql-query)
*/
{
+ // Store the current viewport location
+ NSRect viewRect = [tableContentView visibleRect];
+
[self loadTable:selectedTable];
+
+ // Restore the viewport
+ [tableContentView scrollRectToVisible:viewRect];
}
- (IBAction)reloadTableValues:(id)sender