From d44010d181847c6fa52b828afb0b673c0e9645ab Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 13 Feb 2015 18:16:11 +0100 Subject: Center on selected directory on startup Center on the selected dir in Filemanager on startup. Unfortunately it's not as straight as one would think. scrollTo doesn't work until the widget is painted, so we have to take a little detour... --- shemov.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index 4a6094b..6e3943c 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -144,6 +144,9 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla mArchiveBrowser->readConfig(); readSettings(); Helper::centerWidget(picViewer); + // craptastic... We can't center until it's painted, + // hence this indirection :( + mFSWidget->centerCurrent(); } void SheMov::closeEvent(QCloseEvent *event){ -- cgit v1.2.3-70-g09d2