Compare commits

...

2 Commits

Author SHA1 Message Date
kirakira 1764a8a918
#325 win: don't show two tooltips (#326)
Co-authored-by: yangzhenghan <yangzhenghan@sinap.ac.cn>
2023-11-20 12:59:47 +08:00
Yuhang Zhao 2765d18634 win: don't show two tooltips
Fixes: #325
2023-11-20 10:31:03 +08:00
2 changed files with 4 additions and 4 deletions

View File

@ -245,7 +245,7 @@ void QuickStandardTitleBar::setWindowIcon(const QVariant &value)
void QuickStandardTitleBar::updateMaximizeButton()
{
#if (!defined(Q_OS_MACOS) && FRAMELESSHELPER_CONFIG(system_button))
#if (FRAMELESSHELPER_CONFIG(system_button) && defined(Q_OS_LINUX))
const QQuickWindow * const w = window();
if (!w) {
return;
@ -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

@ -293,7 +293,7 @@ bool StandardTitleBarPrivate::isInTitleBarIconArea(const QPoint &pos) const
void StandardTitleBarPrivate::updateMaximizeButton()
{
#if (!defined(Q_OS_MACOS) && FRAMELESSHELPER_CONFIG(system_button))
#if (FRAMELESSHELPER_CONFIG(system_button) && defined(Q_OS_LINUX))
const bool max = window->isMaximized();
maximizeButton->setButtonType(max ? SystemButtonType::Restore : SystemButtonType::Maximize);
maximizeButton->setToolTip(max ? tr("Restore") : tr("Maximize"));
@ -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"));