feat: add underline to panels and export

This commit is contained in:
Brendan Hagan
2022-07-26 22:37:57 -04:00
parent 78227a30da
commit 132d8d9351
8 changed files with 47 additions and 19 deletions
+8 -2
View File
@@ -805,7 +805,7 @@ bool TextValueEditor::doDelete() {
bool TextValueEditor::canFormat(int type) const {
switch (type) {
case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC:
case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC: case ID_FORMAT_UNDERLINE:
return !style().always_symbol && style().allow_formating;
case ID_FORMAT_SYMBOL:
return !style().always_symbol && style().allow_formating && style().symbol_font.valid();
@@ -822,7 +822,9 @@ bool TextValueEditor::hasFormat(int type) const {
case ID_FORMAT_BOLD:
return is_in_tag(value().value(), _("<b"), selection_start_i, selection_end_i);
case ID_FORMAT_ITALIC:
return is_in_tag(value().value(), _("<i"), selection_start_i, selection_end_i);
return is_in_tag(value().value(), _("<i"), selection_start_i, selection_end_i);
case ID_FORMAT_UNDERLINE:
return is_in_tag(value().value(), _("<u"), selection_start_i, selection_end_i);
case ID_FORMAT_SYMBOL:
return is_in_tag(value().value(), _("<sym"), selection_start_i, selection_end_i);
case ID_FORMAT_REMINDER: {
@@ -848,6 +850,10 @@ void TextValueEditor::doFormat(int type) {
case ID_FORMAT_ITALIC: {
addAction(toggle_format_action(valueP(), _("i"), selection_start_i, selection_end_i, selection_start, selection_end, _("Italic")));
break;
}
case ID_FORMAT_UNDERLINE: {
addAction(toggle_format_action(valueP(), _("u"), selection_start_i, selection_end_i, selection_start, selection_end, _("Underline")));
break;
}
case ID_FORMAT_SYMBOL: {
addAction(toggle_format_action(valueP(), _("sym"), selection_start_i, selection_end_i, selection_start, selection_end, _("Symbols")));