From eeb1491efd575a9fe019977d552bec59c06df264 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Sun, 17 Dec 2017 12:16:37 +0100 Subject: [PATCH] polishing FLAT_UI --- src/debugger/gui/DataGridWidget.cxx | 12 ++++++++++++ src/debugger/gui/ToggleBitWidget.cxx | 10 ++++++++++ src/emucore/FBSurface.cxx | 13 +++++++++++++ src/emucore/FrameBuffer.cxx | 4 ++-- src/gui/EditTextWidget.cxx | 10 +++++++++- 5 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/debugger/gui/DataGridWidget.cxx b/src/debugger/gui/DataGridWidget.cxx index c4bbf0d6d..898282016 100644 --- a/src/debugger/gui/DataGridWidget.cxx +++ b/src/debugger/gui/DataGridWidget.cxx @@ -584,11 +584,23 @@ void DataGridWidget::drawWidget(bool hilite) // Draw the internal grid and labels int linewidth = _cols * _colWidth; +#ifndef FLAT_UI for (row = 0; row <= _rows; row++) s.hLine(_x, _y + (row * _rowHeight), _x + linewidth, kColor); int lineheight = _rows * _rowHeight; for (col = 0; col <= _cols; col++) s.vLine(_x + (col * _colWidth), _y, _y + lineheight, kColor); +#else + s.frameRect(_x, _y, _w, _h, kColor); + for(row = 1; row <= _rows-1; row++) + s.hLine(_x+1, _y + (row * _rowHeight), _x + linewidth-1, kBGColorLo); + + int lineheight = _rows * _rowHeight; + for(col = 1; col <= _cols-1; col++) + s.vLine(_x + (col * _colWidth), _y+1, _y + lineheight-1, kBGColorLo); +#endif + + // Draw the list items for (row = 0; row < _rows; row++) diff --git a/src/debugger/gui/ToggleBitWidget.cxx b/src/debugger/gui/ToggleBitWidget.cxx index b42d98563..8a94cad44 100644 --- a/src/debugger/gui/ToggleBitWidget.cxx +++ b/src/debugger/gui/ToggleBitWidget.cxx @@ -78,11 +78,21 @@ void ToggleBitWidget::drawWidget(bool hilite) // Draw the internal grid and labels int linewidth = _cols * _colWidth; +#ifndef FLAT_UI for (row = 0; row <= _rows; row++) s.hLine(_x, _y + (row * _rowHeight), _x + linewidth, kColor); int lineheight = _rows * _rowHeight; for (col = 0; col <= _cols; col++) s.vLine(_x + (col * _colWidth), _y, _y + lineheight, kColor); +#else + s.frameRect(_x, _y, _w, _h, kColor); + for(row = 1; row <= _rows - 1; row++) + s.hLine(_x + 1, _y + (row * _rowHeight), _x + linewidth - 1, kBGColorLo); + + int lineheight = _rows * _rowHeight; + for(col = 1; col <= _cols - 1; col++) + s.vLine(_x + (col * _colWidth), _y + 1, _y + lineheight - 1, kBGColorLo); +#endif // Draw the list items for (row = 0; row < _rows; row++) diff --git a/src/emucore/FBSurface.cxx b/src/emucore/FBSurface.cxx index 27b048fbf..c5c39b961 100644 --- a/src/emucore/FBSurface.cxx +++ b/src/emucore/FBSurface.cxx @@ -194,6 +194,7 @@ void FBSurface::frameRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, case FrameStyle::Dashed: uInt32 i, skip, lwidth = 1; +#ifndef FLAT_UI for(i = x, skip = 1; i < x+w-1; i=i+lwidth+1, ++skip) { if(skip % 2) @@ -210,6 +211,18 @@ void FBSurface::frameRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, vLine(x + w - 1, i, i + lwidth, color); } } +#else + for(i = x; i < x + w; i += 2) + { + hLine(i, y, i, color); + hLine(i, y + h - 1, i, color); + } + for(i = y; i < y + h; i += 2) + { + vLine(x, i, i, color); + vLine(x + w - 1, i, i, color); + } +#endif break; } } diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index e2fd2afa5..b432f646d 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -971,13 +971,13 @@ uInt32 FrameBuffer::ourGUIColors[3][kNumColors-256] = { }, // Light { - 0x686868, 0x000000, 0xc0c0c0, 0xe1e1e1, 0x333333, // base + 0x808080, 0x000000, 0xc0c0c0, 0xe1e1e1, 0x333333, // base 0x000000, 0x0078d7, 0x0078d7, 0xffffff, // text 0xf0f0f0, 0xffffff, 0x0f0f0f, // elements 0xe1e1e1, 0xe5f1fb, 0x202020, 0x000000, // buttons 0x333333, // checkbox 0x808080, 0x0078d7, // scrollbar 0x333333, 0x0078d7, // slider - 0xffc0c0, 0x000000, 0xe00000, 0x800000 // debugger + 0xffc0c0, 0x000000, 0xe00000, 0xc00000 // debugger } }; diff --git a/src/gui/EditTextWidget.cxx b/src/gui/EditTextWidget.cxx index 11802d365..2f330d978 100644 --- a/src/gui/EditTextWidget.cxx +++ b/src/gui/EditTextWidget.cxx @@ -71,13 +71,21 @@ void EditTextWidget::drawWidget(bool hilite) if(_changed) s.fillRect(_x, _y, _w, _h, kDbgChangedColor); else if(!isEditable()) - s.fillRect(_x, _y, _w, _h, kBGColorHi); +#ifndef FLAT_UI + s.fillRect(_x, _y, _w, _h, kBGColorHi); +#else + s.fillRect(_x, _y, _w, _h, kDlgColor); +#endif // Draw a thin frame around us. +#ifndef FLAT_UI 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.vLine(_x + _w - 1, _y, _y + _h - 1, kShadowColor); +#else + s.frameRect(_x, _y, _w, _h, kColor); +#endif // Draw the text adjustOffset();