changeset 2477:dbc08fae9077

More context menu layout tweaks
author Chris Cannam
date Wed, 25 Mar 2020 15:46:56 +0000
parents 6a46b1d4f0cd
children f08485694541
files main/MainWindow.cpp
diffstat 1 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/main/MainWindow.cpp	Wed Mar 25 15:07:10 2020 +0000
+++ b/main/MainWindow.cpp	Wed Mar 25 15:46:56 2020 +0000
@@ -5058,6 +5058,19 @@
     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 17
+#endif
+#endif
+
 void
 MainWindow::panePropertiesRightButtonMenuRequested(Pane *pane, QPoint position)
 {
@@ -5074,8 +5087,7 @@
     QLabel *title = new QLabel;
     title->setText(tr("<b>Pane</b>"));
     title->setMargin(m_viewManager->scalePixelSize(3));
-    title->setIndent(m_viewManager->scalePixelSize(12) +
-                     qApp->style()->pixelMetric(QStyle::PM_SmallIconSize));
+    title->setIndent(MENU_LEFT_INDENT);
     wa->setDefaultWidget(title);
     m->addAction(wa);
 
@@ -5115,8 +5127,7 @@
          .arg(XmlExportable::encodeEntities
               (layer->getLayerPresentationName())));
     title->setMargin(m_viewManager->scalePixelSize(3));
-    title->setIndent(m_viewManager->scalePixelSize(12) +
-                     qApp->style()->pixelMetric(QStyle::PM_SmallIconSize));
+    title->setIndent(MENU_LEFT_INDENT);
     wa->setDefaultWidget(title);
     m->addAction(wa);