Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
  • core_lib
  • src
  • external
  • win32
win32.cpp
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5Copyright (C) 2009 Mj Mendoza IV
6Copyright (C) 2012-2020 Matthew Chiawen Chang
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; version 2 of the License.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17*/
18
19#include "platformhandler.h"
20
21#include <QCoreApplication>
22#include <QSettings>
23
24#include <ShObjIdl.h>
25
26#include "pencildef.h"
27
28namespace PlatformHandler
29{
30 void configurePlatformSpecificSettings() {}
31 bool isDarkMode() { return false; };
32 void initialise()
33 {
34#if _WIN32_WINNT >= _WIN32_WINNT_WIN7
35#if defined(PENCIL2D_RELEASE_BUILD)
36 SetCurrentProcessExplicitAppUserModelID(L"Pencil2D.Pencil2D.Release");
37#elif defined(PENCIL2D_NIGHTLY_BUILD)
38 SetCurrentProcessExplicitAppUserModelID(L"Pencil2D.Pencil2D.Nightly");
39#else
40 SetCurrentProcessExplicitAppUserModelID(L"Pencil2D.Pencil2D");
41#endif
42#endif // _WIN32_WINNT >= _WIN32_WINNT_WIN7
43
44#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
45 // Temporary solution for high DPI displays
46 // EnableHighDpiScaling is a just in case mechanism in the event that we
47 // want to disable this without recompiling, see #922
48 QSettings settings(PENCIL2D, PENCIL2D);
49 if (settings.value("EnableHighDpiScaling", "true").toBool())
50 {
51 // Enable auto screen scaling on high dpi display, for example, a 4k monitor
52 // This attr has to be set before the QApplication is constructed
53 // Only works on Windows & X11
54 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
55 }
56#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
57 };
58}
QCoreApplication::setAttribute
void setAttribute(Qt::ApplicationAttribute attribute, bool on)
QSettings
Qt::AA_EnableHighDpiScaling
AA_EnableHighDpiScaling
Generated on Thu May 8 2025 04:47:53 for Pencil2D by doxygen 1.9.6 based on revision 4513250b1d5b1a3676ec0e67b06b7a885ceaae39