┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-02-15 16:10:01 +0100
committerPeter Penz <[email protected]>2012-02-15 16:20:47 +0100
commit749362987b9617ddfc461b647ac436be5a6eaca4 (patch)
treefa4f943872d44450d946e2ad4ea05ffd264e9b6b /src/panels
parentcf72e481110d76081d1757dc89da5d8f68627b19 (diff)
Folders Panel: Use the whole width as selection region
As no rubberband-selection is enabled for the Folders Panel it does not make sense to keep the selection region as small as possible. BUG: 294111 FIXED-IN: 4.8.1
Diffstat (limited to 'src/panels')
-rw-r--r--src/panels/folders/folderspanel.cpp1
-rw-r--r--src/panels/folders/treeviewcontextmenu.cpp44
2 files changed, 25 insertions, 20 deletions
diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp
index cc7c75f96..58dd7904d 100644
--- a/src/panels/folders/folderspanel.cpp
+++ b/src/panels/folders/folderspanel.cpp
@@ -146,6 +146,7 @@ void FoldersPanel::showEvent(QShowEvent* event)
KItemListStyleOption styleOption = view->styleOption();
styleOption.padding = 2;
styleOption.iconSize = KIconLoader::SizeSmall;
+ styleOption.extendedSelectionRegion = true;
view->setStyleOption(styleOption);
const qreal itemHeight = qMax(int(KIconLoader::SizeSmall), styleOption.fontMetrics.height());
diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp
index 8d0b24cf3..b91fccbc0 100644
--- a/src/panels/folders/treeviewcontextmenu.cpp
+++ b/src/panels/folders/treeviewcontextmenu.cpp
@@ -105,34 +105,38 @@ void TreeViewContextMenu::open()
}
popup->addSeparator();
+ }
+
+ // insert 'Show Hidden Files'
+ QAction* showHiddenFilesAction = new QAction(i18nc("@action:inmenu", "Show Hidden Files"), this);
+ showHiddenFilesAction->setCheckable(true);
+ showHiddenFilesAction->setChecked(m_parent->showHiddenFiles());
+ popup->addAction(showHiddenFilesAction);
+ connect(showHiddenFilesAction, SIGNAL(toggled(bool)), this, SLOT(setShowHiddenFiles(bool)));
+ // insert 'Automatic Scrolling'
+ QAction* autoScrollingAction = new QAction(i18nc("@action:inmenu", "Automatic Scrolling"), this);
+ autoScrollingAction->setCheckable(true);
+ autoScrollingAction->setChecked(m_parent->autoScrolling());
+ // TODO: Temporary disabled. Horizontal autoscrolling will be implemented later either
+ // in KItemViews or manually as part of the FoldersPanel
+ //popup->addAction(autoScrollingAction);
+ connect(autoScrollingAction, SIGNAL(toggled(bool)), this, SLOT(setAutoScrolling(bool)));
+
+ if (!m_fileItem.isNull()) {
// insert 'Properties' entry
QAction* propertiesAction = new QAction(i18nc("@action:inmenu", "Properties"), this);
propertiesAction->setIcon(KIcon("document-properties"));
connect(propertiesAction, SIGNAL(triggered()), this, SLOT(showProperties()));
popup->addAction(propertiesAction);
-
- popup->addSeparator();
}
- if (m_fileItem.isNull()) {
- QAction* showHiddenFilesAction = new QAction(i18nc("@action:inmenu", "Show Hidden Files"), this);
- showHiddenFilesAction->setCheckable(true);
- 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());
- // TODO: Temporary disabled. Horizontal autoscrolling will be implemented later either
- // in KItemViews or manually as part of the FoldersPanel
- //popup->addAction(autoScrollingAction);
- connect(autoScrollingAction, SIGNAL(toggled(bool)), this, SLOT(setAutoScrolling(bool)));
- }
-
- foreach (QAction* action, m_parent->customContextMenuActions()) {
- popup->addAction(action);
+ QList<QAction*> customActions = m_parent->customContextMenuActions();
+ if (!customActions.isEmpty()) {
+ popup->addSeparator();
+ foreach (QAction* action, customActions) {
+ popup->addAction(action);
+ }
}
QWeakPointer<KMenu> popupPtr = popup;