gui.cpp

changeset 164
8c93d8e38494
parent 163
46955613626d
child 165
88a03c1a52d9
equal deleted inserted replaced
163:46955613626d 164:8c93d8e38494
458 if (g_curfile->m_objs.size() > 0 && 458 if (g_curfile->m_objs.size() > 0 &&
459 g_curfile->m_objs[0]->getType() == OBJ_Comment) 459 g_curfile->m_objs[0]->getType() == OBJ_Comment)
460 { 460 {
461 // Append title 461 // Append title
462 LDComment* comm = static_cast<LDComment*> (g_curfile->m_objs[0]); 462 LDComment* comm = static_cast<LDComment*> (g_curfile->m_objs[0]);
463 title += fmt (": %s", comm->zText.chars()); 463 title += fmt (": %s", comm->text.chars());
464 } 464 }
465 465
466 if (History::pos () != g_curfile->savePos) 466 if (History::pos () != g_curfile->savePos)
467 title += '*'; 467 title += '*';
468 } 468 }
535 535
536 for (LDObject* obj : g_curfile->m_objs) { 536 for (LDObject* obj : g_curfile->m_objs) {
537 str zText; 537 str zText;
538 switch (obj->getType ()) { 538 switch (obj->getType ()) {
539 case OBJ_Comment: 539 case OBJ_Comment:
540 zText = static_cast<LDComment*> (obj)->zText.chars(); 540 zText = static_cast<LDComment*> (obj)->text.chars();
541 541
542 // Remove leading whitespace 542 // Remove leading whitespace
543 while (~zText && zText[0] == ' ') 543 while (~zText && zText[0] == ' ')
544 zText -= -1; 544 zText -= -1;
545 break; 545 break;
614 break; 614 break;
615 615
616 case OBJ_BFC: 616 case OBJ_BFC:
617 { 617 {
618 LDBFC* bfc = static_cast<LDBFC*> (obj); 618 LDBFC* bfc = static_cast<LDBFC*> (obj);
619 zText = LDBFC::saStatements[bfc->eStatement]; 619 zText = LDBFC::statements[bfc->type];
620 } 620 }
621 break; 621 break;
622 622
623 case OBJ_Radial: 623 case OBJ_Radial:
624 { 624 {
642 642
643 // Color gibberish orange on red so it stands out. 643 // Color gibberish orange on red so it stands out.
644 if (obj->getType() == OBJ_Gibberish) { 644 if (obj->getType() == OBJ_Gibberish) {
645 item->setBackground (QColor ("#AA0000")); 645 item->setBackground (QColor ("#AA0000"));
646 item->setForeground (QColor ("#FFAA00")); 646 item->setForeground (QColor ("#FFAA00"));
647 } else if (lv_colorize && obj->dColor != -1 && 647 } else if (lv_colorize && obj->isColored () &&
648 obj->dColor != maincolor && obj->dColor != edgecolor) 648 obj->dColor != maincolor && obj->dColor != edgecolor)
649 { 649 {
650 // If the object isn't in the main or edge color, draw this 650 // If the object isn't in the main or edge color, draw this
651 // list entry in said color. 651 // list entry in said color.
652 color* col = getColor (obj->dColor); 652 color* col = getColor (obj->dColor);
896 } 896 }
897 897
898 // ============================================================================= 898 // =============================================================================
899 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 899 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
900 // ============================================================================= 900 // =============================================================================
901 QPixmap getIcon (const char* sIconName) { 901 QPixmap getIcon (const char* iconName) {
902 return (QPixmap (fmt (":/icons/%s.png", sIconName))); 902 return (QPixmap (fmt (":/icons/%s.png", iconName)));
903 } 903 }
904 904
905 // ============================================================================= 905 // =============================================================================
906 bool confirm (str msg) { 906 bool confirm (str msg) {
907 return confirm ("Confirm", msg); 907 return confirm ("Confirm", msg);
974 974
975 m_msglog->setHtml (log); 975 m_msglog->setHtml (log);
976 } 976 }
977 977
978 // ============================================================================= 978 // =============================================================================
979 QAction* const& findAction (str name) { 979 QAction* findAction (str name) {
980 for (actionmeta& meta : g_ActionMeta) 980 for (actionmeta& meta : g_ActionMeta)
981 if (name == meta.name) 981 if (name == meta.name)
982 return *meta.qAct; 982 return *meta.qAct;
983 983
984 return null; 984 return null;

mercurial