From 8559b78d7d4061bb70e6fe6ac2b787692282e69d Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 27 Oct 2010 20:11:46 +0000 Subject: - Allow to disable the automatic horizontal scrolling of the Folders Panel - Remember the 'Show Hidden Files' setting - Improve the autoscroll behavior - Fix issue that expanding folders might not increase the horizontal width - Fix issue that the selected item might get hidden by the horizontal scrollbar BUG: 191787 FIXED-IN: 4.6.0 CCMAIL: datpeter@yahoo.com> svn path=/trunk/KDE/kdebase/apps/; revision=1190479 --- src/panels/folders/treeviewcontextmenu.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'src/panels/folders/treeviewcontextmenu.cpp') diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp index 32e92e05c..aa111c6ba 100644 --- a/src/panels/folders/treeviewcontextmenu.cpp +++ b/src/panels/folders/treeviewcontextmenu.cpp @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) and * - * Cvetoslav Ludmiloff * + * Copyright (C) 2006-2010 by Peter Penz * + * Copyright (C) 2006 by Cvetoslav Ludmiloff * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -20,8 +20,6 @@ #include "treeviewcontextmenu.h" -#include "dolphin_folderspanelsettings.h" - #include #include #include @@ -87,7 +85,7 @@ void TreeViewContextMenu::open() KConfigGroup configGroup(globalConfig, "KDE"); bool showDeleteCommand = configGroup.readEntry("ShowDeleteCommand", false); - const KUrl& url = m_fileInfo.url(); + const KUrl url = m_fileInfo.url(); if (url.isLocalFile()) { QAction* moveToTrashAction = new QAction(KIcon("user-trash"), i18nc("@action:inmenu", "Move to Trash"), this); @@ -118,11 +116,17 @@ void TreeViewContextMenu::open() QAction* showHiddenFilesAction = new QAction(i18nc("@action:inmenu", "Show Hidden Files"), this); showHiddenFilesAction->setCheckable(true); - showHiddenFilesAction->setChecked(FoldersPanelSettings::showHiddenFiles()); + showHiddenFilesAction->setChecked(m_parent->showHiddenFiles()); popup->addAction(showHiddenFilesAction); - connect(showHiddenFilesAction, SIGNAL(toggled(bool)), this, SLOT(setShowHiddenFiles(bool))); + QAction* autoScrollingAction = new QAction(i18nc("@action:inmenu", "Automatic Scrolling"), this); + autoScrollingAction->setCheckable(true); + autoScrollingAction->setChecked(m_parent->autoScrolling()); + popup->addAction(autoScrollingAction); + connect(autoScrollingAction, SIGNAL(toggled(bool)), this, SLOT(setAutoScrolling(bool))); + + popup->exec(QCursor::pos()); popup->deleteLater(); } @@ -193,4 +197,9 @@ void TreeViewContextMenu::setShowHiddenFiles(bool show) m_parent->setShowHiddenFiles(show); } +void TreeViewContextMenu::setAutoScrolling(bool enable) +{ + m_parent->setAutoScrolling(enable); +} + #include "treeviewcontextmenu.moc" -- cgit v1.3