mirror of https://github.com/stella-emu/stella.git
even more background dialog widget color adjustments
This commit is contained in:
parent
0b04b130f9
commit
573d9a1e25
|
@ -593,9 +593,10 @@ void DataGridWidget::handleCommand(CommandSender* sender, int cmd,
|
||||||
void DataGridWidget::drawWidget(bool hilite)
|
void DataGridWidget::drawWidget(bool hilite)
|
||||||
{
|
{
|
||||||
FBSurface& s = _boss->dialog().surface();
|
FBSurface& s = _boss->dialog().surface();
|
||||||
|
bool onTop = _boss->dialog().isOnTop();
|
||||||
int row, col;
|
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
|
// Draw the internal grid and labels
|
||||||
int linewidth = _cols * _colWidth;
|
int linewidth = _cols * _colWidth;
|
||||||
s.frameRect(_x, _y, _w, _h, hilite && isEnabled() && isEditable() ? kWidColorHi : kColor);
|
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 x = _x + 4 + (col * _colWidth);
|
||||||
int y = _y + 2 + (row * _rowHeight);
|
int y = _y + 2 + (row * _rowHeight);
|
||||||
int pos = row*_cols + col;
|
int pos = row*_cols + col;
|
||||||
uInt32 textColor = kTextColor;
|
uInt32 textColor = onTop ? kTextColor : kColor;
|
||||||
|
|
||||||
// Draw the selected item inverted, on a highlighted background.
|
// Draw the selected item inverted, on a highlighted background.
|
||||||
if (_currentRow == row && _currentCol == col &&
|
if (_currentRow == row && _currentCol == col &&
|
||||||
|
@ -634,12 +635,12 @@ void DataGridWidget::drawWidget(bool hilite)
|
||||||
{
|
{
|
||||||
if(_changedList[pos])
|
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])
|
if(_hiliteList[pos])
|
||||||
textColor = kDbgColorHi;
|
textColor = kDbgColorHi;
|
||||||
else
|
else
|
||||||
textColor = kDbgChangedTextColor;
|
textColor = onTop ? kDbgChangedTextColor : textColor;
|
||||||
}
|
}
|
||||||
else if(_hiliteList[pos])
|
else if(_hiliteList[pos])
|
||||||
textColor = kDbgColorHi;
|
textColor = kDbgColorHi;
|
||||||
|
|
|
@ -45,6 +45,7 @@ PromptWidget::PromptWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
WIDGET_WANTS_TAB | WIDGET_WANTS_RAWDATA;
|
WIDGET_WANTS_TAB | WIDGET_WANTS_RAWDATA;
|
||||||
_textcolor = kTextColor;
|
_textcolor = kTextColor;
|
||||||
_bgcolor = kWidColor;
|
_bgcolor = kWidColor;
|
||||||
|
_bgcolorlo = kDlgColor;
|
||||||
|
|
||||||
_kConsoleCharWidth = font.getMaxCharWidth();
|
_kConsoleCharWidth = font.getMaxCharWidth();
|
||||||
_kConsoleCharHeight = font.getFontHeight();
|
_kConsoleCharHeight = font.getFontHeight();
|
||||||
|
@ -74,6 +75,7 @@ void PromptWidget::drawWidget(bool hilite)
|
||||||
uInt32 fgcolor, bgcolor;
|
uInt32 fgcolor, bgcolor;
|
||||||
|
|
||||||
FBSurface& s = _boss->dialog().surface();
|
FBSurface& s = _boss->dialog().surface();
|
||||||
|
bool onTop = _boss->dialog().isOnTop();
|
||||||
|
|
||||||
// Draw text
|
// Draw text
|
||||||
int start = _scrollLine - _linesPerPage + 1;
|
int start = _scrollLine - _linesPerPage + 1;
|
||||||
|
@ -94,7 +96,7 @@ void PromptWidget::drawWidget(bool hilite)
|
||||||
else
|
else
|
||||||
fgcolor = c >> 8;
|
fgcolor = c >> 8;
|
||||||
|
|
||||||
s.drawChar(_font, c & 0x7f, x, y, fgcolor);
|
s.drawChar(_font, c & 0x7f, x, y, onTop ? fgcolor : kColor);
|
||||||
x += _kConsoleCharWidth;
|
x += _kConsoleCharWidth;
|
||||||
}
|
}
|
||||||
y += _kConsoleLineHeight;
|
y += _kConsoleLineHeight;
|
||||||
|
|
|
@ -465,8 +465,10 @@ void RomListWidget::lostFocusWidget()
|
||||||
void RomListWidget::drawWidget(bool hilite)
|
void RomListWidget::drawWidget(bool hilite)
|
||||||
{
|
{
|
||||||
FBSurface& s = _boss->dialog().surface();
|
FBSurface& s = _boss->dialog().surface();
|
||||||
|
bool onTop = _boss->dialog().isOnTop();
|
||||||
const CartDebug::DisassemblyList& dlist = myDisasm->list;
|
const CartDebug::DisassemblyList& dlist = myDisasm->list;
|
||||||
int i, pos, xpos, ypos, len = int(dlist.size());
|
int i, pos, xpos, ypos, len = int(dlist.size());
|
||||||
|
uInt32 textColor = onTop ? kTextColor : kColor;
|
||||||
|
|
||||||
const GUI::Rect& r = getEditRect();
|
const GUI::Rect& r = getEditRect();
|
||||||
const GUI::Rect& l = getLineRect();
|
const GUI::Rect& l = getLineRect();
|
||||||
|
@ -487,7 +489,7 @@ void RomListWidget::drawWidget(bool hilite)
|
||||||
xpos = _x + CheckboxWidget::boxSize() + 10; ypos = _y + 2;
|
xpos = _x + CheckboxWidget::boxSize() + 10; ypos = _y + 2;
|
||||||
for (i = 0, pos = _currentPos; i < _rows && pos < len; i++, pos++, ypos += _fontHeight)
|
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)
|
// Draw checkboxes for correct lines (takes scrolling into account)
|
||||||
myCheckList[i]->setState(myBPState->isSet(dlist[pos].address));
|
myCheckList[i]->setState(myBPState->isSet(dlist[pos].address));
|
||||||
|
@ -496,7 +498,7 @@ void RomListWidget::drawWidget(bool hilite)
|
||||||
|
|
||||||
// Draw highlighted item in a frame
|
// Draw highlighted item in a frame
|
||||||
if (_highlightedItem == pos)
|
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.
|
// Draw the selected item inverted, on a highlighted background.
|
||||||
if(_selectedItem == pos && _hasFocus)
|
if(_selectedItem == pos && _hasFocus)
|
||||||
|
@ -512,7 +514,7 @@ void RomListWidget::drawWidget(bool hilite)
|
||||||
|
|
||||||
// Draw labels
|
// Draw labels
|
||||||
s.drawString(_font, dlist[pos].label, xpos, ypos, _labelWidth,
|
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
|
// Bytes are only editable if they represent code, graphics, or accessible data
|
||||||
// Otherwise, the disassembly should get all remaining space
|
// Otherwise, the disassembly should get all remaining space
|
||||||
|
@ -522,14 +524,14 @@ void RomListWidget::drawWidget(bool hilite)
|
||||||
{
|
{
|
||||||
// Draw mnemonic
|
// Draw mnemonic
|
||||||
s.drawString(_font, dlist[pos].disasm.substr(0, 7), xpos + _labelWidth, ypos,
|
s.drawString(_font, dlist[pos].disasm.substr(0, 7), xpos + _labelWidth, ypos,
|
||||||
7 * _fontWidth, kTextColor);
|
7 * _fontWidth, textColor);
|
||||||
// Draw operand
|
// Draw operand
|
||||||
if (dlist[pos].disasm.length() > 8)
|
if (dlist[pos].disasm.length() > 8)
|
||||||
s.drawString(_font, dlist[pos].disasm.substr(8), xpos + _labelWidth + 7 * _fontWidth, ypos,
|
s.drawString(_font, dlist[pos].disasm.substr(8), xpos + _labelWidth + 7 * _fontWidth, ypos,
|
||||||
codeDisasmW - 7 * _fontWidth, kTextColor);
|
codeDisasmW - 7 * _fontWidth, textColor);
|
||||||
// Draw cycle count
|
// Draw cycle count
|
||||||
s.drawString(_font, dlist[pos].ccount, xpos + _labelWidth + codeDisasmW, ypos,
|
s.drawString(_font, dlist[pos].ccount, xpos + _labelWidth + codeDisasmW, ypos,
|
||||||
cycleCountW, kTextColor);
|
cycleCountW, textColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -546,7 +548,7 @@ void RomListWidget::drawWidget(bool hilite)
|
||||||
if (_selectedItem == pos && _editMode)
|
if (_selectedItem == pos && _editMode)
|
||||||
{
|
{
|
||||||
adjustOffset();
|
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);
|
TextAlign::Left, -_editScrollOffset, false);
|
||||||
|
|
||||||
drawCaret();
|
drawCaret();
|
||||||
|
@ -561,7 +563,7 @@ void RomListWidget::drawWidget(bool hilite)
|
||||||
{
|
{
|
||||||
// Draw disassembly, giving it all remaining horizontal space
|
// Draw disassembly, giving it all remaining horizontal space
|
||||||
s.drawString(_font, dlist[pos].disasm, xpos + _labelWidth, ypos,
|
s.drawString(_font, dlist[pos].disasm, xpos + _labelWidth, ypos,
|
||||||
noTypeDisasmW, kTextColor);
|
noTypeDisasmW, textColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,7 @@ void ToggleBitWidget::drawWidget(bool hilite)
|
||||||
{
|
{
|
||||||
//cerr << "ToggleBitWidget::drawWidget\n";
|
//cerr << "ToggleBitWidget::drawWidget\n";
|
||||||
FBSurface& s = dialog().surface();
|
FBSurface& s = dialog().surface();
|
||||||
|
bool onTop = _boss->dialog().isOnTop();
|
||||||
int row, col;
|
int row, col;
|
||||||
string buffer;
|
string buffer;
|
||||||
|
|
||||||
|
@ -114,11 +115,11 @@ void ToggleBitWidget::drawWidget(bool hilite)
|
||||||
// Highlight changes
|
// Highlight changes
|
||||||
if(_changedList[pos])
|
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);
|
||||||
s.drawString(_font, buffer, x, y, _colWidth, kDbgChangedTextColor);
|
s.drawString(_font, buffer, x, y, _colWidth, onTop ? kDbgChangedTextColor : kColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
s.drawString(_font, buffer, x, y, _colWidth, textColor);
|
s.drawString(_font, buffer, x, y, _colWidth, onTop ? textColor : kColor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,12 +46,13 @@ void ColorWidget::setColor(int color)
|
||||||
void ColorWidget::drawWidget(bool hilite)
|
void ColorWidget::drawWidget(bool hilite)
|
||||||
{
|
{
|
||||||
FBSurface& s = dialog().surface();
|
FBSurface& s = dialog().surface();
|
||||||
|
bool onTop = _boss->dialog().isOnTop();
|
||||||
|
|
||||||
// Draw a thin frame around us.
|
// Draw a thin frame around us.
|
||||||
s.frameRect(_x, _y, _w, _h + 1, kColor);
|
s.frameRect(_x, _y, _w, _h + 1, kColor);
|
||||||
|
|
||||||
// Show the currently selected color
|
// 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?
|
// Cross out the grid?
|
||||||
if(_crossGrid)
|
if(_crossGrid)
|
||||||
|
|
|
@ -83,7 +83,7 @@ void EditTextWidget::drawWidget(bool hilite)
|
||||||
bool onTop = _boss->dialog().isOnTop();
|
bool onTop = _boss->dialog().isOnTop();
|
||||||
|
|
||||||
// Highlight changes
|
// Highlight changes
|
||||||
if(_changed)
|
if(_changed && onTop)
|
||||||
s.fillRect(_x, _y, _w, _h, kDbgChangedColor);
|
s.fillRect(_x, _y, _w, _h, kDbgChangedColor);
|
||||||
else if(!isEditable())
|
else if(!isEditable())
|
||||||
s.fillRect(_x, _y, _w, _h, onTop ? kDlgColor : kBGColorLo);
|
s.fillRect(_x, _y, _w, _h, onTop ? kDlgColor : kBGColorLo);
|
||||||
|
@ -94,9 +94,9 @@ void EditTextWidget::drawWidget(bool hilite)
|
||||||
// Draw the text
|
// Draw the text
|
||||||
adjustOffset();
|
adjustOffset();
|
||||||
s.drawString(_font, editString(), _x + 2, _y + 2, getEditRect().width(),
|
s.drawString(_font, editString(), _x + 2, _y + 2, getEditRect().width(),
|
||||||
!_changed
|
_changed && onTop
|
||||||
? onTop ? _textcolor : kColor
|
? uInt32(kDbgChangedTextColor)
|
||||||
: uInt32(kDbgChangedTextColor),
|
: onTop ? _textcolor : kColor,
|
||||||
TextAlign::Left, -_editScrollOffset, false);
|
TextAlign::Left, -_editScrollOffset, false);
|
||||||
|
|
||||||
// Draw the caret
|
// Draw the caret
|
||||||
|
|
|
@ -198,6 +198,7 @@ void PopUpWidget::drawWidget(bool hilite)
|
||||||
{
|
{
|
||||||
//cerr << "PopUpWidget::drawWidget\n";
|
//cerr << "PopUpWidget::drawWidget\n";
|
||||||
FBSurface& s = dialog().surface();
|
FBSurface& s = dialog().surface();
|
||||||
|
bool onTop = _boss->dialog().isOnTop();
|
||||||
|
|
||||||
int x = _x + _labelWidth;
|
int x = _x + _labelWidth;
|
||||||
int w = _w - _labelWidth;
|
int w = _w - _labelWidth;
|
||||||
|
@ -205,23 +206,23 @@ void PopUpWidget::drawWidget(bool hilite)
|
||||||
// Draw the label, if any
|
// Draw the label, if any
|
||||||
if(_labelWidth > 0)
|
if(_labelWidth > 0)
|
||||||
s.drawString(_font, _label, _x, _y + myTextY, _labelWidth,
|
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.
|
// Draw a thin frame around us.
|
||||||
s.frameRect(x, _y, w, _h, isEnabled() && hilite ? kWidColorHi : kColor);
|
s.frameRect(x, _y, w, _h, isEnabled() && hilite ? kWidColorHi : kColor);
|
||||||
s.frameRect(x + w - 16, _y + 1, 15, _h - 2, isEnabled() && hilite ? kWidColorHi : kBGColorLo);
|
s.frameRect(x + w - 16, _y + 1, 15, _h - 2, isEnabled() && hilite ? kWidColorHi : kBGColorLo);
|
||||||
|
|
||||||
// Fill the background
|
// Fill the background
|
||||||
s.fillRect(x + 1, _y + 1, w - 17, _h - 2, _changed ? kDbgChangedColor : kWidColor);
|
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, isEnabled() && hilite ? kWidColor : kBGColorHi);
|
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
|
// 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,
|
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
|
// Draw the selected entry, if any
|
||||||
const string& name = myMenu->getSelectedName();
|
const string& name = myMenu->getSelectedName();
|
||||||
TextAlign align = (_font.getStringWidth(name) > w-6) ?
|
TextAlign align = (_font.getStringWidth(name) > w-6) ?
|
||||||
TextAlign::Right : TextAlign::Left;
|
TextAlign::Right : TextAlign::Left;
|
||||||
s.drawString(_font, name, x+2, _y+myTextY, w-6,
|
s.drawString(_font, name, x+2, _y+myTextY, w-6,
|
||||||
!isEnabled() ? kColor : kTextColor, align);
|
!(isEnabled() && onTop) ? kColor : kTextColor, align);
|
||||||
}
|
}
|
||||||
|
|
|
@ -249,6 +249,7 @@ void ScrollBarWidget::drawWidget(bool hilite)
|
||||||
{
|
{
|
||||||
//cerr << "ScrollBarWidget::drawWidget\n";
|
//cerr << "ScrollBarWidget::drawWidget\n";
|
||||||
FBSurface& s = _boss->dialog().surface();
|
FBSurface& s = _boss->dialog().surface();
|
||||||
|
bool onTop = _boss->dialog().isOnTop();
|
||||||
int bottomY = _y + _h;
|
int bottomY = _y + _h;
|
||||||
bool isSinglePage = (_numEntries <= _entriesPerPage);
|
bool isSinglePage = (_numEntries <= _entriesPerPage);
|
||||||
|
|
||||||
|
@ -273,7 +274,7 @@ void ScrollBarWidget::drawWidget(bool hilite)
|
||||||
if(!isSinglePage)
|
if(!isSinglePage)
|
||||||
{
|
{
|
||||||
s.fillRect(_x + 1, _y + _sliderPos - 1, _w - 2, _sliderHeight + 2,
|
s.fillRect(_x + 1, _y + _sliderPos - 1, _w - 2, _sliderHeight + 2,
|
||||||
(hilite && _part == kSliderPart) ? kScrollColorHi : kScrollColor);
|
onTop ? (hilite && _part == kSliderPart) ? kScrollColorHi : kScrollColor : kColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -645,8 +645,8 @@ void CheckboxWidget::drawWidget(bool hilite)
|
||||||
if(_drawBox)
|
if(_drawBox)
|
||||||
s.frameRect(_x, _y + _boxY, 14, 14, onTop && hilite && isEnabled() && isEditable() ? kWidColorHi : kColor);
|
s.frameRect(_x, _y + _boxY, 14, 14, onTop && hilite && isEnabled() && isEditable() ? kWidColorHi : kColor);
|
||||||
// Do we draw a square or cross?
|
// Do we draw a square or cross?
|
||||||
s.fillRect(_x + 1, _y + _boxY + 1, 12, 12, _changed ? uInt32(kDbgChangedColor)
|
s.fillRect(_x + 1, _y + _boxY + 1, 12, 12, _changed ? onTop ? uInt32(kDbgChangedColor) : kDlgColor
|
||||||
: isEnabled() ? _bgcolor : uInt32(kColor));
|
: isEnabled() ? onTop ? _bgcolor : kDlgColor : uInt32(kColor));
|
||||||
if(_state)
|
if(_state)
|
||||||
s.drawBitmap(_img, _x + 2, _y + _boxY + 2, onTop && isEnabled() ? hilite && isEditable() ? kWidColorHi : kCheckColor
|
s.drawBitmap(_img, _x + 2, _y + _boxY + 2, onTop && isEnabled() ? hilite && isEditable() ? kWidColorHi : kCheckColor
|
||||||
: kColor, 10);
|
: kColor, 10);
|
||||||
|
|
Loading…
Reference in New Issue