Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skins: allow menubar to be styled #3372

Merged
merged 1 commit into from
Nov 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/mixxx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ void MixxxMainWindow::initialize(QApplication* pApp, const CmdlineArgs& args) {

m_pWidgetParent = oldWidget;
//TODO (XXX) add dialog to warn user and launch skin choice page
} else {
m_pMenuBar->setStyleSheet(m_pWidgetParent->styleSheet());
}

// Fake a 100 % progress here.
Expand Down Expand Up @@ -1111,6 +1113,9 @@ void MixxxMainWindow::createMenuBar() {
ScopedTimer t("MixxxMainWindow::createMenuBar");
DEBUG_ASSERT(m_pKbdConfig != nullptr);
m_pMenuBar = make_parented<WMainMenuBar>(this, m_pSettingsManager->settings(), m_pKbdConfig);
if (m_pWidgetParent) {
m_pMenuBar->setStyleSheet(m_pWidgetParent->styleSheet());
}
setMenuBar(m_pMenuBar);
}

Expand Down Expand Up @@ -1475,6 +1480,7 @@ void MixxxMainWindow::rebootMixxxView() {
// m_pWidgetParent is NULL, we can't continue.
return;
}
m_pMenuBar->setStyleSheet(m_pWidgetParent->styleSheet());

setCentralWidget(m_pWidgetParent);
#ifdef __LINUX__
Expand Down
15 changes: 8 additions & 7 deletions src/widget/wmainmenubar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ WMainMenuBar::WMainMenuBar(QWidget* pParent, UserSettingsPointer pConfig,
: QMenuBar(pParent),
m_pConfig(pConfig),
m_pKbdConfig(pKbdConfig) {
setObjectName(QStringLiteral("MainMenu"));
initialize();
}

void WMainMenuBar::initialize() {
// FILE MENU
QMenu* pFileMenu = new QMenu(tr("&File"));
QMenu* pFileMenu = new QMenu(tr("&File"), this);

QString loadTrackText = tr("Load Track to Deck &%1");
QString loadTrackStatusText = tr("Loads a track in deck %1");
Expand Down Expand Up @@ -109,7 +110,7 @@ void WMainMenuBar::initialize() {
addMenu(pFileMenu);

// LIBRARY MENU
QMenu* pLibraryMenu = new QMenu(tr("&Library"));
QMenu* pLibraryMenu = new QMenu(tr("&Library"), this);

QString rescanTitle = tr("&Rescan Library");
QString rescanText = tr("Rescans library folders for changes to tracks.");
Expand Down Expand Up @@ -158,9 +159,9 @@ void WMainMenuBar::initialize() {
// Add an invisible suffix to the View item string so it doesn't string-equal "View" ,
// and the magic menu items won't get injected.
// https://bugs.launchpad.net/mixxx/+bug/1534292
QMenu* pViewMenu = new QMenu(tr("&View") + QStringLiteral("\u200C"));
QMenu* pViewMenu = new QMenu(tr("&View") + QStringLiteral("\u200C"), this);
#else
QMenu* pViewMenu = new QMenu(tr("&View"));
QMenu* pViewMenu = new QMenu(tr("&View"), this);
#endif

// Skin Settings Menu
Expand Down Expand Up @@ -295,10 +296,10 @@ void WMainMenuBar::initialize() {
addMenu(pViewMenu);

// OPTIONS MENU
QMenu* pOptionsMenu = new QMenu(tr("&Options"));
QMenu* pOptionsMenu = new QMenu(tr("&Options"), this);

#ifdef __VINYLCONTROL__
QMenu* pVinylControlMenu = new QMenu(tr("&Vinyl Control"));
QMenu* pVinylControlMenu = new QMenu(tr("&Vinyl Control"), this);
QString vinylControlText = tr(
"Use timecoded vinyls on external turntables to control Mixxx");

Expand Down Expand Up @@ -414,7 +415,7 @@ void WMainMenuBar::initialize() {

// DEVELOPER MENU
if (CmdlineArgs::Instance().getDeveloper()) {
QMenu* pDeveloperMenu = new QMenu(tr("&Developer"));
QMenu* pDeveloperMenu = new QMenu(tr("&Developer"), this);

QString reloadSkinTitle = tr("&Reload Skin");
QString reloadSkinText = tr("Reload the skin");
Expand Down