Commit Graph

5 Commits

Author SHA1 Message Date
Vadim Zeitlin
d9684e1ceb Allow calling EnableSystemTheme(false) before creating the window
This is important as enabling the system theme results in changes to the
native ListView control appearance that are not undone later even if the
system theme is disabled. Notably, the item rectangle width is reduced
by 2 pixels when system theme is enabled and it's not increased to its
original value even when it's disabled later, resulting in gaps between
items through which the control background shows, for example. This also
makes items drawn using our own HandleItemPaint() slightly, but
noticeably, larger than the items using standard appearance, which looks
bad.

All these problems can be avoided if we skip enabling the system theme
in the first place if EnableSystemTheme(false) had been called before
creating the control, so support doing it like this and document that
this is the preferred way of disabling the system theme use.

Closes #17404, #18296.
2019-05-26 23:20:21 +02:00
Vadim Zeitlin
089eeea3ef Fix wxMSW build with wxUSE_UXTHEME==0
Make wxUxThemeIsActive() available even in this case to fix compilation
in some places and add the unavoidable preprocessor checks in other
ones.

Closes #18207.
2018-12-08 20:24:05 +01:00
Cătălin Răceanu
5349d48c38 dll build fix for WXQT, DoEnableSystemTheme
removing 'inline' did fix:
warning: 'virtual void wxSystemThemedControlBase::DoEnableSystemTheme(bool, wxWindow*)' redeclared without dllimport attribute after being referenced with dll linkage

but introduced
multiple definition of `wxSystemThemedControlBase::DoEnableSystemTheme(bool, wxWindow*)'.

The proposed form gets no complaints
2018-08-05 15:46:50 +03:00
Kolya Kosenko
16468ac2ba Add missing __WXUNIVERSAL__ checks to fix wxUniv/MSW build
Only define wxHAS_SYSTEM_THEMED_CONTROL when not using wxUniv, do define
wxHAS_GENERIC_TREECTRL when using it.

Closes #17399.
2016-02-26 12:02:05 +01:00
Tobias Taschner
2fff3cd29f Add wxSystemThemedControl and use it in wxMSW
wxSystemThemedControl allows to use the "system theme" (i.e. the theme used by
the system applications such as file manager and which can, surprisingly, be
different from the default one). Currently it is only implemented for wxMSW
and does nothing under the other platforms.

Use wxSystemThemedControl for wxDataViewCtrl, wxListCtrl and, optionally, if
wxTR_TWIST_BUTTONS style is specified, wxTreeCtrl to give them more native
appearance under MSW.

Closes #16414.
2015-09-17 14:49:13 +02:00