Skip to content

Commit 6f15ec5

Browse files
committed
Disable generic dark mode, update npp headers, update toolbar icon struct
1 parent 410f478 commit 6f15ec5

File tree

10 files changed

+1083
-740
lines changed

10 files changed

+1083
-740
lines changed

DlgConsole.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,7 @@ void SnippetsConsole()
15391539
tbd.pszModuleName = L"Snippets"; // name of the dll this dialog belongs to
15401540
tbd.pszName = L"Snippets"; // Name for titlebar
15411541
tbd.hClient = s_hDlg; // HWND Handle of window this dock belongs to
1542-
tbd.uMask = DWS_DF_CONT_RIGHT | DWS_ICONTAB; // Put it on the right
1542+
tbd.uMask = DWS_DF_CONT_RIGHT | DWS_ICONTAB | DWS_USEOWNDARKMODE; // Put it on the right
15431543
tbd.hIconTab = s_hTabIcon; // Put the icon in
15441544
SendMessage(g_nppData._nppHandle, NPPM_DMMREGASDCKDLG, 0, (LPARAM) &tbd); // Register it
15451545

NPP/Docking.h

Lines changed: 27 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
1-
// this file is part of Notepad++
2-
// Copyright (C)2005 Jens Lorenz <[email protected]>
3-
//
4-
// This program is free software; you can redistribute it and/or
5-
// modify it under the terms of the GNU General Public License
6-
// as published by the Free Software Foundation; either
7-
// version 2 of the License, or (at your option) any later version.
8-
//
9-
// // Note that the GPL places important restrictions on "derived works", yet
10-
// it does not provide a detailed definition of that term. To avoid
11-
// misunderstandings, we consider an application to constitute a
12-
// "derivative work" for the purpose of this license if it does any of the
13-
// following:
14-
// 1. Integrates source code from Notepad++.
15-
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
16-
// installer, such as those produced by InstallShield.
17-
// 3. Links to a library or executes a program that does any of the above.
18-
//
1+
// This file is part of Notepad++ project
2+
// Copyright (C)2021 Don HO <[email protected]>
3+
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// at your option any later version.
8+
//
199
// This program is distributed in the hope that it will be useful,
2010
// but WITHOUT ANY WARRANTY; without even the implied warranty of
21-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2212
// GNU General Public License for more details.
23-
//
13+
//
2414
// You should have received a copy of the GNU General Public License
25-
// along with this program; if not, write to the Free Software
26-
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
2716

2817

2918
#pragma once
@@ -47,6 +36,7 @@
4736
#define DWS_ICONTAB 0x00000001 // Icon for tabs are available
4837
#define DWS_ICONBAR 0x00000002 // Icon for icon bar are available (currently not supported)
4938
#define DWS_ADDINFO 0x00000004 // Additional information are in use
39+
#define DWS_USEOWNDARKMODE 0x00000008 // Use plugin's own dark mode
5040
#define DWS_PARAMSALL (DWS_ICONTAB|DWS_ICONBAR|DWS_ADDINFO)
5141

5242
// default docking values for first call of plugin
@@ -57,27 +47,27 @@
5747
#define DWS_DF_FLOATING 0x80000000 // default state is floating
5848

5949

60-
typedef struct {
61-
HWND hClient; // client Window Handle
62-
const TCHAR *pszName; // name of plugin (shown in window)
63-
int dlgID; // a funcItem provides the function pointer to start a dialog. Please parse here these ID
50+
struct tTbData {
51+
HWND hClient = nullptr; // client Window Handle
52+
const TCHAR* pszName = nullptr; // name of plugin (shown in window)
53+
int dlgID = 0; // a funcItem provides the function pointer to start a dialog. Please parse here these ID
6454

6555
// user modifications
66-
UINT uMask; // mask params: look to above defines
67-
HICON hIconTab; // icon for tabs
68-
const TCHAR *pszAddInfo; // for plugin to display additional informations
56+
UINT uMask = 0; // mask params: look to above defines
57+
HICON hIconTab = nullptr; // icon for tabs
58+
const TCHAR* pszAddInfo = nullptr; // for plugin to display additional informations
6959

7060
// internal data, do not use !!!
71-
RECT rcFloat; // floating position
72-
int iPrevCont; // stores the privious container (toggling between float and dock)
73-
const TCHAR* pszModuleName; // it's the plugin file name. It's used to identify the plugin
74-
} tTbData;
61+
RECT rcFloat = {}; // floating position
62+
int iPrevCont = 0; // stores the privious container (toggling between float and dock)
63+
const TCHAR* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin
64+
};
7565

7666

77-
typedef struct {
78-
HWND hWnd; // the docking manager wnd
79-
RECT rcRegion[DOCKCONT_MAX]; // position of docked dialogs
80-
} tDockMgr;
67+
struct tDockMgr {
68+
HWND hWnd = nullptr; // the docking manager wnd
69+
RECT rcRegion[DOCKCONT_MAX] = {{}}; // position of docked dialogs
70+
};
8171

8272

8373
#define HIT_TEST_THICKNESS 20

0 commit comments

Comments
 (0)