Skip to content

Commit

Permalink
add option to have the caption/border color follow the color of the a…
Browse files Browse the repository at this point in the history
…ctive tab
  • Loading branch information
stefankueng committed Feb 7, 2023
1 parent da28bb1 commit 582c7d0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3515,6 +3515,23 @@ void CMainWindow::HandleTabChange(const NMHDR& /*nmhdr*/)
SetFocus(m_editor);
m_editor.Scintilla().GrabFocus();
UpdateStatusBar(true);

if (IsWindows10OrGreater() && CIniSettings::Instance().GetInt64(L"View", L"CaptionColorFollowsTabColor", 0) != 0)
{
auto clr = GetColorForDocument(docID);
if (clr != 0 && !CTheme::Instance().IsHighContrastMode())
{
clr = CTheme::Instance().GetDarkColor(clr);
#ifdef DWMWA_COLOR_DEFAULT
# if NTDDI_VERSION >= 0x0A00000B
DwmSetWindowAttribute(*this, DWMWA_CAPTION_COLOR, &clr, sizeof(clr));
DwmSetWindowAttribute(*this, DWMWA_TEXT_COLOR, &clr, sizeof(clr));
DwmSetWindowAttribute(*this, DWMWA_BORDER_COLOR, &clr, sizeof(clr));
# endif
#endif
}
}

auto ds = m_docManager.HasFileChanged(docID);
if (ds == DocModifiedState::Modified)
{
Expand Down

0 comments on commit 582c7d0

Please sign in to comment.