]> SALOME platform Git repositories - modules/superv.git/blobdiff - src/SUPERVGUI/SUPERVGUI_View.cxx
Salome HOME
SALOME PAL V1_4_1
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_View.cxx
index 86fc5a6332e768b4903acf2ece6c28b96a590780..b85ddbc15e6af79d5076a63073e97547bd1c5f98 100644 (file)
@@ -12,7 +12,7 @@ using namespace std;
 #include "SUPERVGUI_View.h"
 #include "SUPERVGUI_Main.h"
 #include "QAD_Config.h"
-
+#include <qcolordialog.h>
 
 
 #if QT_VERSION >= 0x030005
@@ -60,6 +60,9 @@ SUPERVGUI_View::SUPERVGUI_View(SUPERVGUI_Main* theMain):
   myPopup->insertItem(tr("MSG_COPY_DATAFLOW"), main, SLOT(copy()));
   myPopup->insertItem(tr("MSG_FILTER_NOTIFY"), main, SLOT(filterNotification()));
 
+  myPopup->insertSeparator();
+  myPopup->insertItem(tr("MSG_CHANGE_BACKGROUND"), this, SLOT(changeBackground()));
+
   QString aRed   = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorRed");
   QString aGreen = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorGreen");
   QString aBlue  = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorBlue");
@@ -174,3 +177,10 @@ int SUPERVGUI_View::getLastX() {
 int SUPERVGUI_View::getLastY() {
   return myLastY;
 }
+void SUPERVGUI_View::changeBackground()
+{
+  QColor selColor = QColorDialog::getColor(viewport()->paletteBackgroundColor(), this );
+  if ( selColor.isValid() ) {
+    setPaletteBackgroundColor( selColor );
+  }
+}