-
Notifications
You must be signed in to change notification settings - Fork 178
Dark Modeへの対応 #2135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
beru
wants to merge
1
commit into
sakura-editor:master
Choose a base branch
from
beru:use_darkmodelib
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Dark Modeへの対応 #2135
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このスレではDarkMode対応を行うにあたって壁に突き当たった点を記載します。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
タイプ別設定のキーワードヘルプの辞書ファイル一覧のリストビューの背景色が明色になっていてDarkModeらしくない。
「キーワードヘルプ機能を使う」のチェックを入れてリストビューのウィンドウを有効化すると背景色が暗色になってDarkModeらしくなる。
この挙動は Win32DarkmodelibGUIDemo でも同様で、リストビューのウィンドウが無効化されている場合に
ListView_SetBkColorで設定した色 (link) が使われない。この問題を解決するにはオーナードローを行うしか無さそう。
notepad-plus-plus/notepad-plus-plus#13933 でも同様の問題が報告されている。
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
93b9bdf で
CMenuDrawer::DrawItemを更新してメニューアイテムがDarkModeっぽく描画されるようにしてみたけれど、メニューの外枠の枠線の色がDarkModeっぽくない。この問題はWinMergeでも起きている。
https://learn.microsoft.com/en-us/answers/questions/649537/how-to-change-color-or-remove-pop-menu-border-in-m のCastorix31さんのコメントによるとメニューのウィンドウが
WS_EX_DLGMODALFRAME拡張スタイル付きなのが原因なようでSetWindowLongとGWL_EXSTYLEを使ってその拡張スタイルを削れば枠線を消せるらしい。WM_INITMENUPOPUPでそれを行うと書かれているが実際にはWM_INITMENUPOPUPメッセージ処理時点ではまだウィンドウが作成されていない場合にはFindWindowをしても取れない。HWNDを取るのにタイマーやフックを使う事が出来るようだが、ここまでするならメニューを自前のウィンドウで描画しても良いのでは?という気がしてくる。。There was a problem hiding this comment.
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 のコードが参考になりそう。
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
メニュー項目のオーナードロー(link)を行わないようにしたらメニューの枠線がちゃんとDark Modeっぽく表示される事に気づきました。
メニューのアイコン描画をオーナードローで自前で行うのではなくて標準の方法で行うように変える必要があります。
There was a problem hiding this comment.
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) だとメニューの枠の色が以前と比べて良くなってました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
共通設定のタブバーのプロパティシートで「タブバーを表示する」のチェックが付いていないと色々なコントロールが無効化状態に設定されますが、プロパティシートを切り替えて表示する際にラベルの表示が変になります。
プロパティシートが表示された後に「タブバーを表示する」のチェックを付けて外すと表示は問題無いです。
Dark Mode対応の為に
CPropCommon::DlgProcのcase WM_INITDIALOGでDarkMode::setDarkWndSafeを呼び出す事でサブクラス化されてWM_CTLCOLORSTATICメッセージが処理されてDarkMode::onCtlColorDlgStaticTextの戻り値でブラシを返して背景色を変えてますが、これが関係しているようです。OS側(user32.dll)の実装の不具合なのかわかりませんがタイミングによってはきちんと思ったように処理されないようです。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#2135 (comment)
Disabledなコントロールが白飛びする件は TortoiseGit などでも発生するよくある事象なので、アプリ開発側では「対応せず放置」でいい気がします。
