[vlc-devel] [PATCH 2/2] qml: force "Segoe UI" as default font on windows
Prince Gupta
guptaprince8832 at gmail.com
Fri Jan 22 16:27:38 UTC 2021
---
modules/gui/qt/Makefile.am | 23 ++++++++++++++++++-----
modules/gui/qt/pixmaps/windows-theme.conf | 2 ++
modules/gui/qt/windows.qrc | 5 +++++
3 files changed, 25 insertions(+), 5 deletions(-)
create mode 100755 modules/gui/qt/pixmaps/windows-theme.conf
create mode 100644 modules/gui/qt/windows.qrc
diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index 75cf5f28ea..2081846e31 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -607,6 +607,10 @@ libqt_plugin_la_RES = \
gui/qt/pixmaps/back.svg \
gui/qt/pixmaps/time.svg
+if HAVE_WIN32
+libqt_plugin_la_RES += gui/qt/pixmaps/windows-theme.conf
+endif
+
#QML and JS resources
libqt_plugin_la_QML = \
gui/qt/dialogs/dialogs/qml/CustomDialog.qml \
@@ -750,7 +754,13 @@ libqt_plugin_la_QML = \
gui/qt/widgets/qml/FrostedGlassEffect.qml \
gui/qt/widgets/qml/OverlayMenu.qml
-EXTRA_DIST += gui/qt/vlc.qrc $(libqt_plugin_la_RES)
+lib_qt_plugin_la_QRC = gui/qt/vlc.qrc
+
+if HAVE_WIN32
+lib_qt_plugin_la_QRC += gui/qt/windows.qrc
+endif
+
+EXTRA_DIST += $(lib_qt_plugin_la_QRC) $(libqt_plugin_la_RES)
nodist_libqt_plugin_la_SOURCES += gui/qt/resources.cpp
@@ -775,8 +785,11 @@ libqt_plugin_la_SOURCES += $(libqt_plugin_la_QML)
qml_cache.qrc: gui/qt/vlc.qrc
$(AM_V_GEN)$(QMLCACHE) --filter-resource-file -o $@ $<
-gui/qt/resources.cpp: qml_cache.qrc $(libqt_plugin_la_RES)
- $(AM_V_GEN)$(RCC) --name qml_cache -o $@ $<
+QRCS_EXCEPT_VLC_QRC = $(filter-out gui/qt/vlc.qrc, $(lib_qt_plugin_la_QRC))
+QRCS_EXCEPT_VLC_QRC += qml_cache.qrc
+
+gui/qt/resources.cpp: $(QRCS_EXCEPT_VLC_QRC) $(libqt_plugin_la_RES)
+ $(AM_V_GEN)$(RCC) --name qml_cache -o $@ $(filter %.qrc, $^)
#output name matters here
gui/qt/qmlcache_loader.cpp: gui/qt/vlc.qrc qml_cache.qrc $(libqt_plugin_la_QML)
@@ -786,8 +799,8 @@ else
EXTRA_DIST += $(libqt_plugin_la_QML)
-gui/qt/resources.cpp: gui/qt/vlc.qrc $(libqt_plugin_la_RES) $(libqt_plugin_la_QML)
- $(AM_V_GEN)$(RCC) --name vlc -o $@ $<
+gui/qt/resources.cpp: $(lib_qt_plugin_la_QRC) $(libqt_plugin_la_RES) $(libqt_plugin_la_QML)
+ $(AM_V_GEN)$(RCC) --name vlc -o $@ $(filter %.qrc, $^)
endif
diff --git a/modules/gui/qt/pixmaps/windows-theme.conf b/modules/gui/qt/pixmaps/windows-theme.conf
new file mode 100755
index 0000000000..fe75612e90
--- /dev/null
+++ b/modules/gui/qt/pixmaps/windows-theme.conf
@@ -0,0 +1,2 @@
+[Default]
+Font\Family=Segoe UI
diff --git a/modules/gui/qt/windows.qrc b/modules/gui/qt/windows.qrc
new file mode 100644
index 0000000000..962dd444c6
--- /dev/null
+++ b/modules/gui/qt/windows.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file alias="qtquickcontrols2.conf">pixmaps/windows-theme.conf</file>
+ </qresource>
+</RCC>
--
2.25.1
More information about the vlc-devel
mailing list