Merge 858f8150addd300a6ce12b7f568145022163b8b8 into af2479da8dc0ff0c7104c4ccde1715b1c562dfdc

This commit is contained in:
Jonathan White 2025-03-30 23:52:53 +02:00 committed by GitHub
commit 79964b9b14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 6 deletions

View File

@ -5639,10 +5639,6 @@ Are you sure you want to continue with this file?</source>
<source>&amp;Tools</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>View</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Theme</source>
<translation type="unfinished"></translation>
@ -6308,6 +6304,10 @@ Expect some bugs and minor issues, this version is meant for testing purposes.</
<source>E&amp;xpire Entry</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;View</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Clear SSH Agent</source>
<translation type="unfinished"></translation>

View File

@ -377,7 +377,7 @@
</widget>
<widget class="QMenu" name="menuView">
<property name="title">
<string>View</string>
<string>&amp;View</string>
</property>
<widget class="QMenu" name="menuTheme">
<property name="title">

View File

@ -29,6 +29,7 @@
#include <QFile>
#include <QHeaderView>
#include <QListView>
#include <QMenuBar>
#include <QPainter>
#include <QPainterPath>
#include <QPoint>
@ -4694,7 +4695,24 @@ int BaseStyle::styleHint(StyleHint hint,
case SH_WindowFrame_Mask:
return 0;
case SH_UnderlineShortcut: {
return false;
#if defined(Q_OS_WIN) or defined(Q_OS_LINUX)
// Only show underline shortcuts if the user focused with ALT (Win/Linux only)
auto menu = qobject_cast<const QMenu*>(widget);
if (menu) {
auto p = menu->parentWidget();
while (p) {
auto mb = qobject_cast<QMenuBar*>(p);
if (mb && mb->hasFocus()) {
return 1;
}
p = p->parentWidget();
}
}
auto mb = qobject_cast<const QMenuBar*>(widget);
return (mb && mb->hasFocus()) ? 1 : 0;
#else
return 0;
#endif
}
case SH_Widget_Animate:
return 1;