Launcher improvements (#571)

* Make launcher window use dark mode

Co-Authored-By: fed <58637860+fedddddd@users.noreply.github.com>

* Launcher improvements

* Fixed Discord link
* Embedded custom font
* CSS improvements
* Optimization for images (file size reduction)

---------

Co-authored-by: fed <58637860+fedddddd@users.noreply.github.com>
This commit is contained in:
Vlad Loktionov 2023-04-10 20:07:52 +03:00 committed by GitHub
parent bf2d533ac5
commit 2aebc6437b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 32 deletions

View File

@ -3,6 +3,10 @@
#include <utils/nt.hpp>
#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE
#define DWMWA_USE_IMMERSIVE_DARK_MODE 20
#endif
std::mutex window::mutex_;
std::vector<window*> window::windows_;
@ -37,6 +41,10 @@ void window::create(const std::string& title, const int width, const int height,
this->handle_ = CreateWindowExA(NULL, this->wc_.lpszClassName, title.data(), flags, x, y, width, height, nullptr,
nullptr, this->wc_.hInstance, this);
BOOL value = TRUE;
DwmSetWindowAttribute(this->handle_,
DWMWA_USE_IMMERSIVE_DARK_MODE, &value, sizeof(value));
SendMessageA(this->handle_, WM_DPICHANGED, 0, 0);
}

View File

@ -1,4 +1,5 @@
#pragma once
#pragma comment (lib, "dwmapi.lib")
#define WM_KILL_WINDOW (WM_USER+0)

File diff suppressed because one or more lines are too long

View File

@ -49,6 +49,7 @@
#include <iphlpapi.h>
#include <wincrypt.h>
#include <shellscalingapi.h>
#include <dwmapi.h>
// min and max is required by gdi, therefore NOMINMAX won't work
#ifdef max