From bd9f657603ea50c565ff250e4fc12ba5f269cce5 Mon Sep 17 00:00:00 2001 From: PlutonicOverkill Date: Wed, 10 May 2017 19:51:43 +1200 Subject: [PATCH] Show context menu when user clicks on empty space --- apps/opencs/view/prefs/page.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/opencs/view/prefs/page.cpp b/apps/opencs/view/prefs/page.cpp index cc9b94a04b..418f07ac85 100644 --- a/apps/opencs/view/prefs/page.cpp +++ b/apps/opencs/view/prefs/page.cpp @@ -16,6 +16,15 @@ CSVPrefs::Page::Page (CSMPrefs::Category& category, QWidget *parent) for (CSMPrefs::Category::Iterator iter = category.begin(); iter!=category.end(); ++iter) addSetting (*iter); + // HACK to get widget to consume all available page space so context menu clicks + // will trigger, but so that setting widgets still only take up the left hand side + QWidget* emptyColumn = new QWidget(); + mGrid->addWidget(emptyColumn, 0, 2, -1, 1); + QWidget* emptyRow = new QWidget(); + emptyRow->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Expanding); + mGrid->addWidget(emptyRow, mGrid->rowCount(), 0, 1, -1); + + setWidgetResizable(true); setWidget (widget); }