┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphincolumnview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-10-09 18:46:58 +0000
committerPeter Penz <[email protected]>2010-10-09 18:46:58 +0000
commite8d895a91f45c3486e27fad01d01e6b40e7284ae (patch)
treec5b07739221c2783ca3e73d202f11e2b3c7105e8 /src/views/dolphincolumnview.cpp
parent71454158cc72d071b99789ffcf4e18f7184c765d (diff)
* Increase the column-width automatically in case where the name of the file does not fit into the available width
* When scrolling to the active column, do it with a small delay so that temporary activations of a column don't result in jittering BUG: 214324 FIXED-IN: 4.6.0 svn path=/trunk/KDE/kdebase/apps/; revision=1184290
Diffstat (limited to 'src/views/dolphincolumnview.cpp')
-rw-r--r--src/views/dolphincolumnview.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/views/dolphincolumnview.cpp b/src/views/dolphincolumnview.cpp
index 309674122..4b3a9f582 100644
--- a/src/views/dolphincolumnview.cpp
+++ b/src/views/dolphincolumnview.cpp
@@ -120,6 +120,7 @@ DolphinColumnView::DolphinColumnView(QWidget* parent,
m_dirLister->setDelayedMimeTypes(true);
const bool showHiddenFiles = m_container->m_dolphinViewController->view()->showHiddenFiles();
m_dirLister->setShowingDotFiles(showHiddenFiles);
+ connect(m_dirLister, SIGNAL(completed()), this, SLOT(slotDirListerCompleted()));
m_dolphinModel = new DolphinModel(this);
m_dolphinModel->setDirLister(m_dirLister);
@@ -496,6 +497,34 @@ void DolphinColumnView::slotShowPreviewChanged()
updateDecorationSize(view->showPreview());
}
+void DolphinColumnView::slotDirListerCompleted()
+{
+ if (!m_childUrl.isEmpty()) {
+ return;
+ }
+
+ // Try to optimize the width of the column, so that no name gets clipped
+ const int requiredWidth = sizeHintForColumn(DolphinModel::Name);
+
+ const ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
+ if (requiredWidth > settings->columnWidth()) {
+ int frameAroundContents = 0;
+ if (style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents)) {
+ // TODO: Using 2 PM_DefaultFrameWidths are not sufficient. Check Qt-code
+ // for other pixelmetrics that should be added...
+ frameAroundContents = style()->pixelMetric(QStyle::PM_DefaultFrameWidth) * 4;
+ }
+
+ const int scrollBarWidth = style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, verticalScrollBar());
+
+ setMaximumWidth(requiredWidth + frameAroundContents + scrollBarWidth);
+ m_container->layoutColumns();
+ if (m_active) {
+ m_container->assureVisibleActiveColumn();
+ }
+ }
+}
+
void DolphinColumnView::activate()
{
setFocus(Qt::OtherFocusReason);