wxCollapsiblePane background color does not match parent's background (Issue #23274)

44 views
Skip to first unread message

pwiecz

unread,
Feb 19, 2023, 6:20:40 AM2/19/23
to wx-...@googlegroups.com, Subscribed

Description

On MSW, when you have a CollapsiblePane inside a Notebook page, the background color of the CollapsiblePane contrasts with the background color of the Notebook

image

Expected vs observed behaviour:
I would expect that the colors would match, or at least there would be an easy way to set the background colors to match, but I cannot do it.
I've found a similar problem described here: https://forums.wxwidgets.org/viewtopic.php?t=45014 , but no easy solution can be found there.

Patch or snippet allowing to reproduce the problem:

#include <wx/frame.h>
#include <wx/notebook.h>
#include <wx/collpane.h>

class MyApp : public wxApp
{
public:
    virtual bool OnInit() {
	wxFrame* frame = new wxFrame(nullptr, wxID_ANY, "Main");
	wxNotebook* notebook = new wxNotebook(frame, wxID_ANY);
	wxPanel* panel = new wxPanel(notebook, wxID_ANY);
	notebook->AddPage(panel, "Page", true);
	wxCollapsiblePane * pane = new wxCollapsiblePane(panel, wxID_ANY, "Collapsible pane");
	wxWindow *paneWindow = pane->GetPane();
    wxSizer *paneSizer = new wxBoxSizer(wxVERTICAL);
    paneSizer->Add(new wxStaticText(paneWindow, wxID_ANY, "Text inside pane"), 1, wxGROW|wxALL, 2);
    paneWindow->SetSizer(paneSizer);
    paneSizer->SetSizeHints(paneWindow);

	frame->Show(true);
	return true;
    }
};
wxIMPLEMENT_APP(MyApp);

To Reproduce:
Compare background color under the "Collapsible pane" text with the surrounding background color.

Platform and version information

  • wxWidgets version you use: current master (0c321cd) from GitHub (just after 3.2.2.1 release)
  • wxWidgets port you use: wxMSW
  • OS and its version: Windows 10


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23274@github.com>

VZ

unread,
Feb 19, 2023, 10:22:20 AM2/19/23
to wx-...@googlegroups.com, Subscribed

Do you intentionally use the classic theme? It's still supported, but it's really not supposed to be used without some awfully good reason. And I suspect your problem is specific to it and doesn't happen if you include a proper manifest.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23274/1436016464@github.com>

VZ

unread,
Feb 19, 2023, 12:14:15 PM2/19/23
to wx-...@googlegroups.com, Subscribed

Hmm, actually I take my words back, the problem can also be seen when using themes.

You still should use the manifest unless you have a good reason not to do it, but the bug must be fixed. I think it's a regression, but I'm not sure what could have broken (it's not WS_EX_COMPOSITING, for once).


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23274/1436041852@github.com>

pwiecz

unread,
Feb 19, 2023, 12:59:04 PM2/19/23
to wx-...@googlegroups.com, Subscribed

Thanks. :) In fact, the program for which I've noticed the issue is being build using MSVC. So the manifest is added automatically. Here I wanted to make a minimal reproducer of the issue, and I wasn't aware that lack of a manifest can make a difference.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23274/1436052572@github.com>

VZ

unread,
Feb 22, 2023, 7:35:10 PM2/22/23
to wx-...@googlegroups.com, Subscribed

Closed #23274 as completed via 6bdac08.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/23274/issue_event/8586631354@github.com>

VZ

unread,
Feb 22, 2023, 7:35:11 PM2/22/23
to wx-...@googlegroups.com, Subscribed

Closed #23274 as completed via #23278.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/23274/issue_event/8586631364@github.com>

Reply all
Reply to author
Forward
0 new messages