mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:58:12 +00:00
LibGfx: Add Gfx::TextAttributes (and use it in GUI::TextDocumentSpan)
This commit is contained in:
parent
0d44ee6f2b
commit
05f5d0dda3
11 changed files with 127 additions and 83 deletions
|
@ -226,8 +226,8 @@ void Editor::mousemove_event(GUI::MouseEvent& event)
|
|||
|
||||
for (auto& span : document().spans()) {
|
||||
if (span.range.contains(m_previous_text_position) && !span.range.contains(text_position)) {
|
||||
if (highlighter->is_navigatable(span.data) && span.is_underlined) {
|
||||
span.is_underlined = false;
|
||||
if (highlighter->is_navigatable(span.data) && span.attributes.underline) {
|
||||
span.attributes.underline = false;
|
||||
wrapper().editor().update();
|
||||
}
|
||||
}
|
||||
|
@ -243,9 +243,9 @@ void Editor::mousemove_event(GUI::MouseEvent& event)
|
|||
|
||||
if (highlighter->is_navigatable(span.data)) {
|
||||
is_over_link = true;
|
||||
bool was_underlined = span.is_underlined;
|
||||
span.is_underlined = event.modifiers() & Mod_Ctrl;
|
||||
if (span.is_underlined != was_underlined) {
|
||||
bool was_underlined = span.attributes.underline;
|
||||
span.attributes.underline = event.modifiers() & Mod_Ctrl;
|
||||
if (span.attributes.underline != was_underlined) {
|
||||
wrapper().editor().update();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue