diff --git a/source/frontend/carla_app.py b/source/frontend/carla_app.py index f01f64b20..2712870c7 100644 --- a/source/frontend/carla_app.py +++ b/source/frontend/carla_app.py @@ -42,12 +42,16 @@ class CarlaApplication(object): # Needed for local wine build if WINDOWS and CWD.endswith(("frontend", "resources")) and os.getenv("CXFREEZE") is None: - QApplication.addLibraryPath("H:\\builds\\msys2-i686\\mingw32\\share\\qt5\\plugins") + if kIs64bit: + path = "H:\\builds\\msys2-x86_64\\mingw64\\share\\qt5\\plugins" + else: + path = "H:\\builds\\msys2-i686\\mingw32\\share\\qt5\\plugins" + QApplication.addLibraryPath(path) # Use binary dir as library path if os.path.exists(pathBinaries): QApplication.addLibraryPath(pathBinaries) - stylesDir = pathBinaries if not WINDOWS else "" # FIXME + stylesDir = pathBinaries # If style is not available we can still fake it else: @@ -72,6 +76,13 @@ class CarlaApplication(object): self.fApp.setStyle("carla" if stylesDir else "fusion") + if WINDOWS: + carlastyle = os.path.join(pathBinaries, "styles", "carlastyle.dll") + self._stylelib = CDLL(carlastyle, RTLD_GLOBAL) + self._stylelib.set_qt_app_style.argtypes = None + self._stylelib.set_qt_app_style.restype = None + self._stylelib.set_qt_app_style() + # set palette proThemeColor = settings.value(CARLA_KEY_MAIN_PRO_THEME_COLOR, CARLA_DEFAULT_MAIN_PRO_THEME_COLOR, type=str).lower() diff --git a/source/theme/CarlaStylePlugin.cpp b/source/theme/CarlaStylePlugin.cpp index 9f3a4dfea..2f415034b 100644 --- a/source/theme/CarlaStylePlugin.cpp +++ b/source/theme/CarlaStylePlugin.cpp @@ -1,7 +1,7 @@ /* * Carla Style, based on Qt5 fusion style * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies) - * Copyright (C) 2013-2014 Filipe Coelho + * Copyright (C) 2013-2019 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,10 @@ #include "CarlaStylePlugin.hpp" #include "CarlaStyle.hpp" +#ifdef CARLA_OS_WIN +# include +#endif + CarlaStylePlugin::CarlaStylePlugin(QObject* parentObj) : QStylePlugin(parentObj) {} @@ -34,3 +38,11 @@ QStringList CarlaStylePlugin::keys() const Q_EXPORT_PLUGIN2(Carla, CarlaStylePlugin) #endif + +#ifdef CARLA_OS_WIN +CARLA_EXPORT void set_qt_app_style() +{ + qApp->setStyle(new CarlaStyle()); +} +#endif + diff --git a/source/theme/Makefile b/source/theme/Makefile index 854a5875a..8b9362a7e 100644 --- a/source/theme/Makefile +++ b/source/theme/Makefile @@ -11,7 +11,7 @@ include ../modules/Makefile.mk # --------------------------------------------------------------------------------------------------------------------- ifeq ($(WIN32),true) -NON_STATIC_LINK_FLAGS = $(shell echo $(LINK_FLAGS) | awk 'sub(" -static","")') +NON_STATIC_LINK_FLAGS = $(shell echo $(LINK_FLAGS) | awk 'sub(" -static","")') -static-libgcc else NON_STATIC_LINK_FLAGS = $(LINK_FLAGS) endif @@ -118,7 +118,7 @@ $(MODULEDIR)/$(MODULENAME).qt5.a: $(FILES_qt5) $(OBJS_qt5) $(BINDIR)/styles/carlastyle.dll: $(FILES_qt5) $(OBJS_qt5_shared) -@mkdir -p $(BINDIR)/styles @echo "Linking carlastyle.dll" - @$(CXX) $(OBJS_qt5_shared) $(QT5_LINK_FLAGS) -luuid -lwinspool -lgdi32 -limm32 -lole32 -lshell32 -lws2_32 -shared -o $@ + @$(CXX) $(OBJS_qt5_shared) $(QT5_LINK_FLAGS) -shared -o $@ $(BINDIR)/styles/carlastyle.dylib: $(FILES_qt5) $(OBJS_qt5_shared) -@mkdir -p $(BINDIR)/styles