mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 21:45:20 +00:00
Ladybird/Qt: Allow CR inside of elements title attributes
This commit is contained in:
parent
72e6581585
commit
16fdb005f0
Notes:
sideshowbarker
2024-07-17 03:16:02 +09:00
Author: https://github.com/bplaat Commit: https://github.com/SerenityOS/serenity/commit/16fdb005f0 Pull-request: https://github.com/SerenityOS/serenity/pull/23513 Issue: https://github.com/SerenityOS/serenity/issues/14173 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/trflynn89
1 changed files with 4 additions and 1 deletions
|
@ -109,9 +109,12 @@ WebContentView::WebContentView(QWidget* window, WebContentOptions const& web_con
|
||||||
};
|
};
|
||||||
|
|
||||||
on_enter_tooltip_area = [this](auto position, auto const& tooltip) {
|
on_enter_tooltip_area = [this](auto position, auto const& tooltip) {
|
||||||
|
auto tooltip_without_carriage_return = tooltip.contains("\r"sv)
|
||||||
|
? tooltip.replace("\r\n"sv, "\n"sv, ReplaceMode::All).replace("\r"sv, "\n"sv, ReplaceMode::All)
|
||||||
|
: tooltip;
|
||||||
QToolTip::showText(
|
QToolTip::showText(
|
||||||
mapToGlobal(QPoint(position.x(), position.y())),
|
mapToGlobal(QPoint(position.x(), position.y())),
|
||||||
qstring_from_ak_string(tooltip),
|
qstring_from_ak_string(tooltip_without_carriage_return),
|
||||||
this);
|
this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue