polishing FLAT_UI

This commit is contained in:
thrust26 2017-12-17 12:16:37 +01:00
parent b05d686891
commit eeb1491efd
5 changed files with 46 additions and 3 deletions

View File

@ -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++)

View File

@ -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++)

View File

@ -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;
}
}

View File

@ -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
}
};

View File

@ -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();