#325 win: don't show two tooltips (#326)

Co-authored-by: yangzhenghan <yangzhenghan@sinap.ac.cn>
This commit is contained in:
kirakira 2023-11-20 12:59:47 +08:00 committed by GitHub
parent 2765d18634
commit 1764a8a918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -361,7 +361,7 @@ void QuickStandardTitleBar::clickCloseButton()
void QuickStandardTitleBar::retranslateUi()
{
#if (!defined(Q_OS_MACOS) && FRAMELESSHELPER_CONFIG(system_button))
#if (FRAMELESSHELPER_CONFIG(system_button) && defined(Q_OS_LINUX))
qobject_cast<QQuickToolTipAttached *>(qmlAttachedPropertiesObject<QQuickToolTip>(m_minimizeButton))->setText(tr("Minimize"));
qobject_cast<QQuickToolTipAttached *>(qmlAttachedPropertiesObject<QQuickToolTip>(m_maximizeButton))->setText([this]() -> QString {
if (const QQuickWindow * const w = window()) {

View File

@ -338,7 +338,7 @@ void StandardTitleBarPrivate::updateChromeButtonColor()
void StandardTitleBarPrivate::retranslateUi()
{
#if (!defined(Q_OS_MACOS) && FRAMELESSHELPER_CONFIG(system_button))
#if (FRAMELESSHELPER_CONFIG(system_button) && defined(Q_OS_LINUX))
minimizeButton->setToolTip(tr("Minimize"));
maximizeButton->setToolTip(window->isMaximized() ? tr("Restore") : tr("Maximize"));
closeButton->setToolTip(tr("Close"));