Skip to content

Commit

Permalink
Correct playlist tabs and tab stack dark mode child background colour
Browse files Browse the repository at this point in the history
This corrects the background colour of the playlist tabs and tab stack container in dark mode.

This ensure a child panel with a transparent background has the correct background colour.
  • Loading branch information
reupen committed Feb 18, 2022
1 parent f0415da commit 2c169a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion foo_ui_columns/playlist_tabs_wndproc.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "stdafx.h"

#include "common.h"
#include "dark_mode.h"
#include "playlist_tabs.h"
#include "playlist_manager_utils.h"

Expand Down Expand Up @@ -52,7 +53,9 @@ LRESULT PlaylistTabs::on_message(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
static_api_ptr_t<playlist_manager>()->register_callback(this, flag_all);
break;
}

case WM_ERASEBKGND:
dark::draw_layout_background(wnd, reinterpret_cast<HDC>(wp));
return TRUE;
case WM_SHOWWINDOW: {
if (wp == TRUE && lp == NULL && !IsWindowVisible(m_child_wnd)) {
ShowWindow(m_child_wnd, SW_SHOWNORMAL);
Expand Down
4 changes: 4 additions & 0 deletions foo_ui_columns/splitter_tabs.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "splitter_tabs.h"

#include "dark_mode.h"
#include "dark_mode_tabs.h"

namespace cui::panels::tab_stack {
Expand Down Expand Up @@ -511,6 +512,9 @@ LRESULT TabStackPanel::on_message(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
m_dark_mode_notifier = std::make_unique<colours::dark_mode_notifier>(
[wnd_tabs = m_wnd_tabs] { RedrawWindow(wnd_tabs, nullptr, nullptr, RDW_ERASE | RDW_INVALIDATE); });
} break;
case WM_ERASEBKGND:
dark::draw_layout_background(wnd, reinterpret_cast<HDC>(wp));
return TRUE;
case WM_KEYDOWN: {
if (wp != VK_LEFT && wp != VK_RIGHT && get_host()->get_keyboard_shortcuts_enabled()
&& g_process_keydown_keyboard_shortcuts(wp))
Expand Down

0 comments on commit 2c169a6

Please sign in to comment.