From 749362987b9617ddfc461b647ac436be5a6eaca4 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 15 Feb 2012 16:10:01 +0100 Subject: 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 --- src/panels/folders/treeviewcontextmenu.cpp | 44 ++++++++++++++++-------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'src/panels/folders/treeviewcontextmenu.cpp') 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 customActions = m_parent->customContextMenuActions(); + if (!customActions.isEmpty()) { + popup->addSeparator(); + foreach (QAction* action, customActions) { + popup->addAction(action); + } } QWeakPointer popupPtr = popup; -- cgit v1.3