[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [labplot] src: 1. Correctly set the status of plot toolbar actions
From:       Alexander Semke <null () kde ! org>
Date:       2017-10-31 15:15:23
Message-ID: E1e9YGB-0001C0-Fd () code ! kde ! org
[Download RAW message or body]

Git commit 320260cc830c007d5c3cead713b169bbea537139 by Alexander Semke.
Committed on 31/10/2017 at 15:14.
Pushed by asemke into branch 'master'.

1. Correctly set the status of plot toolbar actions
2. enable/disable worksheet, plot and spreadsheet toolbars instead of showing/hiding \
them in order to avoid flickering

M  +2    -0    src/commonfrontend/worksheet/WorksheetView.cpp
M  +7    -4    src/kdefrontend/MainWin.cpp

https://commits.kde.org/labplot/320260cc830c007d5c3cead713b169bbea537139

diff --git a/src/commonfrontend/worksheet/WorksheetView.cpp \
b/src/commonfrontend/worksheet/WorksheetView.cpp index bad7b667..a91eccd5 100644
--- a/src/commonfrontend/worksheet/WorksheetView.cpp
+++ b/src/commonfrontend/worksheet/WorksheetView.cpp
@@ -635,6 +635,8 @@ void WorksheetView::fillCartesianPlotToolBar(QToolBar* toolBar) {
 	toolBar->addAction(shiftRightXAction);
 	toolBar->addAction(shiftUpYAction);
 	toolBar->addAction(shiftDownYAction);
+
+	handleCartesianPlotActions();
 }
 
 void WorksheetView::setScene(QGraphicsScene* scene) {
diff --git a/src/kdefrontend/MainWin.cpp b/src/kdefrontend/MainWin.cpp
index fadca7da..2d835ecb 100644
--- a/src/kdefrontend/MainWin.cpp
+++ b/src/kdefrontend/MainWin.cpp
@@ -676,6 +676,7 @@ void MainWin::updateGUI() {
 		toolbar->clear();
 		view->fillToolBar(toolbar);
 		toolbar->setVisible(true);
+		toolbar->setEnabled(true);
 
 		//populate the toolbar for cartesian plots
 		toolbar=qobject_cast<QToolBar*>(factory->container("cartesian_plot_toolbar", \
this)); @@ -685,6 +686,7 @@ void MainWin::updateGUI() {
 		toolbar->clear();
 		view->fillCartesianPlotToolBar(toolbar);
 		toolbar->setVisible(true);
+		toolbar->setEnabled(true);
 
 		//hide the spreadsheet toolbar
 		factory->container("spreadsheet_toolbar", this)->setVisible(false);
@@ -692,8 +694,8 @@ void MainWin::updateGUI() {
 		factory->container("worksheet", this)->setEnabled(false);
 		factory->container("analysis", this)->setEnabled(false);
 //		factory->container("drawing", this)->setEnabled(false);
-		factory->container("worksheet_toolbar", this)->setVisible(false);
-		factory->container("cartesian_plot_toolbar", this)->setVisible(false);
+		factory->container("worksheet_toolbar", this)->setEnabled(false);
+		factory->container("cartesian_plot_toolbar", this)->setEnabled(false);
 	}
 
 	//Handle the Spreadsheet-object
@@ -713,12 +715,13 @@ void MainWin::updateGUI() {
 		if (group.groupList().indexOf("Toolbar spreadsheet_toolbar") == -1)
 			toolbar->setToolButtonStyle(Qt::ToolButtonFollowStyle);
 
-		toolbar->setVisible(true);
 		toolbar->clear();
 		view->fillToolBar(toolbar);
+		toolbar->setVisible(true);
+		toolbar->setEnabled(true);
 	} else {
 		factory->container("spreadsheet", this)->setEnabled(false);
-		factory->container("spreadsheet_toolbar", this)->setVisible(false);
+		factory->container("spreadsheet_toolbar", this)->setEnabled(false);
 	}
 
 	//Handle the Matrix-object


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic