src/configDialog.cpp

changeset 211
8d35e631bef3
parent 203
ccde5e88f0b6
child 214
28e0b37156be
equal deleted inserted replaced
210:58a3cbb49374 211:8d35e631bef3
118 cb_colorize->setChecked (lv_colorize); 118 cb_colorize->setChecked (lv_colorize);
119 cb_colorize->setWhatsThis ("Makes colored objects (non-16 and 24) appear " 119 cb_colorize->setWhatsThis ("Makes colored objects (non-16 and 24) appear "
120 "colored in the object list. A red polygon will have its description " 120 "colored in the object list. A red polygon will have its description "
121 "written in red text."); 121 "written in red text.");
122 122
123 cb_colorBFC = new QCheckBox ("Red/green BFC view"); 123 cb_colorBFC = new QCheckBox ("Red/green BFC view (incomplete)");
124 cb_colorBFC->setChecked (gl_colorbfc); 124 cb_colorBFC->setChecked (gl_colorbfc);
125 cb_colorBFC->setWhatsThis ("Polygons' front sides become green and back " 125 cb_colorBFC->setWhatsThis ("Polygons' front sides become green and back sides red.");
126 "sides red. Not implemented yet."); 126
127
128 cb_blackEdges = new QCheckBox ("Black edges"); 127 cb_blackEdges = new QCheckBox ("Black edges");
129 cb_blackEdges->setWhatsThis ("Makes all edgelines appear black. If this is " 128 cb_blackEdges->setWhatsThis ("Makes all edgelines appear black. If this is "
130 "not set, edge lines take their color as defined in LDConfig.ldr"); 129 "not set, edge lines take their color as defined in LDConfig.ldr");
131 cb_blackEdges->setChecked (gl_blackedges); 130 cb_blackEdges->setChecked (gl_blackedges);
132 131
265 // ============================================================================= 264 // =============================================================================
266 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 265 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
267 // ============================================================================= 266 // =============================================================================
268 void ConfigDialog::initGridTab () { 267 void ConfigDialog::initGridTab () {
269 QWidget* tab = new QWidget; 268 QWidget* tab = new QWidget;
270 QGridLayout* layout = new QGridLayout; 269 QGridLayout* gridlayout = new QGridLayout;
271 QVBoxLayout* l2 = new QVBoxLayout; 270 QVBoxLayout* mainlayout = new QVBoxLayout;
272 271
273 QLabel* xlabel = new QLabel ("X"), 272 QLabel* xlabel = new QLabel ("X"),
274 *ylabel = new QLabel ("Y"), 273 *ylabel = new QLabel ("Y"),
275 *zlabel = new QLabel ("Z"), 274 *zlabel = new QLabel ("Z"),
276 *anglabel = new QLabel ("Angle"); 275 *anglabel = new QLabel ("Angle");
277 276
278 short i = 1; 277 short i = 1;
279 for (QLabel* label : std::initializer_list<QLabel*> ({xlabel, ylabel, zlabel, anglabel})) { 278 for (QLabel* label : std::initializer_list<QLabel*> ({xlabel, ylabel, zlabel, anglabel})) {
280 label->setAlignment (Qt::AlignCenter); 279 label->setAlignment (Qt::AlignCenter);
281 layout->addWidget (label, 0, i++); 280 gridlayout->addWidget (label, 0, i++);
282 } 281 }
283 282
284 for (int i = 0; i < g_NumGrids; ++i) { 283 for (int i = 0; i < g_NumGrids; ++i) {
285 // Icon 284 // Icon
286 lb_gridIcons[i] = new QLabel; 285 lb_gridIcons[i] = new QLabel;
290 lb_gridLabels[i] = new QLabel (fmt ("%s:", g_GridInfo[i].name)); 289 lb_gridLabels[i] = new QLabel (fmt ("%s:", g_GridInfo[i].name));
291 290
292 QHBoxLayout* labellayout = new QHBoxLayout; 291 QHBoxLayout* labellayout = new QHBoxLayout;
293 labellayout->addWidget (lb_gridIcons[i]); 292 labellayout->addWidget (lb_gridIcons[i]);
294 labellayout->addWidget (lb_gridLabels[i]); 293 labellayout->addWidget (lb_gridLabels[i]);
295 layout->addLayout (labellayout, i + 1, 0); 294 gridlayout->addLayout (labellayout, i + 1, 0);
296 295
297 // Add the widgets 296 // Add the widgets
298 for (int j = 0; j < 4; ++j) { 297 for (int j = 0; j < 4; ++j) {
299 dsb_gridData[i][j] = new QDoubleSpinBox; 298 dsb_gridData[i][j] = new QDoubleSpinBox;
300 dsb_gridData[i][j]->setValue (g_GridInfo[i].confs[j]->value); 299 dsb_gridData[i][j]->setValue (g_GridInfo[i].confs[j]->value);
301 layout->addWidget (dsb_gridData[i][j], i + 1, j + 1); 300 gridlayout->addWidget (dsb_gridData[i][j], i + 1, j + 1);
302 } 301 }
303 } 302 }
304 303
305 l2->addLayout (layout); 304 mainlayout->addLayout (gridlayout);
306 l2->addStretch (1); 305 mainlayout->addStretch (1);
307 306
308 tab->setLayout (l2); 307 tab->setLayout (mainlayout);
309 tabs->addTab (tab, "Grids"); 308 tabs->addTab (tab, "Grids");
310 } 309 }
311 310
312 // ============================================================================= 311 // =============================================================================
313 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 312 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
358 ++row; 357 ++row;
359 } 358 }
360 359
361 pathsBox->setLayout (pathsLayout); 360 pathsBox->setLayout (pathsLayout);
362 layout->addWidget (pathsBox); 361 layout->addWidget (pathsBox);
363 layout->addSpacing (10); 362 layout->addStretch (1);
364 363
365 tab->setLayout (layout); 364 tab->setLayout (layout);
366 tabs->addTab (tab, "Ext. Programs"); 365 tabs->addTab (tab, "Ext. Programs");
367 } 366 }
368 367

mercurial