Remove MSWSetDarkOrLightMode() SetMode parameter

The MSWSetDarkOrLightMode() SetMode parameter was only ever used in one
place, and not really needed there.

Closes #27076.
This commit is contained in:
Steve Cornett
2026-09-24 23:55:10 +02:00
committed by Vadim Zeitlin
parent 3f60ae43c0
commit 8926764e03
30 changed files with 49 additions and 61 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ public:
protected:
virtual wxSize DoGetBestClientSize() const override;
virtual void MSWSetDarkOrLightMode(SetMode setmode) override;
virtual void MSWSetDarkOrLightMode() override;
virtual void DoSet3StateValue(wxCheckBoxState value) override;
virtual wxCheckBoxState DoGet3StateValue() const override;
+1 -1
View File
@@ -130,7 +130,7 @@ protected:
virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const override;
virtual void MSWGetDarkModeSupport(MSWDarkModeSupport& support) const override;
virtual void MSWSetDarkOrLightMode(SetMode setmode) override;
virtual void MSWSetDarkOrLightMode() override;
// Show or hide the popup part of the control.
void MSWDoPopupOrDismiss(bool show);
+1 -1
View File
@@ -112,7 +112,7 @@ protected:
// Look in our GetSubcontrols() for the windows with the given ID.
virtual wxWindow *MSWFindItem(long id, WXHWND hWnd) const override;
virtual void MSWSetDarkOrLightMode(SetMode setmode) override;
virtual void MSWSetDarkOrLightMode() override;
// Return the message that can be used to retrieve the tooltip window used
// by a native control. If this message is non-zero and sending it returns
+1 -1
View File
@@ -62,7 +62,7 @@ protected:
virtual wxSize DoGetBestSize() const override;
virtual void MSWGetDarkModeSupport(MSWDarkModeSupport& support) const override;
virtual void MSWSetDarkOrLightMode(SetMode setmode) override;
virtual void MSWSetDarkOrLightMode() override;
private:
// returns true if the control is currently in indeterminate (a.k.a.
+1 -1
View File
@@ -401,7 +401,7 @@ protected:
virtual void MSWUpdateFontOnDPIChange(const wxSize& newDPI) override;
virtual void MSWSetDarkOrLightMode(SetMode setmode) override;
virtual void MSWSetDarkOrLightMode() override;
virtual int MSWGetToolTipMessage() const override;
+1 -1
View File
@@ -32,7 +32,7 @@ protected:
virtual bool DoSetPathShape(const wxGraphicsPath& path) override;
#endif // wxUSE_GRAPHICS_CONTEXT
virtual void MSWSetDarkOrLightMode(SetMode setmode) override;
virtual void MSWSetDarkOrLightMode() override;
virtual WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) override;
+1 -1
View File
@@ -139,7 +139,7 @@ protected:
// common part of all ctors
void Init();
virtual void MSWSetDarkOrLightMode(SetMode setmode) override;
virtual void MSWSetDarkOrLightMode() override;
virtual int MSWGetToolTipMessage() const override;
+2 -4
View File
@@ -21,10 +21,8 @@ WXDLLIMPEXP_CORE
bool IsActive();
// Return true if the system has switched between dark and light modes.
// Some controls need to take extra actions to switch from light mode to dark
// mode compared with just creating the window in dark mode. This function
// helps us do only what is needed, to avoid overwriting user settings such as
// background and foreground colours.
// A control might need to take different actions to switch modes compared
// with just creating the control in dark mode.
WXDLLIMPEXP_CORE
bool HasChanged();
+1 -1
View File
@@ -68,7 +68,7 @@ protected:
virtual void
MSWDrawButtonBitmap(wxDC& dc, const wxRect& rect, int flags) override;
virtual void MSWSetDarkOrLightMode(SetMode setmode) override;
virtual void MSWSetDarkOrLightMode() override;
private:
// common part of all ctors
+1 -1
View File
@@ -78,7 +78,7 @@ public:
protected:
virtual wxWindowList GetCompositeWindowParts() const override;
virtual void MSWSetDarkOrLightMode(SetMode setmode) override;
virtual void MSWSetDarkOrLightMode() override;
// return the region with all the windows inside this static box excluded
WXHRGN MSWGetRegionWithoutChildren();
+1 -1
View File
@@ -43,7 +43,7 @@ public:
// usually overridden base class virtuals
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const override;
virtual void MSWSetDarkOrLightMode(SetMode setmode) override;
virtual void MSWSetDarkOrLightMode() override;
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticLine);
};
+1 -1
View File
@@ -251,7 +251,7 @@ protected:
virtual void MSWDrawThemeBorder(WXHDC hdc) override;
virtual void MSWGetDarkModeSupport(MSWDarkModeSupport& support) const override;
virtual void MSWSetDarkOrLightMode(SetMode setmode) override;
virtual void MSWSetDarkOrLightMode() override;
#if wxUSE_RICHEDIT
virtual void MSWUpdateFontOnDPIChange(const wxSize& newDPI) override;
+1 -1
View File
@@ -109,7 +109,7 @@ protected:
// common part of all ctors
void Init();
virtual void MSWSetDarkOrLightMode(SetMode setmode) override;
virtual void MSWSetDarkOrLightMode() override;
virtual int MSWGetToolTipMessage() const override;
// create the native toolbar control
+1 -11
View File
@@ -635,20 +635,10 @@ protected:
virtual void MSWGetDarkModeSupport(MSWDarkModeSupport& support) const;
// The reason for calling MSWSetDarkOrLightMode below.
enum class SetMode
{
// Set dark mode for a newly created window.
Initial,
// Set dark mode or light mode for an existing window.
Change
};
// Configure a window for dark mode settings immediately after creation or
// upon switching into or out of dark mode. This function is not called
// unless dark mode was enabled, or is being enabled.
virtual void MSWSetDarkOrLightMode(SetMode setmode);
virtual void MSWSetDarkOrLightMode();
// Translate wxBORDER_THEME to a standard border style or return it as is
// if themed border should be used, depending on CanApplyThemeBorder().