mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Ladybird/Qt: Display ampersands in tab titles
Qt reads ampersands as shortcut keys, so this escapes them (with &&) so they display correctly :^)
This commit is contained in:
parent
0b864bef60
commit
6133707df8
Notes:
github-actions[bot]
2024-08-12 13:18:09 +00:00
Author: https://github.com/jamierocks Commit: https://github.com/LadybirdBrowser/ladybird/commit/6133707df88 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1047
1 changed files with 5 additions and 1 deletions
|
@ -888,7 +888,11 @@ void BrowserWindow::device_pixel_ratio_changed(qreal dpi)
|
|||
|
||||
void BrowserWindow::tab_title_changed(int index, QString const& title)
|
||||
{
|
||||
m_tabs_container->setTabText(index, title);
|
||||
// NOTE: Qt uses ampersands for shortcut keys in tab titles, so we need to escape them.
|
||||
QString title_escaped = title;
|
||||
title_escaped.replace("&", "&&");
|
||||
|
||||
m_tabs_container->setTabText(index, title_escaped);
|
||||
m_tabs_container->setTabToolTip(index, title);
|
||||
|
||||
if (m_tabs_container->currentIndex() == index)
|
||||
|
|
Loading…
Reference in a new issue