No changes, just rename GTKGetCurrentState() to be more clear.

Update the name and the comment to explain better that this method returns the
state for which the bitmap is currently shown, not necessarily the current
state.

See #16771.
This commit is contained in:
Vadim Zeitlin
2015-05-09 19:17:41 +02:00
parent 178e9c9335
commit c0ae81ced7
2 changed files with 7 additions and 7 deletions

View File

@@ -54,10 +54,10 @@ private:
// update the bitmap to correspond to the current button state
void GTKUpdateBitmap();
// return the current button state from m_isXXX flags (which means that it
// might not correspond to the real current state as e.g. m_isCurrent will
// never be true if we don't have a valid current bitmap)
State GTKGetCurrentState() const;
// return the state whose bitmap is being currently shown (so this is
// different from the real current state, e.g. it could be State_Normal
// even if the button is pressed if no button was set for State_Pressed)
State GTKGetCurrentBitmapState() const;
// show the given bitmap (must be valid)
void GTKDoShowBitmap(const wxBitmap& bitmap);

View File

@@ -136,7 +136,7 @@ void wxAnyButton::GTKOnFocus(wxFocusEvent& event)
GTKUpdateBitmap();
}
wxAnyButton::State wxAnyButton::GTKGetCurrentState() const
wxAnyButton::State wxAnyButton::GTKGetCurrentBitmapState() const
{
if ( !IsThisEnabled() )
return m_bitmaps[State_Disabled].IsOk() ? State_Disabled : State_Normal;
@@ -160,7 +160,7 @@ void wxAnyButton::GTKUpdateBitmap()
{
// if we do show them, this will return a state for which we do have a
// valid bitmap
State state = GTKGetCurrentState();
State state = GTKGetCurrentBitmapState();
GTKDoShowBitmap(m_bitmaps[state]);
}
@@ -360,7 +360,7 @@ void wxAnyButton::DoSetBitmap(const wxBitmap& bitmap, State which)
// update the bitmap immediately if necessary, otherwise it will be done
// when the bitmap for the corresponding state is needed the next time by
// GTKUpdateBitmap()
if ( bitmap.IsOk() && which == GTKGetCurrentState() )
if ( bitmap.IsOk() && which == GTKGetCurrentBitmapState() )
{
GTKDoShowBitmap(bitmap);
}