Skip to content
Snippets Groups Projects
Commit 447e9cd1 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

StackedFrames no need for EmptyFrame, use index -1

parent 270d15ca
No related branches found
No related tags found
1 merge request!2445frames and axis panels now stateless, and created at startup
......@@ -22,22 +22,11 @@
#include "GUI/View/Frame/Plot1DFrame.h"
#include "GUI/View/Frame/Plot2DFrame.h"
namespace {
class EmptyFrame : public QWidget {
private:
void showEvent(QShowEvent*) override {}
};
} // namespace
StackedDataFrames::StackedDataFrames()
{
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
setMinimumSize(500, 600);
addWidget(new ::EmptyFrame);
addWidget(new Plot1DFrame);
addWidget(new Plot2DFrame);
setCurrentIndex(0);
......@@ -50,9 +39,9 @@ StackedDataFrames::StackedDataFrames()
void StackedDataFrames::showCurrentFrame()
{
if (const DatafileItem* dfi = gDoc->datafiles()->currentItem())
setCurrentIndex(dfi->rank());
setCurrentIndex(dfi->rank() - 1);
else
setCurrentIndex(0);
setCurrentIndex(-1);
}
......@@ -61,7 +50,6 @@ StackedJobFrames::StackedJobFrames()
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
setMinimumSize(500, 600);
addWidget(new ::EmptyFrame);
addWidget(new Plot1DFrame);
addWidget(new Plot2DFrame);
addWidget(new Fit1DFrame);
......@@ -77,7 +65,7 @@ void StackedJobFrames::showCurrentFrame()
{
if (const JobItem* ji = gDoc->jobs()->currentItem()) {
const int offset = ji->isValidForFitting() ? 2 : 0;
setCurrentIndex(offset + ji->rank());
setCurrentIndex(offset + ji->rank() - 1);
} else
setCurrentIndex(0);
setCurrentIndex(-1);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment