Commit 687d430a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to hide menu in header view

parent d0917d84
Pipeline #27874 passed with stage
in 83 minutes and 23 seconds
cmake_minimum_required(VERSION 3.5)
set(PIM_VERSION "5.15.41")
set(PIM_VERSION "5.15.42")
project(mailcommon VERSION ${PIM_VERSION})
......
......@@ -116,7 +116,7 @@ void FolderTreeView::readConfig()
{
KConfigGroup myGroup(KernelIf->config(), "MainFolderView");
int iIconSize = myGroup.readEntry("IconSize", iconSize().width());
if (iIconSize < 16 || iIconSize > 32) {
if ((iIconSize < 16) || (iIconSize > 32)) {
iIconSize = 22;
}
setIconSize(QSize(iIconSize, iIconSize));
......
......@@ -50,6 +50,7 @@
#include <QLabel>
#include <QPointer>
#include <QVBoxLayout>
#include <QHeaderView>
namespace MailCommon {
class Q_DECL_HIDDEN FolderTreeWidget::FolderTreeWidgetPrivate
......@@ -103,6 +104,9 @@ FolderTreeWidget::FolderTreeWidget(
d->filterModel = new Akonadi::StatisticsProxyModel(this);
d->filterModel->setSourceModel(KernelIf->collectionModel());
}
if (options & HideHeaderViewMenu) {
d->folderTreeView->header()->setContextMenuPolicy(Qt::NoContextMenu);
}
d->readableproxy = new FolderTreeWidgetProxyModel(this, optReadableProxy);
d->readableproxy->setSourceModel((options & HideStatistics)
......
......@@ -59,7 +59,8 @@ public:
UseDistinctSelectionModel = 4,
ShowCollectionStatisticAnimation = 8,
DontKeyFilter = 16,
HideStatistics = 32
HideStatistics = 32,
HideHeaderViewMenu = 64
};
Q_DECLARE_FLAGS(TreeViewOptions, TreeViewOption)
......
Markdown is supported
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