libraries/lib-theme/Theme.cpp
/// This function is called to load the initial Theme images.
/// It does not though cause the GUI to refresh.
This function is called to load the initial Theme images.
It does not though cause the GUI to refresh.
This function is called to load the initial Theme images . It does not though cause the GUI to refresh .
void ThemeBase::LoadTheme( teThemeType Theme )
{
   SwitchTheme( Theme );
   RotateImageInto( bmpRecordBeside, bmpRecordBelow, false );
   RotateImageInto( bmpRecordBesideDisabled, bmpRecordBelowDisabled, false );
   if ( mpSet->bRecolourOnLoad ) {
      RecolourTheme();
      wxColor Back        = theTheme.Colour( clrTrackInfo );
      wxColor CurrentText = theTheme.Colour( clrTrackPanelText );
      wxColor DesiredText = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
      int TextColourDifference =  ColourDistance( CurrentText, DesiredText );
      if ( TextColourDifference != 0 ) {
         int ContrastLevel        =  ColourDistance( Back, DesiredText );
         if ( ContrastLevel > 250 )
            Colour( clrTrackPanelText ) = DesiredText;
      }
      mpSet->bRecolourOnLoad = false;
   }
   if (mOnPreferredSystemAppearanceChanged)
      mOnPreferredSystemAppearanceChanged(mPreferredSystemAppearance);
}
void ThemeBase :: LoadTheme ( teThemeType Theme ) { SwitchTheme ( Theme ) ; RotateImageInto ( bmpRecordBeside , bmpRecordBelow , false ) ; RotateImageInto ( bmpRecordBesideDisabled , bmpRecordBelowDisabled , false ) ; if ( mpSet -> bRecolourOnLoad ) { RecolourTheme ( ) ; wxColor Back = theTheme . Colour ( clrTrackInfo ) ; wxColor CurrentText = theTheme . Colour ( clrTrackPanelText ) ; wxColor DesiredText = wxSystemSettings :: GetColour ( wxSYS_COLOUR_WINDOWTEXT ) ; int TextColourDifference = ColourDistance ( CurrentText , DesiredText ) ; if ( TextColourDifference != 0 ) { int ContrastLevel = ColourDistance ( Back , DesiredText ) ; if ( ContrastLevel > 250 ) Colour ( clrTrackPanelText ) = DesiredText ; } mpSet -> bRecolourOnLoad = false ; } if ( mOnPreferredSystemAppearanceChanged ) mOnPreferredSystemAppearanceChanged ( mPreferredSystemAppearance ) ; }
This function is called to load the initial Theme images.
This function is called to load the initial Theme images .
// Post-processing steps after loading of the cache // Two always overwritten images // Other modifications of images happening only when the setting // GUIBlendThemes is true // Theming is very accepting of alternative text colours.  They just need to // have decent contrast to the background colour, if we're blending themes. // Next line is not required as we haven't yet built the GUI // when this function is (or should be) called. // ApplyUpdatedImages(); // The next step doesn't post-process the theme data.  It only modifies // system settings.  So it is not necessary to make it conditional on // preferences, for avoidance of errors in the use of Theme preferences. // (See commit 2020217)