Skip to content
Permalink
Browse files

Re-work Mac-specific style code in MainWindow.cpp and OverlayClient.c…

…pp to work with the new theme system.
  • Loading branch information...
mkrautz committed Jul 12, 2015
1 parent 0a5d2ba commit 4ebfb908e1a4fec79daeda46a501eb08492b8a0b
Showing with 4 additions and 10 deletions.
  1. +0 −1 src/mumble/Global.h
  2. +2 −1 src/mumble/MainWindow.cpp
  3. +2 −8 src/mumble/OverlayClient.cpp
@@ -104,7 +104,6 @@ struct Global Q_DECL_FINAL {
unsigned int uiMessageLength;
unsigned int uiImageLength;
bool bQuit;
QString qsCurrentStyle;

bool bHappyEaster;
static const char ccHappyEaster[];
@@ -67,6 +67,7 @@
#include "VoiceRecorderDialog.h"
#include "../SignalCurry.h"
#include "Settings.h"
#include "Themes.h"

#ifdef Q_OS_WIN
#include "TaskList.h"
@@ -2140,7 +2141,7 @@ void MainWindow::on_qaConfigDialog_triggered() {
// stylesheet set. Also, the Mac dialog doesn't work when embedded
// inside the interactive overlay, so there we always force a regular
// ConfigDialog.
if (! g.ocIntercept && (g.qsCurrentStyle == QLatin1String("Macintosh (aqua)") || g.qsCurrentStyle.isEmpty()) && g.s.qsSkin.isEmpty())
if (! g.ocIntercept && !Themes::getConfiguredStyle(g.s))
dlg = new ConfigDialogMac(this);
#endif
if (! dlg)
@@ -43,6 +43,7 @@
#include "ServerHandler.h"
#include "MainWindow.h"
#include "GlobalShortcut.h"
#include "Themes.h"

OverlayClient::OverlayClient(QLocalSocket *socket, QObject *p)
: QObject(p)
@@ -374,14 +375,7 @@ void OverlayClient::hideGui() {
#ifdef Q_OS_MAC
qApp->setAttribute(Qt::AA_DontUseNativeMenuBar, false);
g.mw->setUnifiedTitleAndToolBarOnMac(true);
if (! g.qsCurrentStyle.isEmpty()) {
qApp->setStyle(g.qsCurrentStyle);
} else {
// Assume that an empty qsCurrentStyle means "use the aqua theme".
// This might not always be the case (for example, the default style
// can be changed via the Qt command line argument "-style".
qApp->setStyle(QLatin1String("Macintosh (aqua)"));
}
Themes::apply();
#endif

setupScene(false);

0 comments on commit 4ebfb90

Please sign in to comment.
You can’t perform that action at this time.