diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/PopUpWidget.cpp | 20 | ||||
-rw-r--r-- | gui/widget.cpp | 4 |
2 files changed, 15 insertions, 9 deletions
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp index 22e2fb9834..eaebc8ebc4 100644 --- a/gui/PopUpWidget.cpp +++ b/gui/PopUpWidget.cpp @@ -265,6 +265,9 @@ void PopUpDialog::drawMenuEntry(int entry, bool hilite) { _gui->addDirtyRect(x, y, w, kLineHeight); } + +#pragma mark - + // // PopUpWidget // @@ -278,11 +281,14 @@ PopUpWidget::PopUpWidget(Dialog *boss, int x, int y, int w, int h) } void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) { - PopUpDialog popupDialog(this, x + _x + _boss->getX(), y + _y + _boss->getY()); - int newSel = popupDialog.runModal(); - if (newSel != -1 && _selectedItem != newSel) { - _selectedItem = newSel; - sendCommand(kPopUpItemSelectedCmd, _entries[_selectedItem].tag); + + if (isEnabled()) { + PopUpDialog popupDialog(this, x + _x + _boss->getX(), y + _y + _boss->getY()); + int newSel = popupDialog.runModal(); + if (newSel != -1 && _selectedItem != newSel) { + _selectedItem = newSel; + sendCommand(kPopUpItemSelectedCmd, _entries[_selectedItem].tag); + } } } @@ -320,11 +326,11 @@ void PopUpWidget::drawWidget(bool hilite) { gui->vline(_x + _w - 1, _y, _y +_h - 1, gui->_shadowcolor); // Draw an arrow pointing down at the right end to signal this is a dropdown/popup - gui->drawBitmap(up_down_arrows, _x+_w - 10, _y+2, hilite ? gui->_textcolorhi : gui->_textcolor); + gui->drawBitmap(up_down_arrows, _x+_w - 10, _y+2, !isEnabled() ? gui->_color : hilite ? gui->_textcolorhi : gui->_textcolor); // Draw the selected entry, if any if (_selectedItem >= 0) { int align = (gui->getStringWidth(_entries[_selectedItem].name) > _w-6) ? kTextAlignRight : kTextAlignLeft; - gui->drawString(_entries[_selectedItem].name, _x+2, _y+3, _w-6, gui->_textcolor, align); + gui->drawString(_entries[_selectedItem].name, _x+2, _y+3, _w-6, !isEnabled() ? gui->_color : gui->_textcolor, align); } } diff --git a/gui/widget.cpp b/gui/widget.cpp index f390d3b2e5..ed899ffc57 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -167,12 +167,12 @@ void CheckboxWidget::drawWidget(bool hilite) { // If checked, draw cross inside the box if (_state) - gui->drawBitmap(checked_img, _x + 3, _y + 3, gui->_textcolor); + gui->drawBitmap(checked_img, _x + 3, _y + 3, !isEnabled() ? gui->_color : gui->_textcolor); else gui->fillRect(_x + 2, _y + 2, 10, 10, gui->_bgcolor); // Finally draw the label - gui->drawString(_label, _x + 20, _y + 3, _w, gui->_textcolor); + gui->drawString(_label, _x + 20, _y + 3, _w, !isEnabled() ? gui->_color : gui->_textcolor); } #pragma mark - |