From 7f1535c0d21d7a3e1506e11fe2c17d26214d1d61 Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Tue, 19 Aug 2008 13:54:42 +0000 Subject: [PATCH] - BPictureButton didn't account for the disabled state. Fixes #2410 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27063 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/PictureButton.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/kits/interface/PictureButton.cpp b/src/kits/interface/PictureButton.cpp index 25085f8a94..169580fb84 100644 --- a/src/kits/interface/PictureButton.cpp +++ b/src/kits/interface/PictureButton.cpp @@ -127,10 +127,17 @@ BPictureButton::Draw(BRect updateRect) rgb_color color = ui_color(B_PANEL_BACKGROUND_COLOR); if (fBehavior == B_ONE_STATE_BUTTON) { - if (Value() == B_CONTROL_ON) - DrawPicture(fEnabledOn); - else - DrawPicture(fEnabledOff); + + if (IsEnabled()) { + if (Value() == B_CONTROL_ON) + DrawPicture(fEnabledOn); + else + DrawPicture(fEnabledOff); + } else + DrawPicture(fDisabledOff); + //a disabled one_state_button is always OFF (ie: not pushed) + //since it cannot be pushed while disabled + } else { // B_TWO_STATE_BUTTON