Skip to content

Commit

Permalink
fullscreen hotkey hint: don't show on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Apr 5, 2023
1 parent f466855 commit 4738587
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mixxxmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,14 @@ void MixxxMainWindow::initialize() {
// otherwise it would shift the launch image shortly before the skin is visible.
m_pMenuBar->show();

#ifndef __APPLE__
// Show the fullscreen hotkey hint if we went fullscreen earlier.
// This should make users aware of the new feature (press Alt to show/hide menu bar)
// if they upgraded Mixxx with 'Start in fullscreen mode'.
// Show the hint now so it doesn't interfere with other popups, e.g. the
// sound device warnings.
showFullScreenHotkeyHint();
#endif

// The launch image widget is automatically disposed, but we still have a
// pointer to it.
Expand Down Expand Up @@ -373,13 +375,15 @@ void MixxxMainWindow::initialize() {
this,
&MixxxMainWindow::slotUpdateWindowTitle);

#ifndef __APPLE__
if (m_pCoreServices->getSettings()->getValueString(
ConfigKey("[Config]", "hide_fullscreen_hint")) != "1") {
connect(this,
&MixxxMainWindow::fullScreenChanged,
this,
&MixxxMainWindow::showFullScreenHotkeyHint);
}
#endif
}

MixxxMainWindow::~MixxxMainWindow() {
Expand Down Expand Up @@ -1251,6 +1255,7 @@ void MixxxMainWindow::initializationProgressUpdate(int progress, const QString&
qApp->processEvents();
}

#ifndef __APPLE__
void MixxxMainWindow::showFullScreenHotkeyHint() {
if (!isFullScreen()) {
return;
Expand Down Expand Up @@ -1313,11 +1318,9 @@ WFullScreenHint::WFullScreenHint(QWidget* parent, UserSettingsPointer pConfig)
pLabelLayout->addWidget(fullScreenHotkeys);
}

#ifndef __APPLE__
auto* menuHotkey = new QLabel(tr("Press <b>Alt</b> to toggle the menu bar"), this);
menuHotkey->setObjectName("MenuHotkeyLabel");
pLabelLayout->addWidget(menuHotkey);
#endif

pLabelLayout->addStretch();

Expand Down Expand Up @@ -1374,3 +1377,4 @@ void WFullScreenHint::closeEvent(QCloseEvent* event) {
m_pConfig->set(ConfigKey("[Config]", "hide_fullscreen_hint"), ConfigValue(remind));
QWidget::closeEvent(event);
}
#endif
8 changes: 8 additions & 0 deletions src/mixxxmainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class DlgKeywheel;
class GuiTick;
class LaunchImage;
class VisualsManager;
#ifndef __APPLE__
class WFullScreenHint;
#endif
class WMainMenuBar;
class QCheckBox;

Expand Down Expand Up @@ -103,7 +105,9 @@ class MixxxMainWindow : public QMainWindow {

bool confirmExit();

#ifndef __APPLE__
void showFullScreenHotkeyHint();
#endif

QDialog::DialogCode soundDeviceErrorDlg(
const QString &title, const QString &text, bool* retryClicked);
Expand All @@ -116,7 +120,9 @@ class MixxxMainWindow : public QMainWindow {

QWidget* m_pCentralWidget;
LaunchImage* m_pLaunchImage;
#ifndef __APPLE__
WFullScreenHint* m_pFullScreenHint;
#endif

std::shared_ptr<mixxx::skin::SkinLoader> m_pSkinLoader;
GuiTick* m_pGuiTick;
Expand Down Expand Up @@ -144,6 +150,7 @@ class MixxxMainWindow : public QMainWindow {
QSet<ControlObject*> m_skinCreatedControls;
};

#ifndef __APPLE__
class WFullScreenHint : public QWidget {
Q_OBJECT
public:
Expand All @@ -159,3 +166,4 @@ class WFullScreenHint : public QWidget {
QPushButton* m_pOkayBtn;
UserSettingsPointer m_pConfig;
};
#endif

0 comments on commit 4738587

Please sign in to comment.