From f58e914729172d4f8bdf743272440b1639201d3d Mon Sep 17 00:00:00 2001 From: thrust26 Date: Fri, 26 Jan 2018 11:33:46 +0100 Subject: [PATCH] focus highlighting added to more widgets added some missing tab keys to debugger fixed frame colors for CheckboxWidget and RadioButtonWidget brightened inverted highlight color for "Light" --- src/debugger/gui/CartDebugWidget.cxx | 2 +- src/debugger/gui/DebuggerDialog.cxx | 38 ++++++++++++++++++--------- src/debugger/gui/DelayQueueWidget.cxx | 4 +-- src/debugger/gui/RamWidget.cxx | 8 ++++++ src/debugger/gui/RomListWidget.cxx | 18 ++++++++++--- src/debugger/gui/RomListWidget.hxx | 2 ++ src/debugger/gui/TiaZoomWidget.cxx | 11 +++++++- src/debugger/gui/TiaZoomWidget.hxx | 3 +++ src/emucore/FrameBuffer.cxx | 7 +++-- src/gui/CheckListWidget.cxx | 19 +++++++++++--- src/gui/CheckListWidget.hxx | 5 +++- src/gui/ContextMenu.cxx | 6 ++--- src/gui/DeveloperDialog.cxx | 7 +++-- src/gui/RadioButtonWidget.cxx | 4 +-- src/gui/ScrollBarWidget.cxx | 4 ++- src/gui/StringListWidget.cxx | 18 ++++++++++--- src/gui/StringListWidget.hxx | 2 ++ src/gui/Widget.cxx | 6 ++--- 18 files changed, 120 insertions(+), 44 deletions(-) diff --git a/src/debugger/gui/CartDebugWidget.cxx b/src/debugger/gui/CartDebugWidget.cxx index 82cbb6f34..c6b2f664a 100644 --- a/src/debugger/gui/CartDebugWidget.cxx +++ b/src/debugger/gui/CartDebugWidget.cxx @@ -78,7 +78,7 @@ int CartDebugWidget::addBaseInformation(int bytes, const string& manufacturer, fwidth, lines * myLineHeight, false); myDesc->setEditable(false); myDesc->setList(sl); - addFocusWidget(myDesc); + y += myDesc->getHeight() + 4; return y; diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx index deee05453..75ae3235b 100644 --- a/src/debugger/gui/DebuggerDialog.cxx +++ b/src/debugger/gui/DebuggerDialog.cxx @@ -442,24 +442,32 @@ void DebuggerDialog::addRomArea() const GUI::Rect& r = getRomBounds(); const int VBORDER = 4; const string ELLIPSIS = "\x1d"; + WidgetArray wid1, wid2; + ButtonWidget* b; int bwidth = myLFont->getStringWidth("Frame +1 "), bheight = myLFont->getLineHeight() + 2; int buttonX = r.right - bwidth - 5, buttonY = r.top + 5; - new ButtonWidget(this, *myLFont, buttonX, buttonY, - bwidth, bheight, "Step", kDDStepCmd); + + b = new ButtonWidget(this, *myLFont, buttonX, buttonY, + bwidth, bheight, "Step", kDDStepCmd); + wid2.push_back(b); buttonY += bheight + 4; - new ButtonWidget(this, *myLFont, buttonX, buttonY, - bwidth, bheight, "Trace", kDDTraceCmd); + b = new ButtonWidget(this, *myLFont, buttonX, buttonY, + bwidth, bheight, "Trace", kDDTraceCmd); + wid2.push_back(b); buttonY += bheight + 4; - new ButtonWidget(this, *myLFont, buttonX, buttonY, - bwidth, bheight, "Scan +1", kDDSAdvCmd); + b = new ButtonWidget(this, *myLFont, buttonX, buttonY, + bwidth, bheight, "Scan +1", kDDSAdvCmd); + wid2.push_back(b); buttonY += bheight + 4; - new ButtonWidget(this, *myLFont, buttonX, buttonY, - bwidth, bheight, "Frame +1", kDDAdvCmd); + b = new ButtonWidget(this, *myLFont, buttonX, buttonY, + bwidth, bheight, "Frame +1", kDDAdvCmd); + wid2.push_back(b); buttonY += bheight + 4; - new ButtonWidget(this, *myLFont, buttonX, buttonY, - bwidth, bheight, "Exit", kDDExitCmd); + b = new ButtonWidget(this, *myLFont, buttonX, buttonY, + bwidth, bheight, "Exit", kDDExitCmd); + wid2.push_back(b); bwidth = bheight; // 7 + 12; bheight = bheight * 3 + 4 * 2; @@ -469,7 +477,6 @@ void DebuggerDialog::addRomArea() myRewindButton = new ButtonWidget(this, *myLFont, buttonX, buttonY, bwidth, bheight, LEFT_ARROW, 7, 11, kDDRewindCmd); - myRewindButton->clearFlags(WIDGET_ENABLED); buttonY += bheight + 4; @@ -485,7 +492,11 @@ void DebuggerDialog::addRomArea() bwidth = myLFont->getStringWidth("Options " + ELLIPSIS); bheight = myLFont->getLineHeight() + 2; - new ButtonWidget(this, *myLFont, xpos, r.top + 5, bwidth, bheight, "Options" + ELLIPSIS, kDDOptionsCmd); + b = new ButtonWidget(this, *myLFont, xpos, r.top + 5, bwidth, bheight, + "Options" + ELLIPSIS, kDDOptionsCmd); + wid1.push_back(b); + wid1.push_back(myRewindButton); + wid1.push_back(myUnwindButton); DataGridOpsWidget* ops = new DataGridOpsWidget(this, *myLFont, xpos, ypos); @@ -494,6 +505,9 @@ void DebuggerDialog::addRomArea() myCpu = new CpuWidget(this, *myLFont, *myNFont, xpos, ypos, max_w); addToFocusList(myCpu->getFocusList()); + addToFocusList(wid1); + addToFocusList(wid2); + xpos = r.left + 10; ypos += myCpu->getHeight() + 10; myRam = new RiotRamWidget(this, *myLFont, *myNFont, xpos, ypos, r.width() - 10); addToFocusList(myRam->getFocusList()); diff --git a/src/debugger/gui/DelayQueueWidget.cxx b/src/debugger/gui/DelayQueueWidget.cxx index 5bf6b0b1b..281947e22 100644 --- a/src/debugger/gui/DelayQueueWidget.cxx +++ b/src/debugger/gui/DelayQueueWidget.cxx @@ -96,12 +96,12 @@ void DelayQueueWidget::drawWidget(bool hilite) w = _w, lineHeight = _font.getLineHeight(); - surface.frameRect(x, y, w, _h, kShadowColor); + surface.frameRect(x, y, w, _h, kColor); y += 1; x += 1; w -= 1; - surface.fillRect(x, y, w - 1, _h - 2, kBGColorHi); + surface.fillRect(x, y, w - 1, _h - 2, kDlgColor); y += 2; x += 2; diff --git a/src/debugger/gui/RamWidget.cxx b/src/debugger/gui/RamWidget.cxx index 5f5c8db8e..9002313dd 100644 --- a/src/debugger/gui/RamWidget.cxx +++ b/src/debugger/gui/RamWidget.cxx @@ -46,6 +46,7 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n const int bwidth = lfont.getStringWidth("Compare " + ELLIPSIS), bheight = myLineHeight + 2; const int VGAP = 4; + WidgetArray wid; int ypos = y + myLineHeight; @@ -63,28 +64,35 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n myUndoButton = new ButtonWidget(boss, lfont, bx, by, bwidth, bheight, "Undo", kUndoCmd); + wid.push_back(myUndoButton); myUndoButton->setTarget(this); by += bheight + VGAP; myRevertButton = new ButtonWidget(boss, lfont, bx, by, bwidth, bheight, "Revert", kRevertCmd); + wid.push_back(myRevertButton); myRevertButton->setTarget(this); by += bheight + VGAP * 6; mySearchButton = new ButtonWidget(boss, lfont, bx, by, bwidth, bheight, "Search" + ELLIPSIS, kSearchCmd); + wid.push_back(mySearchButton); mySearchButton->setTarget(this); by += bheight + VGAP; myCompareButton = new ButtonWidget(boss, lfont, bx, by, bwidth, bheight, "Compare" + ELLIPSIS, kCmpCmd); + wid.push_back(myCompareButton); myCompareButton->setTarget(this); by += bheight + VGAP; myRestartButton = new ButtonWidget(boss, lfont, bx, by, bwidth, bheight, "Reset", kRestartCmd); + wid.push_back(myRestartButton); myRestartButton->setTarget(this); + addToFocusList(wid); + // Labels for RAM grid myRamStart = new StaticTextWidget(_boss, lfont, xpos - _font.getStringWidth("xxxx"), diff --git a/src/debugger/gui/RomListWidget.cxx b/src/debugger/gui/RomListWidget.cxx index 86108950e..00064be5d 100644 --- a/src/debugger/gui/RomListWidget.cxx +++ b/src/debugger/gui/RomListWidget.cxx @@ -288,6 +288,20 @@ void RomListWidget::handleMouseWheel(int x, int y, int direction) myScrollBar->handleMouseWheel(x, y, direction); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void RomListWidget::handleMouseEntered() +{ + setFlags(WIDGET_HILITED); + setDirty(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void RomListWidget::handleMouseLeft() +{ + clearFlags(WIDGET_HILITED); + setDirty(); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool RomListWidget::handleText(char text) { @@ -458,9 +472,7 @@ void RomListWidget::drawWidget(bool hilite) const GUI::Rect& l = getLineRect(); // Draw a thin frame around the list and to separate columns - s.hLine(_x, _y, _x + _w - 1, kColor); - s.hLine(_x, _y + _h - 1, _x + _w - 1, kShadowColor); - s.vLine(_x, _y, _y + _h - 1, kColor); + s.frameRect(_x, _y, _w, _h, hilite ? kWidColorHi : kColor); s.vLine(_x + CheckboxWidget::boxSize() + 5, _y, _y + _h - 1, kColor); // Draw the list items diff --git a/src/debugger/gui/RomListWidget.hxx b/src/debugger/gui/RomListWidget.hxx index 312d9dbfc..3f55d991b 100644 --- a/src/debugger/gui/RomListWidget.hxx +++ b/src/debugger/gui/RomListWidget.hxx @@ -61,6 +61,8 @@ class RomListWidget : public EditableWidget void handleMouseDown(int x, int y, MouseButton b, int clickCount) override; void handleMouseUp(int x, int y, MouseButton b, int clickCount) override; void handleMouseWheel(int x, int y, int direction) override; + void handleMouseEntered() override; + void handleMouseLeft() override; bool handleText(char text) override; bool handleKeyDown(StellaKey key, StellaMod mod) override; bool handleKeyUp(StellaKey key, StellaMod mod) override; diff --git a/src/debugger/gui/TiaZoomWidget.cxx b/src/debugger/gui/TiaZoomWidget.cxx index baccb05be..195ae4514 100644 --- a/src/debugger/gui/TiaZoomWidget.cxx +++ b/src/debugger/gui/TiaZoomWidget.cxx @@ -164,9 +164,18 @@ void TiaZoomWidget::handleMouseMoved(int x, int y) #endif } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void TiaZoomWidget::handleMouseEntered() +{ + setFlags(WIDGET_HILITED); + setDirty(); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void TiaZoomWidget::handleMouseLeft() { + clearFlags(WIDGET_HILITED); + setDirty(); myMouseMoving = false; } @@ -242,7 +251,7 @@ void TiaZoomWidget::drawWidget(bool hilite) FBSurface& s = dialog().surface(); s.fillRect(_x+1, _y+1, _w-2, _h-2, kBGColor); - s.frameRect(_x, _y, _w, _h, kColor); + s.frameRect(_x, _y, _w, _h, hilite ? kWidColorHi : kColor); // Draw the zoomed image // This probably isn't as efficient as it can be, but it's a small area diff --git a/src/debugger/gui/TiaZoomWidget.hxx b/src/debugger/gui/TiaZoomWidget.hxx index 890e4af64..3e3cfaa2b 100644 --- a/src/debugger/gui/TiaZoomWidget.hxx +++ b/src/debugger/gui/TiaZoomWidget.hxx @@ -35,6 +35,9 @@ class TiaZoomWidget : public Widget, public CommandSender void loadConfig() override; void setPos(int x, int y); + protected: + void handleMouseEntered() override; + private: void zoom(int level); void recalc(); diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index ff377d3be..3fc577770 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -1034,7 +1034,7 @@ uInt32 FrameBuffer::ourGUIColors[3][kNumColors-256] = { }, // Classic { 0x686868, 0x000000, 0x404040, 0x404040, 0x404040, // base - 0x20a020, 0x00ff00, 0xc80000, 0x20a020, // text + 0x20a020, 0x00ff00, 0xc80000, 0x000000, // text 0x000000, 0x000000, 0x00ff00, 0xc80000, // UI elements 0x000000, 0x000000, 0x686868, 0x00ff00, 0x20a020, 0x00ff00, // buttons 0x20a020, // checkbox @@ -1044,9 +1044,8 @@ uInt32 FrameBuffer::ourGUIColors[3][kNumColors-256] = { 0x20a020, 0x20a020, 0x000000 // other }, // Light - { - 0x808080, 0x000000, 0xc0c0c0, 0xe1e1e1, 0x333333, // base - 0x000000, 0x0078d7, 0x0078d7, 0xffffff, // text + { 0x808080, 0x000000, 0xc0c0c0, 0xe1e1e1, 0x333333, // base + 0x000000, 0xBDDEF9, 0x0078d7, 0x000000, // text 0xf0f0f0, 0xffffff, 0x0078d7, 0x0f0f0f, // UI elements 0xe1e1e1, 0xe5f1fb, 0x808080, 0x0078d7, 0x000000, 0x000000, // buttons 0x333333, // checkbox diff --git a/src/gui/CheckListWidget.cxx b/src/gui/CheckListWidget.cxx index 10950a09d..53c747794 100644 --- a/src/gui/CheckListWidget.cxx +++ b/src/gui/CheckListWidget.cxx @@ -47,6 +47,20 @@ CheckListWidget::CheckListWidget(GuiObject* boss, const GUI::Font& font, } } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CheckListWidget::handleMouseEntered() +{ + setFlags(WIDGET_HILITED); + setDirty(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CheckListWidget::handleMouseLeft() +{ + clearFlags(WIDGET_HILITED); + setDirty(); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CheckListWidget::setList(const StringList& list, const BoolArray& state) { @@ -85,10 +99,7 @@ void CheckListWidget::drawWidget(bool hilite) int i, pos, len = int(_list.size()); // Draw a thin frame around the list and to separate columns - s.hLine(_x, _y, _x + _w - 1, kColor); - s.hLine(_x, _y + _h - 1, _x + _w - 1, kShadowColor); - s.vLine(_x, _y, _y + _h - 1, kColor); - + s.frameRect(_x, _y, _w, _h, hilite ? kWidColorHi : kColor); s.vLine(_x + CheckboxWidget::boxSize() + 5, _y, _y + _h - 1, kColor); // Draw the list items diff --git a/src/gui/CheckListWidget.hxx b/src/gui/CheckListWidget.hxx index 3626a954b..a48f35385 100644 --- a/src/gui/CheckListWidget.hxx +++ b/src/gui/CheckListWidget.hxx @@ -37,13 +37,16 @@ class CheckListWidget : public ListWidget int x, int y, int w, int h); virtual ~CheckListWidget() = default; - void setStyle(CheckStyle style); void setList(const StringList& list, const BoolArray& state); void setLine(int line, const string& str, const bool& state); bool getState(int line); bool getSelectedState() { return getState(_selectedItem); } + protected: + void handleMouseEntered() override; + void handleMouseLeft() override; + private: bool handleEvent(Event::Type e) override; void handleCommand(CommandSender* sender, int cmd, int data, int id) override; diff --git a/src/gui/ContextMenu.cxx b/src/gui/ContextMenu.cxx index ee48f5117..ba1ff7761 100644 --- a/src/gui/ContextMenu.cxx +++ b/src/gui/ContextMenu.cxx @@ -560,7 +560,7 @@ void ContextMenu::drawDialog() int offset = _selectedOffset; if(_showScroll) { - s.hLine(x, y+_rowHeight-1, w+2, kShadowColor); + s.hLine(x, y+_rowHeight-1, w+2, kColor); s.drawBitmap(up_arrow, ((_w-_x)>>1)-4, (_rowHeight>>1)+y-4, _scrollUpColor, 8); y += _rowHeight; offset--; @@ -571,14 +571,14 @@ void ContextMenu::drawDialog() bool hilite = offset == current; if(hilite) s.fillRect(x, y, w, _rowHeight, kTextColorHi); s.drawString(_font, _entries[i].first, x + 1, y + 2, w, - !hilite ? kTextColor : kWidColor); + !hilite ? kTextColor : kTextColorInv); y += _rowHeight; } // Show bottom scroll area if(_showScroll) { - s.hLine(x, y, w+2, kShadowColor); + s.hLine(x, y, w+2, kColor); s.drawBitmap(down_arrow, ((_w-_x)>>1)-4, (_rowHeight>>1)+y-4, _scrollDnColor, 8); } diff --git a/src/gui/DeveloperDialog.cxx b/src/gui/DeveloperDialog.cxx index 9ebb68496..4c820f0e8 100644 --- a/src/gui/DeveloperDialog.cxx +++ b/src/gui/DeveloperDialog.cxx @@ -209,8 +209,7 @@ void DeveloperDialog::addVideoTab(const GUI::Font& font) myTVJitterRecLabelWidget = new StaticTextWidget(myTab, font, myTVJitterRecWidget->getRight() + 4, myTVJitterRecWidget->getTop() + 2, - 5 * fontWidth, fontHeight, "", TextAlign::Left); - wid.push_back(myTVJitterRecLabelWidget); + 5 * fontWidth, fontHeight, ""); ypos += lineHeight + VGAP; myColorLossWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, @@ -434,7 +433,7 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font) myDebuggerWidthLabel = new StaticTextWidget(myTab, font, xpos + myDebuggerWidthSlider->getWidth() + 4, - ypos + 1, 4 * fontWidth, fontHeight, "", TextAlign::Left); + ypos + 1, 4 * fontWidth, fontHeight, ""); ypos += lineHeight + VGAP; myDebuggerHeightSlider = new SliderWidget(myTab, font, xpos, ypos-1, "Debugger height (*) ", @@ -446,7 +445,7 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font) myDebuggerHeightLabel = new StaticTextWidget(myTab, font, xpos + myDebuggerHeightSlider->getWidth() + 4, - ypos + 1, 4 * fontWidth, fontHeight, "", TextAlign::Left); + ypos + 1, 4 * fontWidth, fontHeight, ""); ypos += lineHeight + VGAP * 4; myGhostReadsTrapWidget = new CheckboxWidget(myTab, font, HBORDER, ypos + 1, diff --git a/src/gui/RadioButtonWidget.cxx b/src/gui/RadioButtonWidget.cxx index c9437ba84..e0549ee1d 100644 --- a/src/gui/RadioButtonWidget.cxx +++ b/src/gui/RadioButtonWidget.cxx @@ -160,7 +160,7 @@ void RadioButtonWidget::drawWidget(bool hilite) FBSurface& s = _boss->dialog().surface(); // Draw the outer bounding circle - s.drawBitmap(radio_img_outercircle, _x, _y + _boxY, hilite ? kWidColorHi : kShadowColor, 14, 14); + s.drawBitmap(radio_img_outercircle, _x, _y + _boxY, hilite ? kWidColorHi : kColor, 14, 14); // Draw the inner bounding circle with enabled color s.drawBitmap(radio_img_innercircle, _x + 1, _y + _boxY + 1, isEnabled() @@ -170,7 +170,7 @@ void RadioButtonWidget::drawWidget(bool hilite) if(_state) s.drawBitmap(_img, _x + 2, _y + _boxY + 2, isEnabled() ? hilite ? kWidColorHi : kCheckColor - : kShadowColor, 10); + : kColor, 10); // Finally draw the label s.drawString(_font, _label, _x + 20, _y + _textY, _w, diff --git a/src/gui/ScrollBarWidget.cxx b/src/gui/ScrollBarWidget.cxx index e7dd80414..8e3960965 100644 --- a/src/gui/ScrollBarWidget.cxx +++ b/src/gui/ScrollBarWidget.cxx @@ -209,6 +209,7 @@ void ScrollBarWidget::checkBounds(int old_pos) void ScrollBarWidget::handleMouseEntered() { setFlags(WIDGET_HILITED); + setDirty(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -216,6 +217,7 @@ void ScrollBarWidget::handleMouseLeft() { _part = kNoPart; clearFlags(WIDGET_HILITED); + setDirty(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -250,7 +252,7 @@ void ScrollBarWidget::drawWidget(bool hilite) int bottomY = _y + _h; bool isSinglePage = (_numEntries <= _entriesPerPage); - s.frameRect(_x, _y, _w, _h, kShadowColor); + s.frameRect(_x, _y, _w, _h, hilite ? kWidColorHi : kColor); if(_draggingPart != kNoPart) _part = _draggingPart; diff --git a/src/gui/StringListWidget.cxx b/src/gui/StringListWidget.cxx index 544416a13..3f5a1330f 100644 --- a/src/gui/StringListWidget.cxx +++ b/src/gui/StringListWidget.cxx @@ -39,6 +39,20 @@ void StringListWidget::setList(const StringList& list) ListWidget::recalc(); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void StringListWidget::handleMouseEntered() +{ + setFlags(WIDGET_HILITED); + setDirty(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void StringListWidget::handleMouseLeft() +{ + clearFlags(WIDGET_HILITED); + setDirty(); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void StringListWidget::drawWidget(bool hilite) { @@ -46,9 +60,7 @@ void StringListWidget::drawWidget(bool hilite) int i, pos, len = int(_list.size()); // Draw a thin frame around the list. - s.hLine(_x, _y, _x + _w - 1, kColor); - s.hLine(_x, _y + _h - 1, _x + _w - 1, kShadowColor); - s.vLine(_x, _y, _y + _h - 1, kColor); + s.frameRect(_x, _y, _w, _h, hilite && _hilite ? kWidColorHi : kColor); // Draw the list items for (i = 0, pos = _currentPos; i < _rows && pos < len; i++, pos++) diff --git a/src/gui/StringListWidget.hxx b/src/gui/StringListWidget.hxx index 5cd89c3a6..1894bca9a 100644 --- a/src/gui/StringListWidget.hxx +++ b/src/gui/StringListWidget.hxx @@ -32,6 +32,8 @@ class StringListWidget : public ListWidget bool wantsFocus() const override { return true; } protected: + void handleMouseEntered() override; + void handleMouseLeft() override; void drawWidget(bool hilite) override; GUI::Rect getEditRect() const override; diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 397a162ab..daef1646d 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -609,13 +609,13 @@ void CheckboxWidget::drawWidget(bool hilite) FBSurface& s = _boss->dialog().surface(); if(_drawBox) - s.frameRect(_x, _y + _boxY, 14, 14, hilite ? kWidColorHi : kShadowColor); + s.frameRect(_x, _y + _boxY, 14, 14, hilite && isEnabled() && isEditable() ? kWidColorHi : kColor); // Do we draw a square or cross? s.fillRect(_x + 1, _y + _boxY + 1, 12, 12, _changed ? kDbgChangedColor : isEnabled() ? _bgcolor : kColor); if(_state) - s.drawBitmap(_img, _x + 2, _y + _boxY + 2, isEnabled() ? hilite ? kWidColorHi : kCheckColor - : kShadowColor, 10); + s.drawBitmap(_img, _x + 2, _y + _boxY + 2, isEnabled() ? hilite && isEditable() ? kWidColorHi : kCheckColor + : kColor, 10); // Finally draw the label s.drawString(_font, _label, _x + 20, _y + _textY, _w,