src/addObjectDialog.cpp

changeset 551
0efe5dbcef07
parent 542
46a33bdc0b36
child 553
2418d5955421
equal deleted inserted replaced
550:d97594e3fc54 551:0efe5dbcef07
77 case LDObject::Triangle: 77 case LDObject::Triangle:
78 coordCount = 9; 78 coordCount = 9;
79 break; 79 break;
80 80
81 case LDObject::Quad: 81 case LDObject::Quad:
82 case LDObject::CndLine: 82 case LDObject::CondLine:
83 coordCount = 12; 83 coordCount = 12;
84 break; 84 break;
85 85
86 case LDObject::Vertex: 86 case LDObject::Vertex:
87 coordCount = 3; 87 coordCount = 3;
159 // Show a color edit dialog for the types that actually use the color 159 // Show a color edit dialog for the types that actually use the color
160 if (defaults->isColored()) 160 if (defaults->isColored())
161 { if (obj != null) 161 { if (obj != null)
162 colnum = obj->getColor(); 162 colnum = obj->getColor();
163 else 163 else
164 colnum = (type == LDObject::CndLine || type == LDObject::Line) ? edgecolor : maincolor; 164 colnum = (type == LDObject::CondLine || type == LDObject::Line) ? edgecolor : maincolor;
165 165
166 pb_color = new QPushButton; 166 pb_color = new QPushButton;
167 setButtonBackground (pb_color, colnum); 167 setButtonBackground (pb_color, colnum);
168 connect (pb_color, SIGNAL (clicked()), this, SLOT (slot_colorButtonClicked())); 168 connect (pb_color, SIGNAL (clicked()), this, SLOT (slot_colorButtonClicked()));
169 } 169 }
178 QGridLayout* const layout = new QGridLayout; 178 QGridLayout* const layout = new QGridLayout;
179 layout->addWidget (lb_typeIcon, 0, 0); 179 layout->addWidget (lb_typeIcon, 0, 0);
180 180
181 switch (type) 181 switch (type)
182 { case LDObject::Line: 182 { case LDObject::Line:
183 case LDObject::CndLine: 183 case LDObject::CondLine:
184 case LDObject::Triangle: 184 case LDObject::Triangle:
185 case LDObject::Quad: 185 case LDObject::Quad:
186 186
187 // Apply coordinates 187 // Apply coordinates
188 if (obj) 188 if (obj)
345 break; 345 break;
346 346
347 case LDObject::Line: 347 case LDObject::Line:
348 case LDObject::Triangle: 348 case LDObject::Triangle:
349 case LDObject::Quad: 349 case LDObject::Quad:
350 case LDObject::CndLine: 350 case LDObject::CondLine:
351 351
352 if (!obj) 352 if (!obj)
353 obj = LDObject::getDefault (type); 353 obj = LDObject::getDefault (type);
354 354
355 for (int i = 0; i < obj->vertices(); ++i) 355 for (int i = 0; i < obj->vertices(); ++i)

mercurial