Bug2172: ruler pin button background should update for theme change...

... It stopped doing so at 1c1aca5

Because the recreating of the ruler's button now happened earlier than for
the several toolbars, not later, but there was a side-effect on the theme
that the toolbar updates did, that the ruler relied on, namely the updating
of button background images.

Now ruler also invokes that step.

(But wouldn't it be better to do that update in just one place?  I am not
sure what that place should be.  ThemeBase::LoadPreferredTheme?)
This commit is contained in:
Paul Licameli 2019-07-23 01:59:41 -04:00
parent 0bdb09eefb
commit 582f662404
2 changed files with 6 additions and 4 deletions

View File

@ -991,6 +991,7 @@ void AdornedRulerPanel::ReCreateButtons()
// Get rid of any children we may have
// DestroyChildren();
ToolBar::MakeButtonBackgroundsSmall();
SetBackgroundColour(theTheme.Colour( clrMedium ));
for (auto & button : mButtons) {

View File

@ -171,13 +171,14 @@ class ToolBar /* not final */
// parenthesized, after the translated name.
const TranslatedInternalString commands[], size_t nCommands);
static void MakeButtonBackgroundsSmall();
static void MakeButtonBackgroundsLarge();
protected:
void SetButton(bool down, AButton *button);
void MakeMacRecoloredImage(teBmps eBmpOut, teBmps eBmpIn);
void MakeRecoloredImage(teBmps eBmpOut, teBmps eBmpIn);
void MakeButtonBackgroundsLarge();
void MakeButtonBackgroundsSmall();
static void MakeMacRecoloredImage(teBmps eBmpOut, teBmps eBmpIn);
static void MakeRecoloredImage(teBmps eBmpOut, teBmps eBmpIn);
wxBoxSizer *GetSizer();