src/addObjectDialog.cc

changeset 946
9cbd658b63f9
parent 945
c310073e4f22
child 950
5df69eb50182
equal deleted inserted replaced
945:c310073e4f22 946:9cbd658b63f9
130 if (defaults->isColored()) 130 if (defaults->isColored())
131 { 131 {
132 if (obj != null) 132 if (obj != null)
133 m_color = obj->color(); 133 m_color = obj->color();
134 else 134 else
135 m_color = (type == OBJ_CondLine or type == OBJ_Line) ? EdgeColor() : MainColor(); 135 m_color = (type == OBJ_CondLine or type == OBJ_Line) ? EdgeColor : MainColor;
136 136
137 pb_color = new QPushButton; 137 pb_color = new QPushButton;
138 setButtonBackground (pb_color, m_color); 138 setButtonBackground (pb_color, m_color);
139 connect (pb_color, SIGNAL (clicked()), this, SLOT (slot_colorButtonClicked())); 139 connect (pb_color, SIGNAL (clicked()), this, SLOT (slot_colorButtonClicked()));
140 } 140 }
237 void AddObjectDialog::setButtonBackground (QPushButton* button, LDColor color) 237 void AddObjectDialog::setButtonBackground (QPushButton* button, LDColor color)
238 { 238 {
239 button->setIcon (GetIcon ("palette")); 239 button->setIcon (GetIcon ("palette"));
240 button->setAutoFillBackground (true); 240 button->setAutoFillBackground (true);
241 241
242 if (color != null) 242 if (color.isValid())
243 button->setStyleSheet (format ("background-color: %1", color.hexcode())); 243 button->setStyleSheet (format ("background-color: %1", color.hexcode()));
244 } 244 }
245 245
246 // ============================================================================= 246 // =============================================================================
247 // ============================================================================= 247 // =============================================================================

mercurial