mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 05:07:51 -06:00
NEW:added dark mode
Change-Id: I3f61f1d93020e0a9dfba2c7d6cf6bf5194effcfa
This commit is contained in:
parent
6ae575d885
commit
6f4e80bbb6
78 changed files with 2021 additions and 398 deletions
74
src/slic3r/GUI/dark_mode/UAHMenuBar.hpp
Normal file
74
src/slic3r/GUI/dark_mode/UAHMenuBar.hpp
Normal file
|
@ -0,0 +1,74 @@
|
|||
#pragma once
|
||||
|
||||
// MIT license, see LICENSE
|
||||
// Copyright(c) 2021 adzm / Adam D. Walling
|
||||
|
||||
// processes messages related to UAH / custom menubar drawing.
|
||||
// return true if handled, false to continue with normal processing in your wndproc
|
||||
bool UAHDarkModeWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* lr);
|
||||
|
||||
// window messages related to menu bar drawing
|
||||
#define WM_UAHDESTROYWINDOW 0x0090 // handled by DefWindowProc
|
||||
#define WM_UAHDRAWMENU 0x0091 // lParam is UAHMENU
|
||||
#define WM_UAHDRAWMENUITEM 0x0092 // lParam is UAHDRAWMENUITEM
|
||||
#define WM_UAHINITMENU 0x0093 // handled by DefWindowProc
|
||||
#define WM_UAHMEASUREMENUITEM 0x0094 // lParam is UAHMEASUREMENUITEM
|
||||
#define WM_UAHNCPAINTMENUPOPUP 0x0095 // handled by DefWindowProc
|
||||
|
||||
// describes the sizes of the menu bar or menu item
|
||||
typedef union tagUAHMENUITEMMETRICS
|
||||
{
|
||||
// cx appears to be 14 / 0xE less than rcItem's width!
|
||||
// cy 0x14 seems stable, i wonder if it is 4 less than rcItem's height which is always 24 atm
|
||||
struct {
|
||||
DWORD cx;
|
||||
DWORD cy;
|
||||
} rgsizeBar[2];
|
||||
struct {
|
||||
DWORD cx;
|
||||
DWORD cy;
|
||||
} rgsizePopup[4];
|
||||
} UAHMENUITEMMETRICS;
|
||||
|
||||
// not really used in our case but part of the other structures
|
||||
typedef struct tagUAHMENUPOPUPMETRICS
|
||||
{
|
||||
DWORD rgcx[4];
|
||||
DWORD fUpdateMaxWidths : 2; // from kernel symbols, padded to full dword
|
||||
} UAHMENUPOPUPMETRICS;
|
||||
|
||||
// hmenu is the main window menu; hdc is the context to draw in
|
||||
typedef struct tagUAHMENU
|
||||
{
|
||||
HMENU hmenu;
|
||||
HDC hdc;
|
||||
DWORD dwFlags; // no idea what these mean, in my testing it's either 0x00000a00 or sometimes 0x00000a10
|
||||
} UAHMENU;
|
||||
|
||||
// menu items are always referred to by iPosition here
|
||||
typedef struct tagUAHMENUITEM
|
||||
{
|
||||
int iPosition; // 0-based position of menu item in menubar
|
||||
UAHMENUITEMMETRICS umim;
|
||||
UAHMENUPOPUPMETRICS umpm;
|
||||
} UAHMENUITEM;
|
||||
|
||||
// the DRAWITEMSTRUCT contains the states of the menu items, as well as
|
||||
// the position index of the item in the menu, which is duplicated in
|
||||
// the UAHMENUITEM's iPosition as well
|
||||
typedef struct UAHDRAWMENUITEM
|
||||
{
|
||||
DRAWITEMSTRUCT dis; // itemID looks uninitialized
|
||||
UAHMENU um;
|
||||
UAHMENUITEM umi;
|
||||
} UAHDRAWMENUITEM;
|
||||
|
||||
// the MEASUREITEMSTRUCT is intended to be filled with the size of the item
|
||||
// height appears to be ignored, but width can be modified
|
||||
typedef struct tagUAHMEASUREMENUITEM
|
||||
{
|
||||
MEASUREITEMSTRUCT mis;
|
||||
UAHMENU um;
|
||||
UAHMENUITEM umi;
|
||||
} UAHMEASUREMENUITEM;
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue