diff --git a/src/debugger/gui/DataGridWidget.cxx b/src/debugger/gui/DataGridWidget.cxx index ab12fd5c2..43d2a6ffd 100644 --- a/src/debugger/gui/DataGridWidget.cxx +++ b/src/debugger/gui/DataGridWidget.cxx @@ -593,9 +593,10 @@ void DataGridWidget::handleCommand(CommandSender* sender, int cmd, void DataGridWidget::drawWidget(bool hilite) { FBSurface& s = _boss->dialog().surface(); + bool onTop = _boss->dialog().isOnTop(); int row, col; - s.fillRect(_x, _y, _w, _h, hilite && isEnabled() && isEditable() ? _bgcolorhi : _bgcolor); + s.fillRect(_x, _y, _w, _h, hilite && isEnabled() && isEditable() ? _bgcolorhi : onTop ? _bgcolor : _bgcolorlo); // Draw the internal grid and labels int linewidth = _cols * _colWidth; s.frameRect(_x, _y, _w, _h, hilite && isEnabled() && isEditable() ? kWidColorHi : kColor); @@ -614,7 +615,7 @@ void DataGridWidget::drawWidget(bool hilite) int x = _x + 4 + (col * _colWidth); int y = _y + 2 + (row * _rowHeight); int pos = row*_cols + col; - uInt32 textColor = kTextColor; + uInt32 textColor = onTop ? kTextColor : kColor; // Draw the selected item inverted, on a highlighted background. if (_currentRow == row && _currentCol == col && @@ -634,12 +635,12 @@ void DataGridWidget::drawWidget(bool hilite) { if(_changedList[pos]) { - s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, kDbgChangedColor); + s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, onTop ? kDbgChangedColor : _bgcolorlo); if(_hiliteList[pos]) textColor = kDbgColorHi; else - textColor = kDbgChangedTextColor; + textColor = onTop ? kDbgChangedTextColor : textColor; } else if(_hiliteList[pos]) textColor = kDbgColorHi; diff --git a/src/debugger/gui/PromptWidget.cxx b/src/debugger/gui/PromptWidget.cxx index ede0d20ad..9093c1537 100644 --- a/src/debugger/gui/PromptWidget.cxx +++ b/src/debugger/gui/PromptWidget.cxx @@ -45,6 +45,7 @@ PromptWidget::PromptWidget(GuiObject* boss, const GUI::Font& font, WIDGET_WANTS_TAB | WIDGET_WANTS_RAWDATA; _textcolor = kTextColor; _bgcolor = kWidColor; + _bgcolorlo = kDlgColor; _kConsoleCharWidth = font.getMaxCharWidth(); _kConsoleCharHeight = font.getFontHeight(); @@ -74,6 +75,7 @@ void PromptWidget::drawWidget(bool hilite) uInt32 fgcolor, bgcolor; FBSurface& s = _boss->dialog().surface(); + bool onTop = _boss->dialog().isOnTop(); // Draw text int start = _scrollLine - _linesPerPage + 1; @@ -94,7 +96,7 @@ void PromptWidget::drawWidget(bool hilite) else fgcolor = c >> 8; - s.drawChar(_font, c & 0x7f, x, y, fgcolor); + s.drawChar(_font, c & 0x7f, x, y, onTop ? fgcolor : kColor); x += _kConsoleCharWidth; } y += _kConsoleLineHeight; diff --git a/src/debugger/gui/RomListWidget.cxx b/src/debugger/gui/RomListWidget.cxx index bc077e94b..cc8cc1e46 100644 --- a/src/debugger/gui/RomListWidget.cxx +++ b/src/debugger/gui/RomListWidget.cxx @@ -465,8 +465,10 @@ void RomListWidget::lostFocusWidget() void RomListWidget::drawWidget(bool hilite) { FBSurface& s = _boss->dialog().surface(); + bool onTop = _boss->dialog().isOnTop(); const CartDebug::DisassemblyList& dlist = myDisasm->list; int i, pos, xpos, ypos, len = int(dlist.size()); + uInt32 textColor = onTop ? kTextColor : kColor; const GUI::Rect& r = getEditRect(); const GUI::Rect& l = getLineRect(); @@ -487,7 +489,7 @@ void RomListWidget::drawWidget(bool hilite) xpos = _x + CheckboxWidget::boxSize() + 10; ypos = _y + 2; for (i = 0, pos = _currentPos; i < _rows && pos < len; i++, pos++, ypos += _fontHeight) { - uInt32 bytesColor = kTextColor; + uInt32 bytesColor = textColor; // Draw checkboxes for correct lines (takes scrolling into account) myCheckList[i]->setState(myBPState->isSet(dlist[pos].address)); @@ -496,7 +498,7 @@ void RomListWidget::drawWidget(bool hilite) // Draw highlighted item in a frame if (_highlightedItem == pos) - s.frameRect(_x + l.x() - 3, ypos - 1, _w - l.x(), _fontHeight, kWidColorHi); + s.frameRect(_x + l.x() - 3, ypos - 1, _w - l.x(), _fontHeight, onTop ? kWidColorHi : kBGColorLo); // Draw the selected item inverted, on a highlighted background. if(_selectedItem == pos && _hasFocus) @@ -512,7 +514,7 @@ void RomListWidget::drawWidget(bool hilite) // Draw labels s.drawString(_font, dlist[pos].label, xpos, ypos, _labelWidth, - dlist[pos].hllabel ? kTextColor : kColor); + dlist[pos].hllabel ? textColor : kColor); // Bytes are only editable if they represent code, graphics, or accessible data // Otherwise, the disassembly should get all remaining space @@ -522,14 +524,14 @@ void RomListWidget::drawWidget(bool hilite) { // Draw mnemonic s.drawString(_font, dlist[pos].disasm.substr(0, 7), xpos + _labelWidth, ypos, - 7 * _fontWidth, kTextColor); + 7 * _fontWidth, textColor); // Draw operand if (dlist[pos].disasm.length() > 8) s.drawString(_font, dlist[pos].disasm.substr(8), xpos + _labelWidth + 7 * _fontWidth, ypos, - codeDisasmW - 7 * _fontWidth, kTextColor); + codeDisasmW - 7 * _fontWidth, textColor); // Draw cycle count s.drawString(_font, dlist[pos].ccount, xpos + _labelWidth + codeDisasmW, ypos, - cycleCountW, kTextColor); + cycleCountW, textColor); } else { @@ -546,7 +548,7 @@ void RomListWidget::drawWidget(bool hilite) if (_selectedItem == pos && _editMode) { adjustOffset(); - s.drawString(_font, editString(), _x + r.x(), ypos, r.width(), kTextColor, + s.drawString(_font, editString(), _x + r.x(), ypos, r.width(), textColor, TextAlign::Left, -_editScrollOffset, false); drawCaret(); @@ -561,7 +563,7 @@ void RomListWidget::drawWidget(bool hilite) { // Draw disassembly, giving it all remaining horizontal space s.drawString(_font, dlist[pos].disasm, xpos + _labelWidth, ypos, - noTypeDisasmW, kTextColor); + noTypeDisasmW, textColor); } } } diff --git a/src/debugger/gui/ToggleBitWidget.cxx b/src/debugger/gui/ToggleBitWidget.cxx index ebd6c1898..11fd8bc3e 100644 --- a/src/debugger/gui/ToggleBitWidget.cxx +++ b/src/debugger/gui/ToggleBitWidget.cxx @@ -73,6 +73,7 @@ void ToggleBitWidget::drawWidget(bool hilite) { //cerr << "ToggleBitWidget::drawWidget\n"; FBSurface& s = dialog().surface(); + bool onTop = _boss->dialog().isOnTop(); int row, col; string buffer; @@ -114,11 +115,11 @@ void ToggleBitWidget::drawWidget(bool hilite) // Highlight changes if(_changedList[pos]) { - s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, kDbgChangedColor); - s.drawString(_font, buffer, x, y, _colWidth, kDbgChangedTextColor); + s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, onTop ? kDbgChangedColor : _bgcolorlo); + s.drawString(_font, buffer, x, y, _colWidth, onTop ? kDbgChangedTextColor : kColor); } else - s.drawString(_font, buffer, x, y, _colWidth, textColor); + s.drawString(_font, buffer, x, y, _colWidth, onTop ? textColor : kColor); } else { diff --git a/src/gui/ColorWidget.cxx b/src/gui/ColorWidget.cxx index 9abcf2d91..e5a49a939 100644 --- a/src/gui/ColorWidget.cxx +++ b/src/gui/ColorWidget.cxx @@ -46,12 +46,13 @@ void ColorWidget::setColor(int color) void ColorWidget::drawWidget(bool hilite) { FBSurface& s = dialog().surface(); + bool onTop = _boss->dialog().isOnTop(); // Draw a thin frame around us. s.frameRect(_x, _y, _w, _h + 1, kColor); // Show the currently selected color - s.fillRect(_x+1, _y+1, _w-2, _h-1, isEnabled() ? _color : kWidColor); + s.fillRect(_x+1, _y+1, _w-2, _h-1, onTop ? isEnabled() ? _color : kWidColor : kDlgColor); // Cross out the grid? if(_crossGrid) diff --git a/src/gui/EditTextWidget.cxx b/src/gui/EditTextWidget.cxx index 8b6ad7679..acf972349 100644 --- a/src/gui/EditTextWidget.cxx +++ b/src/gui/EditTextWidget.cxx @@ -83,7 +83,7 @@ void EditTextWidget::drawWidget(bool hilite) bool onTop = _boss->dialog().isOnTop(); // Highlight changes - if(_changed) + if(_changed && onTop) s.fillRect(_x, _y, _w, _h, kDbgChangedColor); else if(!isEditable()) s.fillRect(_x, _y, _w, _h, onTop ? kDlgColor : kBGColorLo); @@ -94,9 +94,9 @@ void EditTextWidget::drawWidget(bool hilite) // Draw the text adjustOffset(); s.drawString(_font, editString(), _x + 2, _y + 2, getEditRect().width(), - !_changed - ? onTop ? _textcolor : kColor - : uInt32(kDbgChangedTextColor), + _changed && onTop + ? uInt32(kDbgChangedTextColor) + : onTop ? _textcolor : kColor, TextAlign::Left, -_editScrollOffset, false); // Draw the caret diff --git a/src/gui/PopUpWidget.cxx b/src/gui/PopUpWidget.cxx index aaf9d810c..8b2b4b6df 100644 --- a/src/gui/PopUpWidget.cxx +++ b/src/gui/PopUpWidget.cxx @@ -198,6 +198,7 @@ void PopUpWidget::drawWidget(bool hilite) { //cerr << "PopUpWidget::drawWidget\n"; FBSurface& s = dialog().surface(); + bool onTop = _boss->dialog().isOnTop(); int x = _x + _labelWidth; int w = _w - _labelWidth; @@ -205,23 +206,23 @@ void PopUpWidget::drawWidget(bool hilite) // Draw the label, if any if(_labelWidth > 0) s.drawString(_font, _label, _x, _y + myTextY, _labelWidth, - isEnabled() ? _textcolor : uInt32(kColor), TextAlign::Left); + isEnabled() && onTop ? _textcolor : uInt32(kColor), TextAlign::Left); // Draw a thin frame around us. s.frameRect(x, _y, w, _h, isEnabled() && hilite ? kWidColorHi : kColor); s.frameRect(x + w - 16, _y + 1, 15, _h - 2, isEnabled() && hilite ? kWidColorHi : kBGColorLo); // Fill the background - s.fillRect(x + 1, _y + 1, w - 17, _h - 2, _changed ? kDbgChangedColor : kWidColor); - s.fillRect(x + w - 15, _y + 2, 13, _h - 4, isEnabled() && hilite ? kWidColor : kBGColorHi); + s.fillRect(x + 1, _y + 1, w - 17, _h - 2, onTop ? _changed ? kDbgChangedColor : kWidColor : kDlgColor); + s.fillRect(x + w - 15, _y + 2, 13, _h - 4, onTop ? isEnabled() && hilite ? kWidColor : kBGColorHi : kBGColorLo); // Draw an arrow pointing down at the right end to signal this is a dropdown/popup s.drawBitmap(down_arrow, x + w - 13, _y + myArrowsY + 1, - !isEnabled() ? kColor : kTextColor, 9u, 8u); + !(isEnabled() && onTop) ? kColor : kTextColor, 9u, 8u); // Draw the selected entry, if any const string& name = myMenu->getSelectedName(); TextAlign align = (_font.getStringWidth(name) > w-6) ? TextAlign::Right : TextAlign::Left; s.drawString(_font, name, x+2, _y+myTextY, w-6, - !isEnabled() ? kColor : kTextColor, align); + !(isEnabled() && onTop) ? kColor : kTextColor, align); } diff --git a/src/gui/ScrollBarWidget.cxx b/src/gui/ScrollBarWidget.cxx index 8e3960965..3370eac79 100644 --- a/src/gui/ScrollBarWidget.cxx +++ b/src/gui/ScrollBarWidget.cxx @@ -249,6 +249,7 @@ void ScrollBarWidget::drawWidget(bool hilite) { //cerr << "ScrollBarWidget::drawWidget\n"; FBSurface& s = _boss->dialog().surface(); + bool onTop = _boss->dialog().isOnTop(); int bottomY = _y + _h; bool isSinglePage = (_numEntries <= _entriesPerPage); @@ -273,7 +274,7 @@ void ScrollBarWidget::drawWidget(bool hilite) if(!isSinglePage) { s.fillRect(_x + 1, _y + _sliderPos - 1, _w - 2, _sliderHeight + 2, - (hilite && _part == kSliderPart) ? kScrollColorHi : kScrollColor); + onTop ? (hilite && _part == kSliderPart) ? kScrollColorHi : kScrollColor : kColor); } } diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index f77d0e057..79a53b12b 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -645,8 +645,8 @@ void CheckboxWidget::drawWidget(bool hilite) if(_drawBox) s.frameRect(_x, _y + _boxY, 14, 14, onTop && hilite && isEnabled() && isEditable() ? kWidColorHi : kColor); // Do we draw a square or cross? - s.fillRect(_x + 1, _y + _boxY + 1, 12, 12, _changed ? uInt32(kDbgChangedColor) - : isEnabled() ? _bgcolor : uInt32(kColor)); + s.fillRect(_x + 1, _y + _boxY + 1, 12, 12, _changed ? onTop ? uInt32(kDbgChangedColor) : kDlgColor + : isEnabled() ? onTop ? _bgcolor : kDlgColor : uInt32(kColor)); if(_state) s.drawBitmap(_img, _x + 2, _y + _boxY + 2, onTop && isEnabled() ? hilite && isEditable() ? kWidColorHi : kCheckColor : kColor, 10);