┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2006-12-06 16:50:13 +0000
committerPeter Penz <[email protected]>2006-12-06 16:50:13 +0000
commitcbe7e3a832c7efb9a64a2f94fdf8cb813d2cc824 (patch)
tree2f1b4fa67f6de3b61295b81ca8f9d37e551abdc2
parent197f9a4280d601a7dc145e9eb1dd2ffca6fb8980 (diff)
Patch from Dominik Hauman: Assure that when splitting a view both views take 50 % of the width. Also the flickering has been eliminated.
svn path=/trunk/playground/utils/dolphin/; revision=611081
-rw-r--r--src/dolphinmainwindow.cpp8
-rw-r--r--src/dolphinview.cpp1
2 files changed, 7 insertions, 2 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index fdda8d9e6..64678202a 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -819,12 +819,15 @@ void DolphinMainWindow::toggleSortOrder()
void DolphinMainWindow::toggleSplitView()
{
if (m_view[SecondaryIdx] == 0) {
+ const int newWidth = (m_view[PrimaryIdx]->width() - m_splitter->handleWidth()) / 2;
// create a secondary view
m_view[SecondaryIdx] = new DolphinView(this,
- m_splitter,
+ 0,
m_view[PrimaryIdx]->url(),
m_view[PrimaryIdx]->mode(),
m_view[PrimaryIdx]->isShowHiddenFilesEnabled());
+ m_splitter->addWidget(m_view[SecondaryIdx]);
+ m_splitter->setSizes(QList<int>() << newWidth << newWidth);
m_view[SecondaryIdx]->show();
}
else {
@@ -841,7 +844,7 @@ void DolphinMainWindow::toggleSplitView()
// From an implementation point of view it is more efficient to close
// the primary view and exchange the internal pointers afterwards.
m_view[PrimaryIdx]->close();
- m_view[PrimaryIdx]->deleteLater();
+ delete m_view[PrimaryIdx];
m_view[PrimaryIdx] = m_view[SecondaryIdx];
m_view[SecondaryIdx] = 0;
setActiveView(m_view[PrimaryIdx]);
@@ -1122,6 +1125,7 @@ void DolphinMainWindow::init()
homeUrl,
props.viewMode(),
props.isShowHiddenFilesEnabled());
+ m_view[PrimaryIdx]->show();
m_activeView = m_view[PrimaryIdx];
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index d2820e39e..3a73718e7 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -67,6 +67,7 @@ DolphinView::DolphinView(DolphinMainWindow *mainWindow,
m_fileCount(0),
m_filterBar(0)
{
+ hide();
setFocusPolicy(Qt::StrongFocus);
m_topLayout = new QVBoxLayout(this);
m_topLayout->setSpacing(0);