diff --git a/GUI/Support/Util/Style.cpp b/GUI/Support/Util/Style.cpp
index cf65ea39525c3edd1c55802a3cc4a084233815e2..86630f9cd5542575606373517da276602319e5ee 100644
--- a/GUI/Support/Util/Style.cpp
+++ b/GUI/Support/Util/Style.cpp
@@ -16,9 +16,8 @@
 #include "Base/Util/Assert.h"
 #include "GUI/Support/Util/DesignerHelper.h"
 #include <QApplication>
-#include <QBoxLayout>
 #include <QDialog>
-#include <QTreeView>
+#include <QWidget>
 
 namespace {
 
diff --git a/GUI/View/PlotUtil/ColorMap.cpp b/GUI/View/PlotUtil/ColorMap.cpp
index 3aacef46a725d13e291b1bb585de0388b01a5efa..78b4739f4f3bab479f9a3106e08934e6daa3f039 100644
--- a/GUI/View/PlotUtil/ColorMap.cpp
+++ b/GUI/View/PlotUtil/ColorMap.cpp
@@ -54,7 +54,7 @@ ColorMap::ColorMap(QWidget* parent)
     m_colorScale = new QCPColorScale(m_qcp);
     m_colorScale->axis()->axisRect()->setMargins(QMargins(0, 0, 0, 0));
     m_colorScale->axis()->axisRect()->setAutoMargins(QCP::msNone);
-    m_colorScale->setBarWidth(GUI::Constants::plot_colorbar_size());
+    m_colorScale->setBarWidth(GUI::Style::SizeOfLetterM().width());
     m_colorScale->axis()->setTickLabelFont(
         QFont(QFont().family(), GUI::Constants::plot_tick_label_size()));
     m_qcpMap->setColorScale(m_colorScale);
diff --git a/GUI/View/PlotUtil/PlotConstants.h b/GUI/View/PlotUtil/PlotConstants.h
index 8408c8fa0c166cdb9fafb7244678017abe8dfe79..59ef346102305e7982d437d4b9e15e65e4832bc3 100644
--- a/GUI/View/PlotUtil/PlotConstants.h
+++ b/GUI/View/PlotUtil/PlotConstants.h
@@ -30,11 +30,6 @@ inline int plot_axes_label_size()
     return GUI::Style::SystemPointSize();
 }
 
-inline int plot_colorbar_size()
-{
-    return GUI::Style::SizeOfLetterM().width();
-}
-
 } // namespace GUI::Constants
 
 #endif // BORNAGAIN_GUI_VIEW_PLOTUTIL_PLOTCONSTANTS_H