src/mainwindow.cpp

changeset 1114
ffd49a28f49e
parent 1113
5f3139c802bf
child 1117
efcb47c64a72
equal deleted inserted replaced
1113:5f3139c802bf 1114:ffd49a28f49e
448 // --------------------------------------------------------------------------------------------------------------------- 448 // ---------------------------------------------------------------------------------------------------------------------
449 // 449 //
450 void MainWindow::quickColorClicked() 450 void MainWindow::quickColorClicked()
451 { 451 {
452 QToolButton* button = static_cast<QToolButton*> (sender()); 452 QToolButton* button = static_cast<QToolButton*> (sender());
453 LDColor color = LDColor::nullColor(); 453 LDColor color = LDColor::nullColor;
454 454
455 for (const ColorToolbarItem& entry : m_quickColors) 455 for (const ColorToolbarItem& entry : m_quickColors)
456 { 456 {
457 if (entry.toolButton() == button) 457 if (entry.toolButton() == button)
458 { 458 {
567 { 567 {
568 if (not obj->isColored()) 568 if (not obj->isColored())
569 continue; // This one doesn't use color so it doesn't have a say 569 continue; // This one doesn't use color so it doesn't have a say
570 570
571 if (result.isValid() and obj->color() != result) 571 if (result.isValid() and obj->color() != result)
572 return LDColor::nullColor(); // No consensus in object color 572 return LDColor::nullColor; // No consensus in object color
573 573
574 if (not result.isValid()) 574 if (not result.isValid())
575 result = obj->color(); 575 result = obj->color();
576 } 576 }
577 577
1292 m_color (color), 1292 m_color (color),
1293 m_toolButton (toolButton) {} 1293 m_toolButton (toolButton) {}
1294 1294
1295 ColorToolbarItem ColorToolbarItem::makeSeparator() 1295 ColorToolbarItem ColorToolbarItem::makeSeparator()
1296 { 1296 {
1297 return ColorToolbarItem (LDColor::nullColor(), nullptr); 1297 return ColorToolbarItem (LDColor::nullColor, nullptr);
1298 } 1298 }
1299 1299
1300 bool ColorToolbarItem::isSeparator() const 1300 bool ColorToolbarItem::isSeparator() const
1301 { 1301 {
1302 return color() == LDColor::nullColor(); 1302 return color() == LDColor::nullColor;
1303 } 1303 }
1304 1304
1305 LDColor ColorToolbarItem::color() const 1305 LDColor ColorToolbarItem::color() const
1306 { 1306 {
1307 return m_color; 1307 return m_color;

mercurial