Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build-on-msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: true

- name: Set up MSYS2
uses: msys2/setup-msys2@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-sakura.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
## see https://github.com/actions/checkout
- uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true

## see https://github.com/microsoft/setup-msbuild
- name: Add msbuild to PATH
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonarscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/checkout@v5
with:
ref: '${{ github.event.pull_request.head.sha }}'
fetch-depth: 0
submodules: true

- name: Setup environment variables
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "tests/googletest"]
path = tests/googletest
url = https://github.com/google/googletest.git
[submodule "externals/darkmodelib"]
path = externals/darkmodelib
url = https://github.com/ozone10/darkmodelib.git
Binary file modified resource/mytool.bmp
Binary file not shown.
12 changes: 11 additions & 1 deletion sakura/sakura.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</PropertyGroup>
<ItemDefinitionGroup Label="sakura.common">
<ClCompile>
<AdditionalIncludeDirectories>..\sakura_core;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\sakura_core;..\externals\darkmodelib\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32_WINNT=_WIN32_WINNT_WIN10;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
Expand Down Expand Up @@ -500,6 +500,16 @@
<ResourceCompile Include="..\sakura_core\sakura_rc.rc" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\externals\darkmodelib\src\DarkModeSubclass.cpp" />
<ClCompile Include="..\externals\darkmodelib\src\DmlibColor.cpp" />
<ClCompile Include="..\externals\darkmodelib\src\DmlibDpi.cpp" />
<ClCompile Include="..\externals\darkmodelib\src\DmlibHook.cpp" />
<ClCompile Include="..\externals\darkmodelib\src\DmlibIni.cpp" />
<ClCompile Include="..\externals\darkmodelib\src\DmlibPaintHelper.cpp" />
<ClCompile Include="..\externals\darkmodelib\src\DmlibSubclass.cpp" />
<ClCompile Include="..\externals\darkmodelib\src\DmlibSubclassControl.cpp" />
<ClCompile Include="..\externals\darkmodelib\src\DmlibSubclassWindow.cpp" />
<ClCompile Include="..\externals\darkmodelib\src\DmlibWinApi.cpp" />
<ClCompile Include="..\sakura_core\apiwrap\StdApi.cpp" />
<ClCompile Include="..\sakura_core\apiwrap\StdControl.cpp" />
<ClCompile Include="..\sakura_core\basis\CErrorInfo.cpp" />
Expand Down
33 changes: 33 additions & 0 deletions sakura/sakura.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@
<Filter Include="Cpp Source Files\uiparts">
<UniqueIdentifier>{930f3f82-ab3f-49e3-af4a-d4f9c2d51f46}</UniqueIdentifier>
</Filter>
<Filter Include="Cpp Source Files\darkmodelib">
<UniqueIdentifier>{57c87b7d-0c3b-4adb-9840-ce2292af594e}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\sakura_core\Funccode_define.h">
Expand Down Expand Up @@ -2309,6 +2312,36 @@
<ClCompile Include="..\sakura_core\parse\DetectIndentationStyle.cpp">
<Filter>Cpp Source Files\parse</Filter>
</ClCompile>
<ClCompile Include="..\externals\darkmodelib\src\DarkModeSubclass.cpp">
<Filter>Cpp Source Files\darkmodelib</Filter>
</ClCompile>
<ClCompile Include="..\externals\darkmodelib\src\DmlibColor.cpp">
<Filter>Cpp Source Files\darkmodelib</Filter>
</ClCompile>
<ClCompile Include="..\externals\darkmodelib\src\DmlibDpi.cpp">
<Filter>Cpp Source Files\darkmodelib</Filter>
</ClCompile>
<ClCompile Include="..\externals\darkmodelib\src\DmlibHook.cpp">
<Filter>Cpp Source Files\darkmodelib</Filter>
</ClCompile>
<ClCompile Include="..\externals\darkmodelib\src\DmlibIni.cpp">
<Filter>Cpp Source Files\darkmodelib</Filter>
</ClCompile>
<ClCompile Include="..\externals\darkmodelib\src\DmlibPaintHelper.cpp">
<Filter>Cpp Source Files\darkmodelib</Filter>
</ClCompile>
<ClCompile Include="..\externals\darkmodelib\src\DmlibSubclass.cpp">
<Filter>Cpp Source Files\darkmodelib</Filter>
</ClCompile>
<ClCompile Include="..\externals\darkmodelib\src\DmlibSubclassControl.cpp">
<Filter>Cpp Source Files\darkmodelib</Filter>
</ClCompile>
<ClCompile Include="..\externals\darkmodelib\src\DmlibSubclassWindow.cpp">
<Filter>Cpp Source Files\darkmodelib</Filter>
</ClCompile>
<ClCompile Include="..\externals\darkmodelib\src\DmlibWinApi.cpp">
<Filter>Cpp Source Files\darkmodelib</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="..\resource\auto_scroll_center.bmp">
Expand Down
1 change: 1 addition & 0 deletions sakura_core/CPropertyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "apiwrap/StdApi.h"
#include <memory>
#include "config/system_constants.h"
#include "DarkModeSubclass.h"

void CPropertyManager::Create( HWND hwndOwner, CImageListMgr* pImageList, CMenuDrawer* pMenuDrawer )
{
Expand Down
23 changes: 0 additions & 23 deletions sakura_core/_main/CControlTray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,30 +390,7 @@ LRESULT CControlTray::DispatchEvent(
case WM_MENUCHAR:
/* メニューアクセスキー押下時の処理(WM_MENUCHAR処理) */
return m_cMenuDrawer.OnMenuChar( hwnd, uMsg, wParam, lParam );
case WM_DRAWITEM:
lpdis = (DRAWITEMSTRUCT*) lParam; /* 項目描画情報 */
switch( lpdis->CtlType ){
case ODT_MENU: /* オーナー描画メニュー */
/* メニューアイテム描画 */
m_cMenuDrawer.DrawItem( lpdis );
return TRUE;
}
return FALSE;
case WM_MEASUREITEM:
lpmis = (MEASUREITEMSTRUCT*) lParam; // item-size information
switch( lpmis->CtlType ){
case ODT_MENU: /* オーナー描画メニュー */
/* メニューアイテムの描画サイズを計算 */
nItemWidth = m_cMenuDrawer.MeasureItem( lpmis->itemID, &nItemHeight );
if( 0 < nItemWidth ){
lpmis->itemWidth = nItemWidth;
lpmis->itemHeight = nItemHeight;
}
return TRUE;
}
return FALSE;
case WM_EXITMENULOOP:
m_cMenuDrawer.EndDrawMenu();
break;

/* タスクトレイ左クリックメニューへのショートカットキー登録 */
Expand Down
8 changes: 8 additions & 0 deletions sakura_core/_main/WinMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "version.h"
#include "util/std_macro.h"
#include "env/DLLSHAREDATA.h"
#include "DarkModeSubclass.h"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このスレではDarkMode対応を行うにあたって壁に突き当たった点を記載します。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

タイプ別設定のキーワードヘルプの辞書ファイル一覧のリストビューの背景色が明色になっていてDarkModeらしくない。

image

「キーワードヘルプ機能を使う」のチェックを入れてリストビューのウィンドウを有効化すると背景色が暗色になってDarkModeらしくなる。

image

この挙動は Win32DarkmodelibGUIDemo でも同様で、リストビューのウィンドウが無効化されている場合に ListView_SetBkColor で設定した色 (link) が使われない。

この問題を解決するにはオーナードローを行うしか無さそう。

notepad-plus-plus/notepad-plus-plus#13933 でも同様の問題が報告されている。

Copy link
Contributor Author

@beru beru Aug 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

93b9bdfCMenuDrawer::DrawItem を更新してメニューアイテムがDarkModeっぽく描画されるようにしてみたけれど、メニューの外枠の枠線の色がDarkModeっぽくない。

image

この問題はWinMergeでも起きている。

image

https://learn.microsoft.com/en-us/answers/questions/649537/how-to-change-color-or-remove-pop-menu-border-in-m のCastorix31さんのコメントによるとメニューのウィンドウが WS_EX_DLGMODALFRAME 拡張スタイル付きなのが原因なようで SetWindowLongGWL_EXSTYLE を使ってその拡張スタイルを削れば枠線を消せるらしい。WM_INITMENUPOPUP でそれを行うと書かれているが実際には WM_INITMENUPOPUP メッセージ処理時点ではまだウィンドウが作成されていない場合には FindWindow をしても取れない。HWNDを取るのにタイマーやフックを使う事が出来るようだが、ここまでするならメニューを自前のウィンドウで描画しても良いのでは?という気がしてくる。。

HWND hWndPopupMenu = FindWindow(TEXT("#32768"), NULL);
auto exStyle = ::GetWindowLongPtr(hWndPopupMenu, GWL_EXSTYLE);
::SetWindowLongPtr(hWndPopupMenu, GWL_EXSTYLE, exStyle & ~WS_EX_DLGMODALFRAME);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://fenix-pc.blog.jp/archives/27561302.html のコードが参考になりそう。

Copy link
Contributor Author

@beru beru Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

メニュー項目のオーナードロー(link)を行わないようにしたらメニューの枠線がちゃんとDark Modeっぽく表示される事に気づきました。

image

メニューのアイコン描画をオーナードローで自前で行うのではなくて標準の方法で行うように変える必要があります。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WinMergeの新しい版 (Version 2.16.50.5 + jp-5 X64) だとメニューの枠の色が以前と比べて良くなってました。

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

共通設定のタブバーのプロパティシートで「タブバーを表示する」のチェックが付いていないと色々なコントロールが無効化状態に設定されますが、プロパティシートを切り替えて表示する際にラベルの表示が変になります。

image

プロパティシートが表示された後に「タブバーを表示する」のチェックを付けて外すと表示は問題無いです。

image image

Dark Mode対応の為に CPropCommon::DlgProccase WM_INITDIALOGDarkMode::setDarkWndSafe を呼び出す事でサブクラス化されて WM_CTLCOLORSTATIC メッセージが処理されて DarkMode::onCtlColorDlgStaticText の戻り値でブラシを返して背景色を変えてますが、これが関係しているようです。OS側(user32.dll)の実装の不具合なのかわかりませんがタイミングによってはきちんと思ったように処理されないようです。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2135 (comment)

タイプ別設定のキーワードヘルプの辞書ファイル一覧のリストビューの背景色が明色になっていてDarkModeらしくない。

Disabledなコントロールが白飛びする件は TortoiseGit などでも発生するよくある事象なので、アプリ開発側では「対応せず放置」でいい気がします。
image


/*!
Windows Entry point
Expand Down Expand Up @@ -71,6 +72,13 @@ int WINAPI wWinMain(
DEBUG_TRACE(L"-- -- WinMain -- --\n");
DEBUG_TRACE(L"sizeof(DLLSHAREDATA) = %d\n",sizeof(DLLSHAREDATA));

#if 1
DarkMode::initDarkMode();
//DarkMode::setDarkModeConfigEx(static_cast<UINT>(DarkMode::DarkModeType::classic));
DarkMode::setDarkModeConfigEx(static_cast<UINT>(DarkMode::DarkModeType::dark));
DarkMode::setDefaultColors(true);
#endif

//コマンドラインクラスのインスタンスを確保する
CCommandLine cCommandLine;

Expand Down
7 changes: 7 additions & 0 deletions sakura_core/apiwrap/CommonControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ namespace ApiWrap
inline DWORD Toolbar_SetExtendedStyle(HWND hwndCtl, DWORD styles) { return (DWORD)::SendMessage(hwndCtl, TB_SETEXTENDEDSTYLE, 0L, (LPARAM)styles); }
inline int Toolbar_GetState(HWND hwndCtl, int index) { return (int)::SendMessage(hwndCtl, TB_GETSTATE, (WPARAM)index, 0L); }
inline BOOL Toolbar_SetState(HWND hwndCtl, int index, WORD state) { return (BOOL)::SendMessage(hwndCtl, TB_SETSTATE, (WPARAM)index, state); }
inline HIMAGELIST Toolbar_SetImageList(HWND hwndCtl, int index, HIMAGELIST hImageList) { return (HIMAGELIST)::SendMessage(hwndCtl, TB_SETIMAGELIST, (WPARAM)index, (LPARAM)hImageList); }
inline HIMAGELIST Toolbar_SetDisabledImageList(HWND hwndCtl, int index, HIMAGELIST hImageList) { return (HIMAGELIST)::SendMessage(hwndCtl, TB_SETDISABLEDIMAGELIST, (WPARAM)index, (LPARAM)hImageList); }
inline int Toolbar_LoadImages(HWND hwndCtl, int id) { return (int)::SendMessage(hwndCtl, TB_LOADIMAGES, (WPARAM)id, (LPARAM)HINST_COMMCTRL); }
inline void Toolbar_AutoSize(HWND hwndCtl) { ::SendMessage(hwndCtl, TB_AUTOSIZE, 0, 0); }
inline BOOL Toolbar_SetBitmapSize(HWND hwndCtl, int width, int height) {
return (BOOL)::SendMessage(hwndCtl, TB_SETBITMAPSIZE, 0, MAKELPARAM(width, height));
}

// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- //
// Tooltip コントロール //
Expand Down
4 changes: 3 additions & 1 deletion sakura_core/cmd/CViewCommander_Outline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "plugin/COutlineIfObj.h"
#include "apiwrap/StdApi.h"
#include "sakura_rc.h"
#include "DarkModeSubclass.h"

/*! アウトライン解析

Expand Down Expand Up @@ -167,7 +168,7 @@ BOOL CViewCommander::Command_FUNCLIST(
/* アウトライン ダイアログの表示 */
CLayoutPoint poCaret = GetCaret().GetCaretLayoutPos();
if( nullptr == GetEditWindow()->m_cDlgFuncList.GetHwnd() ){
GetEditWindow()->m_cDlgFuncList.DoModeless(
HWND hWnd = GetEditWindow()->m_cDlgFuncList.DoModeless(
G_AppInstance(),
m_pCommanderView->GetHwnd(),
(LPARAM)m_pCommanderView,
Expand All @@ -178,6 +179,7 @@ BOOL CViewCommander::Command_FUNCLIST(
nListType,
m_pCommanderView->m_pTypeData->m_bLineNumIsCRLF /* 行番号の表示 false=折り返し単位/true=改行単位 */
);
DarkMode::setDarkWndSafe(hWnd);
}else{
/* アクティブにする */
GetEditWindow()->m_cDlgFuncList.Redraw( nOutlineType, nListType, &cFuncInfoArr, poCaret.GetY2() + 1, poCaret.GetX2() + 1 );
Expand Down
5 changes: 5 additions & 0 deletions sakura_core/cmd/CViewCommander_Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <array>
#include "config/system_constants.h"
#include "config/app_constants.h"
#include "DarkModeSubclass.h"

/*! ツールバーの表示/非表示

Expand Down Expand Up @@ -67,6 +68,10 @@ void CViewCommander::Command_SHOWFUNCKEY( void )
pCEditWnd->LayoutFuncKey();
pCEditWnd->EndLayoutBars();

auto hWnd = pCEditWnd->GetHwnd();
DarkMode::setChildCtrlsTheme(hWnd);
DarkMode::setWindowMenuBarSubclass(hWnd);

//全ウインドウに変更を通知する。
CAppNodeGroupHandle(0).PostMessageToAllEditors(
MYWM_BAR_CHANGE_NOTIFY,
Expand Down
9 changes: 9 additions & 0 deletions sakura_core/dlg/CDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "util/window.h"
#include "apiwrap/StdApi.h"
#include "apiwrap/StdControl.h"
#include "DarkModeSubclass.h"

/* ダイアログプロシージャ */
INT_PTR CALLBACK MyDialogProc(
Expand Down Expand Up @@ -187,6 +188,14 @@ BOOL CDialog::OnInitDialog( HWND hwndDlg, WPARAM wParam, LPARAM lParam )

m_hFontDialog = UpdateDialogFont( hwndDlg );

// --- Dark Mode ---
auto hWnd = m_hWnd;
DarkMode::setColorizeTitleBarConfig(true);
DarkMode::setDarkWndNotifySafeEx(hWnd, true, true);
DarkMode::setWindowEraseBgSubclass(hWnd);
DarkMode::setWindowMenuBarSubclass(hWnd);
DarkMode::setWindowExStyle(hWnd, false, WS_EX_COMPOSITED);

/* ダイアログデータの設定 */
SetData();

Expand Down
30 changes: 14 additions & 16 deletions sakura_core/outline/CDlgFuncList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include "config/system_constants.h"
#include "config/app_constants.h"
#include "String_define.h"
#include "DarkModeSubclass.h"

// 画面ドッキング用の定義 // 2010.06.05 ryoji
#define DEFINE_SYNCCOLOR
Expand Down Expand Up @@ -3114,33 +3115,30 @@ INT_PTR CDlgFuncList::OnNcPaint( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
default:
break;
}
::MyFillRect( gr, rcWk, COLOR_3DFACE );
//::MyFillRect( gr, rcWk, COLOR_3DFACE );
::MyFillRect(gr, rcWk, DarkMode::getBackgroundColor());
::DrawEdge( gr, &rcWk, EDGE_ETCHED, BF_TOPLEFT );

// タイトルを描画する
BOOL bThemeActive = ::IsThemeActive();
BOOL bGradient = FALSE;
::SystemParametersInfo( SPI_GETGRADIENTCAPTIONS, 0, &bGradient, 0 );
if( !bThemeActive ) bGradient = FALSE; // 適当に調整
HWND hwndFocus = ::GetFocus();
BOOL bActive = (GetHwnd() == hwndFocus || ::IsChild(GetHwnd(), hwndFocus));
RECT rcCaption;
GetCaptionRect( &rcCaption );
::OffsetRect( &rcCaption, -rcScr.left, -rcScr.top );
rcWk = rcCaption;
rcWk.top += 1;
rcWk.right -= DOCK_BUTTON_NUM * (::GetSystemMetrics( SM_CXSMSIZE ));
// ↓DrawCaption() に DC_SMALLCAP を指定してはいけないっぽい
// ↓DC_SMALLCAP 指定のものを Win7(64bit版) で動かしてみたら描画位置が下にずれて上半分しか見えなかった(x86ビルド/x64ビルドのどちらも NG)
::DrawCaption( hwnd, gr, &rcWk, DC_TEXT | (bGradient? DC_GRADIENT: 0) /*| DC_SMALLCAP*/ | (bActive? DC_ACTIVE: 0) );
rcWk.left = rcCaption.right;
int nClrCaption;
if( bGradient )
nClrCaption = ( bActive? COLOR_GRADIENTACTIVECAPTION: COLOR_GRADIENTINACTIVECAPTION );
else
nClrCaption = ( bActive? COLOR_ACTIVECAPTION: COLOR_INACTIVECAPTION );
::MyFillRect( gr, rcWk, nClrCaption );
gr.SetTextForeColor(DarkMode::getTextColor());
gr.SetTextBackColor(DarkMode::getBackgroundColor());
//::DrawCaption( hwnd, gr, &rcWk, DC_TEXT /*| DC_SMALLCAP*/ | (bActive? DC_ACTIVE: 0) );
wchar_t buff[256];
::GetWindowText(GetHwnd(), buff, 256);
//COLORREF clrCaption = ::GetSysColor( bActive? COLOR_ACTIVECAPTION: COLOR_INACTIVECAPTION );
COLORREF clrCaption = bActive ? DarkMode::getHotBackgroundColor() : DarkMode::getBackgroundColor();
::MyFillRect( gr, rcWk, clrCaption );
::DrawEdge( gr, &rcCaption, BDR_SUNKENOUTER, BF_TOP );
::DrawText(gr, buff, -1, &rcCaption, DT_TOP|DT_LEFT);

// タイトル上のボタンを描画する
NONCLIENTMETRICS ncm;
Expand Down Expand Up @@ -3170,8 +3168,8 @@ INT_PTR CDlgFuncList::OnNcPaint( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
int nClrCaptionText;
// マウスカーソルがボタン上にあればハイライト
if( ::PtInRect( &rcBtn, pt ) ){
::MyFillRect( gr, rcBtn, (bGradient && !bActive)? COLOR_INACTIVECAPTION: COLOR_ACTIVECAPTION );
nClrCaptionText = ( (bGradient && !bActive)? COLOR_INACTIVECAPTIONTEXT: COLOR_CAPTIONTEXT );
::MyFillRect( gr, rcBtn, COLOR_ACTIVECAPTION );
nClrCaptionText = COLOR_CAPTIONTEXT;
}else{
nClrCaptionText = ( bActive? COLOR_CAPTIONTEXT: COLOR_INACTIVECAPTIONTEXT );
}
Expand Down
10 changes: 7 additions & 3 deletions sakura_core/print/CPrintPreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "sakura_rc.h"
#include "config/system_constants.h"
#include "String_define.h"
#include "DarkModeSubclass.h"

#define MIN_PREVIEW_ZOOM 10
#define MAX_PREVIEW_ZOOM 400
Expand Down Expand Up @@ -1958,7 +1959,6 @@ void CPrintPreview::CreatePrintPreviewControls( void )
si.nPos = 0;
si.nTrackPos = 1;
::SetScrollInfo( m_hwndVScrollBar, SB_CTL, &si, TRUE );
::ShowScrollBar( m_hwndVScrollBar, SB_CTL, TRUE );

/* 横スクロールバーの作成 */
m_hwndHScrollBar = ::CreateWindowEx(
Expand All @@ -1983,7 +1983,6 @@ void CPrintPreview::CreatePrintPreviewControls( void )
si.nPos = 0;
si.nTrackPos = 1;
::SetScrollInfo( m_hwndHScrollBar, SB_CTL, &si, TRUE );
::ShowScrollBar( m_hwndHScrollBar, SB_CTL, TRUE );

/* サイズボックスの作成 */
m_hwndSizeBox = ::CreateWindowEx(
Expand All @@ -2000,7 +1999,12 @@ void CPrintPreview::CreatePrintPreviewControls( void )
CEditApp::getInstance()->GetAppInstance(), /* instance owning this window */
(LPVOID) nullptr /* pointer not needed */
);
::ShowWindow( m_hwndPrintPreviewBar, SW_SHOW );

DarkMode::setDarkWndSafe(m_hwndPrintPreviewBar);
DarkMode::setChildCtrlsTheme(m_pParentWnd->GetHwnd());
::ShowScrollBar(m_hwndVScrollBar, SB_CTL, TRUE);
::ShowScrollBar(m_hwndHScrollBar, SB_CTL, TRUE);
::ShowWindow(m_hwndPrintPreviewBar, SW_SHOW);

/* WM_SIZE 処理 */
RECT rc1;
Expand Down
2 changes: 1 addition & 1 deletion sakura_core/prop/CPropComGeneral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "String_define.h"
#include "recent/CRecentFile.h"
#include "recent/CRecentFolder.h"
#include "DarkModeSubclass.h"

//@@@ 2001.02.04 Start by MIK: Popup Help
TYPE_NAME_ID<int> SpecialScrollModeArr[] = {
Expand Down Expand Up @@ -123,7 +124,6 @@ INT_PTR CPropGeneral::DispatchEvent(
SetData( hwndDlg );
// Modified by KEITA for WIN64 2003.9.6
::SetWindowLongPtr( hwndDlg, DWLP_USER, lParam );

/* ユーザーがエディット コントロールに入力できるテキストの長さを制限する */

return TRUE;
Expand Down
Loading
Loading