##// END OF EJS Templates
Modificaiton of the sidepane :...
perrinel -
r125:3457b4e96a14
parent child
Show More
1 NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
@@ -26,6 +26,7
26 26 #include <DataSource/DataSourceWidget.h>
27 27 #include <SidePane/SqpSidePane.h>
28 28 #include <SqpApplication.h>
29 #include <TimeWidget/TimeWidget.h>
29 30
30 31 #include <QAction>
31 32 #include <QDate>
@@ -75,9 +76,61 MainWindow::MainWindow(QWidget *parent)
75 76 m_Ui->splitter->setCollapsible(LEFTINSPECTORSIDEPANESPLITTERINDEX, false);
76 77 m_Ui->splitter->setCollapsible(RIGHTINSPECTORSIDEPANESPLITTERINDEX, false);
77 78
79
80 auto leftSidePane = m_Ui->leftInspectorSidePane->sidePane();
81 auto openLeftInspectorAction = new QAction(
note

ok

82 QIcon{
83 ":/icones/previous.png",
84 },
85 tr("Show/hide the left inspector"), this);
86
87
88 QWidget *spacerLeftTop = new QWidget();
89 spacerLeftTop->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
90
91 QWidget *spacerLeftBottom = new QWidget();
92 spacerLeftBottom->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
93
94 leftSidePane->addWidget(spacerLeftTop);
95 leftSidePane->addAction(openLeftInspectorAction);
96 leftSidePane->addWidget(spacerLeftBottom);
97
98
99 auto rightSidePane = m_Ui->rightInspectorSidePane->sidePane();
100 auto openRightInspectorAction = new QAction(
101 QIcon{
102 ":/icones/next.png",
103 },
104 tr("Show/hide the right inspector"), this);
105
106 QWidget *spacerRightTop = new QWidget();
107 spacerRightTop->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
108
109 QWidget *spacerRightBottom = new QWidget();
note

ok

110 spacerRightBottom->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
111
112 rightSidePane->addWidget(spacerRightTop);
113 rightSidePane->addAction(openRightInspectorAction);
114 rightSidePane->addWidget(spacerRightBottom);
115
116 openLeftInspectorAction->setCheckable(true);
117 openRightInspectorAction->setCheckable(true);
118
119
78 120 // NOTE: These lambda could be factorized. Be careful of theirs parameters
79 121 // Lambda that defines what's happened when clicking on the leftSidePaneInspector open button
80 auto openLeftInspector = [this](bool checked) {
122 auto openLeftInspector = [this, openLeftInspectorAction](bool checked) {
123
124 if (checked) {
125 openLeftInspectorAction->setIcon(QIcon{
126 ":/icones/next.png",
127 });
128 }
129 else {
130 openLeftInspectorAction->setIcon(QIcon{
131 ":/icones/previous.png",
132 });
133 }
81 134
82 135 // Update of the last opened geometry
83 136 if (checked) {
@@ -107,7 +160,19 MainWindow::MainWindow(QWidget *parent)
107 160 };
108 161
109 162 // Lambda that defines what's happened when clicking on the SidePaneInspector open button
110 auto openRightInspector = [this](bool checked) {
163 auto openRightInspector = [this, openRightInspectorAction](bool checked) {
164
165 if (checked) {
166 openRightInspectorAction->setIcon(QIcon{
167 ":/icones/previous.png",
168 });
169 }
170 else {
171 openRightInspectorAction->setIcon(QIcon{
172 ":/icones/next.png",
173 });
174 }
175
111 176
112 177 // Update of the last opened geometry
113 178 if (checked) {
@@ -137,27 +202,14 MainWindow::MainWindow(QWidget *parent)
137 202 };
138 203
139 204
140 QToolBar *leftSidePane = m_Ui->leftInspectorSidePane->sidePane();
141 auto openLeftInspectorAction = leftSidePane->addAction(
142 QIcon{
143 ":/icones/openInspector.png",
144 },
145 tr("Show/hide the left inspector"), openLeftInspector);
146
147 openLeftInspectorAction->setCheckable(true);
148
149 auto rightSidePane = m_Ui->rightInspectorSidePane->sidePane();
150 auto openRightInspectorAction = rightSidePane->addAction(
151 QIcon{
152 ":/icones/openInspector.png",
153 },
154 tr("Show/hide the right inspector"), openRightInspector);
205 connect(openLeftInspectorAction, &QAction::triggered, openLeftInspector);
206 connect(openRightInspectorAction, &QAction::triggered, openRightInspector);
155 207
156 openRightInspectorAction->setCheckable(true);
157 208
158 209 this->menuBar()->addAction(tr("File"));
159 210 auto mainToolBar = this->addToolBar(QStringLiteral("MainToolBar"));
160 mainToolBar->addAction(QStringLiteral("A1"));
211
212 mainToolBar->addWidget(new TimeWidget());
note

ok

161 213
162 214 // Widgets / controllers connections
163 215 connect(&sqpApp->dataSourceController(), SIGNAL(dataSourceItemSet(DataSourceItem *)),
@@ -34,13 +34,6 SqpSidePane::SqpSidePane(QWidget *parent) : QWidget{parent}, ui{new Ui::SqpSideP
34 34 this->layout()->addWidget(m_SidePaneToolbar);
35 35
36 36 m_SidePaneToolbar->setStyleSheet(SQPSIDEPANESTYLESHEET);
37
38 this->setStyleSheet(
39 " QWidget {"
40 "background: red;"
41
42 "border: 1px;"
43 " }");
44 37 }
45 38
46 39 SqpSidePane::~SqpSidePane()
General Comments 0
You need to be logged in to leave comments. Login now