30template<
class WindowBase>
33 public std::conditional_t<std::is_base_of_v<PrefsListener, WindowBase>, PrefsListenerDummy, PrefsListener>
43 template <
typename... Args>
72 PrefsListenerBase::UpdatePrefs();
86 WindowBase::Refresh();
91template<
class ButtonBase>
106 template <
typename... Args>
185 ButtonBase::Refresh();
190template<
typename AButtonBase>
197 std::map<int, std::array<int, AButton::AButtonStateCount>>
mSets;
203 template <
typename... Args>
210 void SetImageIndices(
int setIndex,
int up,
int over,
int down,
int overDown,
int disabled)
212 mSets[setIndex] = { up, over, down, overDown, disabled };
213 AButtonBase::SetAlternateImages(
249 AButtonBase::Refresh(
false);
259 for(
const auto& p :
mSets)
260 AButtonBase::SetAlternateImages(
275 AButtonBase::Refresh(
false);
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
A move-only handle representing a connection to a Publisher.
A listener notified of changes in preferences.
virtual void UpdatePrefs()=0
wxColour & Colour(int iIndex)
wxImage & Image(int iIndex)
wxBitmap & Bitmap(int iIndex)
int mBackgroundColorIndex
void SetBackgroundColorIndex(int index)
std::optional< TranslatableString > mTranslatableLabel
void UpdatePrefs() override
std::conditional_t< std::is_base_of_v< PrefsListener, WindowBase >, WindowBase, PrefsListener > PrefsListenerBase
void OnThemeChange(ThemeChangeMessage message)
Observer::Subscription mThemeChangeSubscription
void SetTranslatableLabel(TranslatableString label)
int mForegroundColorIndex
void SetForegroundColorIndex(int index)
ThemedWindowWrapper(Args &&... args)
Holds a msgid for the translation catalog; may also bind format arguments.
std::optional< PreferredSystemAppearance > appearance