Skip to content

Commit

Permalink
Adding orange coloring of WIP todo items.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvorka committed Jan 5, 2024
1 parent ac49b6d commit eccc002
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/src/qt/look_n_feel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ void LookAndFeels::setDarkTheme()
editorLink.setRgb(0x00,0xFF,0xFF);
editorList.setRgb(0x00,0x99,0x00);
editorTaskDone.setRgb(0x00,0x99,0x00);
editorTaskWip.setRgb(0x99,0x00,0x00);
editorTaskWip.setRgb(0xFF,0xA5,0x00);
editorTaskTodo.setRgb(0x99,0x00,0x00);
editorCodeblock.setRgb(0x99,0x99,0x99);
editorHtmlTag.setRgb(0xAA,0x00,0xAA);
editorHtmlEntity.setRgb(0xAA,0x00,0xAA);
Expand Down
2 changes: 2 additions & 0 deletions app/src/qt/look_n_feel.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class LookAndFeels : public HtmlColorsRepresentation
QColor editorList;
QColor editorTaskDone;
QColor editorTaskWip;
QColor editorTaskTodo;
QColor editorHtmlTag;
QColor editorHtmlEntity;
QColor editorHtmlAttrName;
Expand Down Expand Up @@ -148,6 +149,7 @@ class LookAndFeels : public HtmlColorsRepresentation
QColor& getEditorList() { return editorList; }
QColor& getEditorTaskDone() { return editorTaskDone; }
QColor& getEditorTaskWip() { return editorTaskWip; }
QColor& getEditorTaskTodo() { return editorTaskTodo; }
QColor& getEditorCodeblock() { return editorCodeblock; }
QColor& getEditorHtmlTag() { return editorHtmlTag; }
QColor& getEditorHtmlEntity() { return editorHtmlEntity; }
Expand Down
7 changes: 6 additions & 1 deletion app/src/qt/note_edit_highlighter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ NoteEditHighlighter::NoteEditHighlighter(QPlainTextEdit* noteEditorView)
addRegex(UnorderedList, "^(:? )*[\\*\\+\\-] ");
addRegex(OrderedList, "^(:? )*\\d\\d?\\. ");
addRegex(TaskDoneItem, "^(:? )*[\\*\\+\\-] \\[x\\]");
addRegex(TaskWipItem, "^(:? )*[\\*\\+\\-] \\[ \\]");
addRegex(TaskWipItem, "^(:? )*[\\*\\+\\-] \\[w\\]");
addRegex(TaskTodoItem, "^(:? )*[\\*\\+\\-] \\[ \\]");

// formats
boldFormat.setForeground(lookAndFeels.getEditorBold());
Expand All @@ -80,6 +81,7 @@ NoteEditHighlighter::NoteEditHighlighter(QPlainTextEdit* noteEditorView)
listFormat.setForeground(lookAndFeels.getEditorList());
taskDoneFormat.setForeground(lookAndFeels.getEditorTaskDone());
taskWipFormat.setForeground(lookAndFeels.getEditorTaskWip());
taskTodoFormat.setForeground(lookAndFeels.getEditorTaskTodo());
codeBlockFormat.setForeground(lookAndFeels.getEditorCodeblock());
mathBlockFormat.setForeground(lookAndFeels.getEditorCodeblock());

Expand Down Expand Up @@ -205,6 +207,9 @@ void NoteEditHighlighter::highlightPatterns(const QString& text)
case TaskDoneItem:
setFormat(index, length, taskDoneFormat);
break;
case TaskTodoItem:
setFormat(index, length, taskTodoFormat);
break;
case TaskWipItem:
setFormat(index, length, taskWipFormat);
break;
Expand Down
2 changes: 2 additions & 0 deletions app/src/qt/note_edit_highlighter.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class NoteEditHighlighter : public QSyntaxHighlighter
UnorderedList,
TaskDoneItem,
TaskWipItem,
TaskTodoItem,
OrderedList,

HtmlTag,
Expand Down Expand Up @@ -79,6 +80,7 @@ class NoteEditHighlighter : public QSyntaxHighlighter
QTextCharFormat listFormat;
QTextCharFormat taskDoneFormat;
QTextCharFormat taskWipFormat;
QTextCharFormat taskTodoFormat;
QTextCharFormat codeBlockFormat;
QTextCharFormat mathBlockFormat;

Expand Down

0 comments on commit eccc002

Please sign in to comment.