@@ -201,7 +201,7 @@ void GraphBased::renderGui() {
201201 // RESET button
202202 {
203203 if (!disable_run_ || is_running_) ImGui::BeginDisabled ();
204- bool clicked = ImGui::Button (" RESET" , ImVec2 (100 . f , 40 . f ));
204+ bool clicked = ImGui::Button (" RESET" , ImVec2 (103 . 0f , 0 . 0f ));
205205 if (!disable_run_ || is_running_) ImGui::EndDisabled ();
206206 if (clicked && !is_running_) {
207207 is_reset_ = true ;
@@ -216,7 +216,7 @@ void GraphBased::renderGui() {
216216 // always disabled (not implemented yet)
217217 {
218218 if (true ) ImGui::BeginDisabled ();
219- bool clicked = ImGui::Button (" PAUSE" , ImVec2 (100 . f , 40 . f ));
219+ bool clicked = ImGui::Button (" PAUSE" , ImVec2 (103 . 0f , 0 . 0f ));
220220 if (true ) ImGui::EndDisabled ();
221221 }
222222
@@ -225,7 +225,7 @@ void GraphBased::renderGui() {
225225 // RUN button
226226 {
227227 if (disable_run_) ImGui::BeginDisabled ();
228- bool clicked = ImGui::Button (" RUN" , ImVec2 (100 . f , 40 . f ));
228+ bool clicked = ImGui::Button (" RUN" , ImVec2 (103 . 0f , 0 . 0f ));
229229 if (disable_run_) ImGui::EndDisabled ();
230230 if (clicked && !is_solved_) {
231231 is_running_ = true ;
@@ -235,48 +235,41 @@ void GraphBased::renderGui() {
235235 }
236236 }
237237
238- ImGui::Spacing ();
239- ImGui::Separator ();
240- ImGui::Spacing ();
241-
242- if (disable_gui_parameters_) ImGui::BeginDisabled ();
238+ if (ImGui::CollapsingHeader (" Configuration" ,
239+ ImGuiTreeNodeFlags_DefaultOpen)) {
240+ if (disable_gui_parameters_) ImGui::BeginDisabled ();
241+ // grid size slider
242+ if (ImGui::SliderInt (" Grid Size" , &slider_grid_size_, 10 , 100 )) {
243+ gridSize_ = slider_grid_size_;
244+ initNodes (true , false );
245+ }
243246
244- // grid size slider
245- if (ImGui::SliderInt (" Grid Size" , &slider_grid_size_, 10 , 100 )) {
246- gridSize_ = slider_grid_size_;
247- initNodes (true , false );
248- }
247+ // radio buttons for choosing 4 or 8 connected grids
248+ {
249+ bool a, b;
250+ a = ImGui::RadioButton (" 4-connected" , &grid_connectivity_, 0 );
251+ ImGui::SameLine ();
252+ b = ImGui::RadioButton (" 8-connected" , &grid_connectivity_, 1 );
253+ if (a || b) {
254+ initNodes (false , true );
255+ }
256+ }
249257
250- ImGui::Spacing ();
258+ // virtual function renderParametersGui()
259+ // need to be implemented by derived class
260+ renderParametersGui ();
251261
252- // radio buttons for choosing 4 or 8 connected grids
253- {
254- bool a, b;
255- a = ImGui::RadioButton (" 4-connected" , &grid_connectivity_, 0 );
256- ImGui::SameLine ();
257- b = ImGui::RadioButton (" 8-connected" , &grid_connectivity_, 1 );
258- if (a || b) {
259- initNodes (false , true );
262+ {
263+ if (ImGui::Button (" CLEAR OBSTACLES" , ImVec2 (156 .5f , 0 .f ))) {
264+ clearObstacles ();
265+ }
266+ ImGui::SameLine ();
267+ if (ImGui::Button (" RESET PARAMETERS" , ImVec2 (156 .5f , 0 .f ))) {
268+ }
260269 }
261- }
262270
263- ImGui::Spacing ();
264- // virtual function renderParametersGui()
265- // need to be implemented by derived class
266- renderParametersGui ();
267- ImGui::Spacing ();
268- ImGui::Separator ();
269- ImGui::Spacing ();
270- {
271- if (ImGui::Button (" CLEAR OBSTACLES" , ImVec2 (154 .f , 40 .f ))) {
272- clearObstacles ();
273- }
274- ImGui::SameLine ();
275- if (ImGui::Button (" RESET PARAMETERS" , ImVec2 (154 .f , 40 .f ))) {
276- }
271+ if (disable_gui_parameters_) ImGui::EndDisabled ();
277272 }
278-
279- if (disable_gui_parameters_) ImGui::EndDisabled ();
280273}
281274
282275void GraphBased::render () {
0 commit comments