# HG changeset patch
# User Chris Cannam
# Date 1585224688 0
# Node ID acd2dcecc674f63c3f02b902e95f90a945d47bb4
# Parent f084856945411d89772f046cd2165f6ddb8d6844
Add context menus to AudioDials; tidy
diff -r f08485694541 -r acd2dcecc674 main/MainWindow.cpp
--- a/main/MainWindow.cpp Wed Mar 25 15:55:47 2020 +0000
+++ b/main/MainWindow.cpp Thu Mar 26 12:11:28 2020 +0000
@@ -84,6 +84,7 @@
#include "layer/ColourDatabase.h"
#include "widgets/ModelDataTableDialog.h"
#include "widgets/CSVExportDialog.h"
+#include "widgets/MenuTitle.h"
#include "rdf/PluginRDFIndexer.h"
#include "Surveyer.h"
@@ -5058,19 +5059,6 @@
m_rightButtonMenu->popup(position);
}
-#ifdef Q_OS_LINUX
-#define MENU_LEFT_INDENT \
- (m_viewManager->scalePixelSize(5) + \
- 2 * qApp->style()->pixelMetric(QStyle::PM_SmallIconSize))
-#else
-#ifdef Q_OS_WIN
-#define MENU_LEFT_INDENT \
- (9 + qApp->style()->pixelMetric(QStyle::PM_SmallIconSize))
-#else
-#define MENU_LEFT_INDENT 16
-#endif
-#endif
-
void
MainWindow::panePropertiesRightButtonMenuRequested(Pane *pane, QPoint position)
{
@@ -5083,15 +5071,7 @@
QMenu *m = new QMenu;
IconLoader il;
- QWidgetAction *wa = new QWidgetAction(m);
- QLabel *title = new QLabel;
- title->setText(tr("Pane"));
- title->setMargin(m_viewManager->scalePixelSize(3));
- title->setIndent(MENU_LEFT_INDENT);
- wa->setDefaultWidget(title);
- m->addAction(wa);
-
- m->addSeparator();
+ MenuTitle::addTitle(m, tr("Pane"));
// We repeat the setCurrentLayer call here just in case some
// unexpected UI interaction (scripting?) changes it while the
@@ -5120,18 +5100,7 @@
QMenu *m = new QMenu;
IconLoader il;
- QWidgetAction *wa = new QWidgetAction(m);
- QLabel *title = new QLabel;
- title->setText
- (tr("%2")
- .arg(XmlExportable::encodeEntities
- (layer->getLayerPresentationName())));
- title->setMargin(m_viewManager->scalePixelSize(3));
- title->setIndent(MENU_LEFT_INDENT);
- wa->setDefaultWidget(title);
- m->addAction(wa);
-
- m->addSeparator();
+ MenuTitle::addTitle(m, layer->getLayerPresentationName());
// We repeat the setCurrentLayer calls here just in case some
// unexpected UI interaction (scripting?) changes it while the
diff -r f08485694541 -r acd2dcecc674 repoint-lock.json
--- a/repoint-lock.json Wed Mar 25 15:55:47 2020 +0000
+++ b/repoint-lock.json Thu Mar 26 12:11:28 2020 +0000
@@ -7,7 +7,7 @@
"pin": "a4dce53b3353"
},
"svgui": {
- "pin": "01a41a37bd26"
+ "pin": "e5464dc2f6cf"
},
"svapp": {
"pin": "7b1d30af4b38"