Skip to content

Commit

Permalink
Implemented dark mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuerp committed Jun 26, 2023
1 parent 413ef46 commit 73a245a
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 21 deletions.
14 changes: 9 additions & 5 deletions Console.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

/** Console.cpp (2023.06.16) P. Stuer **/
/** Console.cpp (2023.06.26) P. Stuer **/

#include "pch.h"

#include <CppCoreCheck/Warnings.h>

#pragma warning(disable: 4710 4711 ALL_CPPCORECHECK_WARNINGS)
#pragma warning(disable: 4710 4711 4820 ALL_CPPCORECHECK_WARNINGS)

#include "Console.h"

Expand All @@ -26,13 +26,15 @@ void Console::Create(HWND hWnd, bool wordwrap, bool darkMode) noexcept

const DWORD Style = WS_CHILD | (wordwrap ? (DWORD) 0 : WS_HSCROLL) | WS_VSCROLL | ES_MULTILINE | ES_READONLY | ES_NOHIDESEL;

_hRichEdit = ::CreateWindowExW(0, MSFTEDIT_CLASS, L"", Style, cr.left, cr.top, cr.right - cr.left, cr.bottom - cr.top, hWnd, NULL, ::GetModuleHandleW(NULL), NULL);
const HMODULE hInstance = ::GetModuleHandleW(NULL);

_hRichEdit = ::CreateWindowExW(0, MSFTEDIT_CLASS, L"", Style, cr.left, cr.top, cr.right - cr.left, cr.bottom - cr.top, hWnd, NULL, hInstance, NULL);

if (_hRichEdit == 0)
_hRichEdit = ::CreateWindowExW(0, L"RichEdit20A", L"", Style, cr.left, cr.top, cr.right - cr.left, cr.bottom - cr.top, hWnd, NULL, ::GetModuleHandleW(NULL), NULL);
_hRichEdit = ::CreateWindowExW(0, L"RichEdit20A", L"", Style, cr.left, cr.top, cr.right - cr.left, cr.bottom - cr.top, hWnd, NULL, hInstance, NULL);

if (_hRichEdit == 0)
_hRichEdit = ::CreateWindowExW(0, L"RichEdit", L"", Style, cr.left, cr.top, cr.right - cr.left, cr.bottom - cr.top, hWnd, NULL, ::GetModuleHandleW(NULL), NULL);
_hRichEdit = ::CreateWindowExW(0, L"RichEdit", L"", Style, cr.left, cr.top, cr.right - cr.left, cr.bottom - cr.top, hWnd, NULL, hInstance, NULL);

if (_hRichEdit == 0)
return;
Expand All @@ -44,6 +46,8 @@ void Console::Create(HWND hWnd, bool wordwrap, bool darkMode) noexcept

::PostMessageW(hWnd, WM_COMMAND, MAKEWPARAM(lcp_ansi, itm_fontstyle), (LPARAM) _hRichEdit);

(void) ::SetWindowTheme(_hRichEdit, L"DarkMode_Explorer", nullptr);

_DarkMode = darkMode;
}

Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ branch. Pull requests are warmly welcome.

## Change Log

v0.3.0, 2023-xx-xx, *"Is it dark in here?"*
v0.3.0, 2023-06-26, *"Is it dark in here?"*

* Light and dark mode implemented. Still having problems with the scrollbar.
* Implemented light and dark mode.

v0.2.0, 2023-06-15, *"A small step"*

Expand All @@ -73,6 +73,8 @@ v0.1.0, 2023-06-14, *"Scratchin' the itch"*

## Reference Material

* Total Commander
* [SDK](https://github.com/ghisler?tab=repositories)
* Windows User Interface
* [Desktop App User Interface](https://learn.microsoft.com/en-us/windows/win32/windows-application-ui-development)
* [Windows User Experience Interaction Guidelines](https://learn.microsoft.com/en-us/windows/win32/uxguide/guidelines)
Expand All @@ -84,9 +86,9 @@ v0.1.0, 2023-06-14, *"Scratchin' the itch"*

## Links

* Home page: https://github.com/stuerp/aclview
* Repository: https://github.com/stuerp/aclview.git
* Issue tracker: https://github.com/stuerp/aclview/issues
* Home page: [https://github.com/stuerp/aclview](https://github.com/stuerp/aclview)
* Repository: [https://github.com/stuerp/aclview.git](https://github.com/stuerp/aclview.git)
* Issue tracker: [https://github.com/stuerp/aclview/issues](https://github.com/stuerp/aclview/issues)

## License

Expand Down
6 changes: 3 additions & 3 deletions Resources.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/** $VER: Resource.h (2023.06.14) **/
/** $VER: Resource.h (2023.06.26) **/

#pragma once

Expand All @@ -21,7 +21,7 @@
#define STR_COPYRIGHT TEXT("Copyright (c) 2023") STR_COMPANY_NAME TEXT(". All rights reserved.")

#define NUM_FILE_MAJOR 0
#define NUM_FILE_MINOR 2
#define NUM_FILE_MINOR 3
#define NUM_FILE_PATCH 0
#define NUM_FILE_PRERELEASE 0

Expand All @@ -30,7 +30,7 @@
#define STR_FILE_DESCRIPTION TEXT("Adds ACL viewing to Total Commander")

#define NUM_PRODUCT_MAJOR 0
#define NUM_PRODUCT_MINOR 2
#define NUM_PRODUCT_MINOR 3
#define NUM_PRODUCT_PATCH 0
#define NUM_PRODUCT_PRERELEASE 0

Expand Down
2 changes: 1 addition & 1 deletion ShowACL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <CppCoreCheck/Warnings.h>

#pragma warning(disable: 4710 4711 ALL_CPPCORECHECK_WARNINGS)
#pragma warning(disable: 4710 4711 4820 ALL_CPPCORECHECK_WARNINGS)

#include "Console.h"
#include "Support.h"
Expand Down
2 changes: 1 addition & 1 deletion ShowSID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <CppCoreCheck/Warnings.h>

#pragma warning(disable: 4710 ALL_CPPCORECHECK_WARNINGS)
#pragma warning(disable: 4710 4820 ALL_CPPCORECHECK_WARNINGS)

#include "Console.h"
#include "Support.h"
Expand Down
2 changes: 1 addition & 1 deletion ShowSecurityDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <CppCoreCheck/Warnings.h>

#pragma warning(disable: 4710 ALL_CPPCORECHECK_WARNINGS)
#pragma warning(disable: 4710 4820 ALL_CPPCORECHECK_WARNINGS)

#include "Console.h"
#include "Support.h"
Expand Down
4 changes: 2 additions & 2 deletions Support.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

/** Support.cpp (2023.06.14) P. Stuer **/
/** Support.cpp (2023.06.16) P. Stuer **/

#include "pch.h"

#include <CppCoreCheck/Warnings.h>

#pragma warning(disable: 4710 4711 ALL_CPPCORECHECK_WARNINGS)
#pragma warning(disable: 4710 4711 4820 ALL_CPPCORECHECK_WARNINGS)

#include "Console.h"
#include "Support.h"
Expand Down
6 changes: 3 additions & 3 deletions dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <CppCoreCheck/Warnings.h>

#pragma warning(disable: 4710 4711 5045 ALL_CPPCORECHECK_WARNINGS)
#pragma warning(disable: 4710 4711 4820 5045 ALL_CPPCORECHECK_WARNINGS)

#include "Resources.h"
#include "Control.h"
Expand Down Expand Up @@ -98,7 +98,7 @@ int __stdcall ListLoadNext(HWND hParentWnd, HWND hWnd, char * filePath, int show
/// <summary>
/// Called when a user switches to the next or previous file in lister with 'n' or 'p' keys, or goes to the next/previous file in the Quick View Panel, and when the definition string either doesn't exist, or its evaluation returns true.
/// </summary>
int __stdcall ListLoadNextW(HWND hParentWnd, HWND, WCHAR * filePath, int showFlags)
int __stdcall ListLoadNextW(HWND hParentWnd, HWND, WCHAR * filePath, int)
{
::SendMessageA(hParentWnd, WM_SETREDRAW, FALSE, 0);

Expand Down Expand Up @@ -189,7 +189,7 @@ int __stdcall ListSendCommand(HWND hWnd, int command, int parameter)
/// <summary>
/// Called when the user chooses the print function.
/// </summary>
int __stdcall ListPrint(HWND hWnd, char * filePath, char * printerName, int printerFlags, RECT * margins)
int __stdcall ListPrint(HWND, char *, char *, int, RECT *)
{
return LISTPLUGIN_ERROR;
}
Expand Down

0 comments on commit 73a245a

Please sign in to comment.