mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
feat: add underline to panels and export
This commit is contained in:
@@ -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")));
|
||||
|
||||
Reference in New Issue
Block a user