Commit 840edc7f authored by Aurélien Gâteau's avatar Aurélien Gâteau
Browse files

Follow KDE settings for double-click vs single-click on start page as well

BUG: 274912

@Christopher: After playing around with various settings, I realized the UI
of the start page is too similar to the thumbnail view to use a different
behavior.
parent ea87dc16
......@@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
// KDE
#include <kfileplacesmodel.h>
#include <kglobalsettings.h>
#include <kicon.h>
#include <kmimetype.h>
......@@ -168,20 +169,29 @@ StartPage::StartPage(QWidget* parent, GvCore* gvCore)
SLOT(slotTagViewClicked(const QModelIndex&)));
// Recent folder view
connect(d->mRecentFoldersView, SIGNAL(clicked(const QModelIndex&)),
SLOT(slotListViewClicked(const QModelIndex&)) );
connect(d->mRecentFoldersView, SIGNAL(indexActivated(const QModelIndex&)),
SLOT(slotListViewActivated(const QModelIndex&)) );
connect(d->mRecentFoldersView, SIGNAL(customContextMenuRequested(const QPoint&)),
SLOT(showRecentFoldersViewContextMenu(const QPoint&)));
// Url bag view
d->mRecentUrlsView->setItemDelegate(new HistoryViewDelegate(d->mRecentUrlsView));
connect(d->mRecentUrlsView, SIGNAL(clicked(const QModelIndex&)),
SLOT(slotListViewClicked(const QModelIndex&)) );
connect(d->mRecentUrlsView, SIGNAL(customContextMenuRequested(const QPoint&)),
SLOT(showRecentFoldersViewContextMenu(const QPoint&)));
if (KGlobalSettings::singleClick()) {
if (KGlobalSettings::changeCursorOverIcon()) {
d->mRecentUrlsView->setCursor(Qt::PointingHandCursor);
}
connect(d->mRecentUrlsView, SIGNAL(clicked(const QModelIndex&)),
SLOT(slotListViewActivated(const QModelIndex&)) );
} else {
connect(d->mRecentUrlsView, SIGNAL(doubleClicked(const QModelIndex&)),
SLOT(slotListViewActivated(const QModelIndex&)) );
}
d->updateHistoryTab();
connect(GwenviewConfig::self(), SIGNAL(configChanged()),
SLOT(slotConfigChanged()));
......@@ -224,7 +234,7 @@ void StartPage::applyPalette(const QPalette& newPalette) {
}
void StartPage::slotListViewClicked(const QModelIndex& index) {
void StartPage::slotListViewActivated(const QModelIndex& index) {
if (!index.isValid()) {
return;
}
......
......@@ -54,7 +54,7 @@ protected:
virtual void showEvent(QShowEvent*);
private Q_SLOTS:
void slotListViewClicked(const QModelIndex& index);
void slotListViewActivated(const QModelIndex& index);
void showRecentFoldersViewContextMenu(const QPoint& pos);
void slotTagViewClicked(const QModelIndex& index);
void slotConfigChanged();
......
......@@ -53,8 +53,8 @@
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="Gwenview::ThumbnailView" name="mRecentFoldersView">
<property name="cursor" stdset="0">
<cursorShape>PointingHandCursor</cursorShape>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
......@@ -67,15 +67,15 @@
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QListView" name="mRecentUrlsView">
<property name="cursor" stdset="0">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="iconSize">
<size>
<width>32</width>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment