diff --git a/CHANGELOG.md b/CHANGELOG.md index a8182382c46..cd6df89d280 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - Minor: Added the ability to configure the color of highlighted AutoMod caught messages. (#5215) - Minor: Updated to Emoji v15.1. Google emojis are now used as the fallback instead of Twitter emojis. (#5182) - Minor: Added icons for newer versions of macOS. (#5148) +- Minor: Added more menu items in macOS menu bar. (#5266) - Minor: Improved color selection and display. (#5057) - Minor: Added a _System_ theme setting that updates according to the system's color scheme (requires Qt 6.5). (#5118) - Minor: Normalized the input padding between light & dark themes. (#5095) diff --git a/src/common/Common.hpp b/src/common/Common.hpp index b0315a8aaf2..35b8efb1cc3 100644 --- a/src/common/Common.hpp +++ b/src/common/Common.hpp @@ -8,6 +8,10 @@ #include #include +#define LINK_CHATTERINO_WIKI "https://wiki.chatterino.com" +#define LINK_CHATTERINO_DISCORD "https://discord.gg/7Y5AYhAK4z" +#define LINK_CHATTERINO_SOURCE "https://github.com/Chatterino/chatterino2" + namespace chatterino { enum class HighlightState { diff --git a/src/widgets/Window.cpp b/src/widgets/Window.cpp index 8b3cea43033..7106f872fcf 100644 --- a/src/widgets/Window.cpp +++ b/src/widgets/Window.cpp @@ -2,6 +2,7 @@ #include "Application.hpp" #include "common/Args.hpp" +#include "common/Common.hpp" #include "common/Credentials.hpp" #include "common/Modes.hpp" #include "common/QLogging.hpp" @@ -702,6 +703,14 @@ void Window::addMenuBar() // First menu. QMenu *menu = mainMenu->addMenu(QString()); + + // About button that shows the About tab in the Settings Dialog. + QAction *about = menu->addAction(QString()); + about->setMenuRole(QAction::AboutRole); + connect(about, &QAction::triggered, this, [this] { + SettingsDialog::showDialog(this, SettingsDialogPreference::About); + }); + QAction *prefs = menu->addAction(QString()); prefs->setMenuRole(QAction::PreferencesRole); connect(prefs, &QAction::triggered, this, [this] { @@ -711,6 +720,13 @@ void Window::addMenuBar() // Window menu. QMenu *windowMenu = mainMenu->addMenu(QString("Window")); + // Window->Minimize item + QAction *minimizeWindow = windowMenu->addAction(QString("Minimize")); + minimizeWindow->setShortcuts({QKeySequence("Meta+M")}); + connect(minimizeWindow, &QAction::triggered, this, [this] { + this->setWindowState(Qt::WindowMinimized); + }); + QAction *nextTab = windowMenu->addAction(QString("Select next tab")); nextTab->setShortcuts({QKeySequence("Meta+Tab")}); connect(nextTab, &QAction::triggered, this, [this] { @@ -722,6 +738,27 @@ void Window::addMenuBar() connect(prevTab, &QAction::triggered, this, [this] { this->notebook_->selectPreviousTab(); }); + + // Help menu. + QMenu *helpMenu = mainMenu->addMenu(QString("Help")); + + // Help->Chatterino Wiki item + QAction *helpWiki = helpMenu->addAction(QString("Chatterino Wiki")); + connect(helpWiki, &QAction::triggered, this, []() { + QDesktopServices::openUrl(QUrl(LINK_CHATTERINO_WIKI)); + }); + + // Help->Chatterino Github + QAction *helpGithub = helpMenu->addAction(QString("Chatterino GitHub")); + connect(helpGithub, &QAction::triggered, this, []() { + QDesktopServices::openUrl(QUrl(LINK_CHATTERINO_SOURCE)); + }); + + // Help->Chatterino Discord + QAction *helpDiscord = helpMenu->addAction(QString("Chatterino Discord")); + connect(helpDiscord, &QAction::triggered, this, []() { + QDesktopServices::openUrl(QUrl(LINK_CHATTERINO_DISCORD)); + }); } void Window::onAccountSelected() diff --git a/src/widgets/dialogs/SettingsDialog.cpp b/src/widgets/dialogs/SettingsDialog.cpp index 49cdf8e3539..62d459e222f 100644 --- a/src/widgets/dialogs/SettingsDialog.cpp +++ b/src/widgets/dialogs/SettingsDialog.cpp @@ -249,7 +249,7 @@ void SettingsDialog::addTabs() this->addTab([]{return new PluginsPage;}, "Plugins", ":/settings/plugins.svg"); #endif this->ui_.tabContainer->addStretch(1); - this->addTab([]{return new AboutPage;}, "About", ":/settings/about.svg", SettingsTabId(), Qt::AlignBottom); + this->addTab([]{return new AboutPage;}, "About", ":/settings/about.svg", SettingsTabId::About, Qt::AlignBottom); // clang-format on } @@ -366,6 +366,11 @@ void SettingsDialog::showDialog(QWidget *parent, } break; + case SettingsDialogPreference::About: { + instance->selectTab(SettingsTabId::About); + } + break; + default:; } diff --git a/src/widgets/dialogs/SettingsDialog.hpp b/src/widgets/dialogs/SettingsDialog.hpp index e227223de96..6c32e0ccbc3 100644 --- a/src/widgets/dialogs/SettingsDialog.hpp +++ b/src/widgets/dialogs/SettingsDialog.hpp @@ -30,6 +30,7 @@ enum class SettingsDialogPreference { StreamerMode, Accounts, ModerationActions, + About, }; class SettingsDialog : public BaseWindow diff --git a/src/widgets/helper/SettingsDialogTab.hpp b/src/widgets/helper/SettingsDialogTab.hpp index 97a1ad51d6d..0c60688b2aa 100644 --- a/src/widgets/helper/SettingsDialogTab.hpp +++ b/src/widgets/helper/SettingsDialogTab.hpp @@ -18,6 +18,7 @@ enum class SettingsTabId { General, Accounts, Moderation, + About, }; class SettingsDialogTab : public BaseWidget diff --git a/src/widgets/settingspages/AboutPage.cpp b/src/widgets/settingspages/AboutPage.cpp index 471b6d03b25..78597c5fca3 100644 --- a/src/widgets/settingspages/AboutPage.cpp +++ b/src/widgets/settingspages/AboutPage.cpp @@ -1,5 +1,6 @@ #include "AboutPage.hpp" +#include "common/Common.hpp" #include "common/Modes.hpp" #include "common/QLogging.hpp" #include "common/Version.hpp" @@ -18,10 +19,8 @@ #define PIXMAP_WIDTH 500 -#define LINK_CHATTERINO_WIKI "https://wiki.chatterino.com" #define LINK_DONATE "https://streamelements.com/fourtf/tip" #define LINK_CHATTERINO_FEATURES "https://chatterino.com/#features" -#define LINK_CHATTERINO_DISCORD "https://discord.gg/7Y5AYhAK4z" namespace chatterino {