mirror of https://github.com/stella-emu/stella.git
FLAT_UI label default alignment fix
This commit is contained in:
parent
200b5cfe87
commit
df71881392
|
@ -351,9 +351,15 @@ void DebuggerDialog::addTabArea()
|
||||||
int tabID;
|
int tabID;
|
||||||
|
|
||||||
// The Prompt/console tab
|
// The Prompt/console tab
|
||||||
|
#ifndef FLAT_UI
|
||||||
tabID = myTab->addTab(" Prompt ");
|
tabID = myTab->addTab(" Prompt ");
|
||||||
myPrompt = new PromptWidget(myTab, *myNFont,
|
myPrompt = new PromptWidget(myTab, *myNFont,
|
||||||
2, 2, widWidth, widHeight);
|
2, 2, widWidth, widHeight);
|
||||||
|
#else
|
||||||
|
tabID = myTab->addTab("Prompt");
|
||||||
|
myPrompt = new PromptWidget(myTab, *myNFont,
|
||||||
|
2, 2, widWidth - 4, widHeight);
|
||||||
|
#endif
|
||||||
myTab->setParentWidget(tabID, myPrompt);
|
myTab->setParentWidget(tabID, myPrompt);
|
||||||
addToFocusList(myPrompt->getFocusList(), myTab, tabID);
|
addToFocusList(myPrompt->getFocusList(), myTab, tabID);
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ PopUpWidget::PopUpWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
{
|
{
|
||||||
_flags = WIDGET_ENABLED | WIDGET_RETAIN_FOCUS;
|
_flags = WIDGET_ENABLED | WIDGET_RETAIN_FOCUS;
|
||||||
_bgcolor = kDlgColor;
|
_bgcolor = kDlgColor;
|
||||||
_bgcolorhi = kDlgColor; // do not highlight the label
|
_bgcolorhi = kDlgColor; // do not highlight the background
|
||||||
_textcolor = kTextColor;
|
_textcolor = kTextColor;
|
||||||
_textcolorhi = kTextColor; // do not highlight the label
|
_textcolorhi = kTextColor; // do not highlight the label
|
||||||
|
|
||||||
|
@ -218,29 +218,33 @@ void PopUpWidget::drawWidget(bool hilite)
|
||||||
int x = _x + _labelWidth;
|
int x = _x + _labelWidth;
|
||||||
int w = _w - _labelWidth;
|
int w = _w - _labelWidth;
|
||||||
|
|
||||||
|
#ifndef FLAT_UI
|
||||||
// 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::Right);
|
isEnabled() ? _textcolor : uInt32(kColor), TextAlign::Right);
|
||||||
|
|
||||||
#ifndef FLAT_UI
|
|
||||||
// Draw a thin frame around us.
|
// Draw a thin frame around us.
|
||||||
s.hLine(x, _y, x + w - 1, kColor);
|
s.hLine(x, _y, x + w - 1, kColor);
|
||||||
s.hLine(x, _y +_h-1, x + w - 1, kShadowColor);
|
s.hLine(x, _y +_h-1, x + w - 1, kShadowColor);
|
||||||
s.vLine(x, _y, _y+_h-1, kColor);
|
s.vLine(x, _y, _y+_h-1, kColor);
|
||||||
s.vLine(x + w - 1, _y, _y +_h - 1, kShadowColor);
|
s.vLine(x + w - 1, _y, _y +_h - 1, kShadowColor);
|
||||||
#else
|
|
||||||
s.frameRect(x, _y, w, _h, kColor);
|
|
||||||
s.frameRect(x + w - 16, _y + 1, 15, _h - 2, hilite ? kTextColorHi : kBGColorLo);
|
|
||||||
#endif // !FLAT_UI
|
|
||||||
|
|
||||||
#ifndef FLAT_UI
|
|
||||||
// Fill the background
|
// Fill the background
|
||||||
s.fillRect(x + 1, _y + 1, w - 2, _h - 2, kWidColor);
|
s.fillRect(x + 1, _y + 1, w - 2, _h - 2, kWidColor);
|
||||||
// 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(up_down_arrows, x+w - 10, _y + myArrowsY,
|
s.drawBitmap(up_down_arrows, x + w - 10, _y + myArrowsY,
|
||||||
!isEnabled() ? kColor : hilite ? kTextColorHi : kTextColor);
|
!isEnabled() ? kColor : hilite ? kTextColorHi : kTextColor);
|
||||||
#else
|
#else
|
||||||
|
// Draw the label, if any
|
||||||
|
if(_labelWidth > 0)
|
||||||
|
s.drawString(_font, _label, _x, _y + myTextY, _labelWidth,
|
||||||
|
isEnabled() ? _textcolor : uInt32(kColor), TextAlign::Left);
|
||||||
|
|
||||||
|
// Draw a thin frame around us.
|
||||||
|
s.frameRect(x, _y, w, _h, kColor);
|
||||||
|
s.frameRect(x + w - 16, _y + 1, 15, _h - 2, hilite ? kTextColorHi : kBGColorLo);
|
||||||
|
|
||||||
// Fill the background
|
// Fill the background
|
||||||
s.fillRect(x + 1, _y + 1, w - 17, _h - 2, kWidColor);
|
s.fillRect(x + 1, _y + 1, w - 17, _h - 2, kWidColor);
|
||||||
s.fillRect(x + w - 15, _y + 2, 13, _h - 4, kBGColorHi);
|
s.fillRect(x + w - 15, _y + 2, 13, _h - 4, kBGColorHi);
|
||||||
|
|
|
@ -329,6 +329,9 @@ void TabWidget::drawWidget(bool hilite)
|
||||||
s.vLine(_x + _w - 2, _y + _tabHeight - 1, _y + _h - 2, kColor);
|
s.vLine(_x + _w - 2, _y + _tabHeight - 1, _y + _h - 2, kColor);
|
||||||
s.vLine(_x + _w - 1, _y + _tabHeight - 1, _y + _h - 2, kShadowColor);
|
s.vLine(_x + _w - 1, _y + _tabHeight - 1, _y + _h - 2, kShadowColor);
|
||||||
#else
|
#else
|
||||||
|
/*s.fillRect(x, _y, _w - x, _tabHeight - 1, kDlgColor); // ? kWidColor : kDlgColor
|
||||||
|
s.hLine(x, _y + _tabHeight, _w - x, kScrollColorHi);*/
|
||||||
|
|
||||||
s.hLine(right1, _y, left2 - 1, kScrollColorHi);
|
s.hLine(right1, _y, left2 - 1, kScrollColorHi);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,11 +92,13 @@ class TabWidget : public Widget, public CommandSender
|
||||||
enum {
|
enum {
|
||||||
#ifndef FLAT_UI
|
#ifndef FLAT_UI
|
||||||
kTabLeftOffset = 4,
|
kTabLeftOffset = 4,
|
||||||
#else
|
|
||||||
kTabLeftOffset = 0,
|
|
||||||
#endif
|
|
||||||
kTabSpacing = 2,
|
kTabSpacing = 2,
|
||||||
kTabPadding = 3
|
kTabPadding = 3
|
||||||
|
#else
|
||||||
|
kTabLeftOffset = 0,
|
||||||
|
kTabSpacing = 1,
|
||||||
|
kTabPadding = 4
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -792,11 +792,12 @@ void SliderWidget::drawWidget(bool hilite)
|
||||||
{
|
{
|
||||||
FBSurface& s = _boss->dialog().surface();
|
FBSurface& s = _boss->dialog().surface();
|
||||||
|
|
||||||
|
#ifndef FLAT_UI
|
||||||
// Draw the label, if any
|
// Draw the label, if any
|
||||||
if(_labelWidth > 0)
|
if(_labelWidth > 0)
|
||||||
s.drawString(_font, _label, _x, _y + 2, _labelWidth,
|
s.drawString(_font, _label, _x, _y + 2, _labelWidth,
|
||||||
isEnabled() ? kTextColor : kColor, TextAlign::Right);
|
isEnabled() ? kTextColor : kColor, TextAlign::Right);
|
||||||
#ifndef FLAT_UI
|
|
||||||
// Draw the box
|
// Draw the box
|
||||||
s.box(_x + _labelWidth, _y, _w - _labelWidth, _h, kColor, kShadowColor);
|
s.box(_x + _labelWidth, _y, _w - _labelWidth, _h, kColor, kShadowColor);
|
||||||
// Fill the box
|
// Fill the box
|
||||||
|
@ -806,6 +807,11 @@ void SliderWidget::drawWidget(bool hilite)
|
||||||
s.fillRect(_x + _labelWidth + 2, _y + 2, valueToPos(_value), _h - 4,
|
s.fillRect(_x + _labelWidth + 2, _y + 2, valueToPos(_value), _h - 4,
|
||||||
!isEnabled() ? kColor : hilite ? kSliderColorHi : kSliderColor);
|
!isEnabled() ? kColor : hilite ? kSliderColorHi : kSliderColor);
|
||||||
#else
|
#else
|
||||||
|
// Draw the label, if any
|
||||||
|
if(_labelWidth > 0)
|
||||||
|
s.drawString(_font, _label, _x, _y + 2, _labelWidth,
|
||||||
|
isEnabled() ? kTextColor : kColor, TextAlign::Left);
|
||||||
|
|
||||||
// Draw the box
|
// Draw the box
|
||||||
s.frameRect(_x + _labelWidth, _y, _w - _labelWidth, _h, hilite ? kSliderColorHi : kShadowColor);
|
s.frameRect(_x + _labelWidth, _y, _w - _labelWidth, _h, hilite ? kSliderColorHi : kShadowColor);
|
||||||
// Fill the box
|
// Fill the box
|
||||||
|
|
Loading…
Reference in New Issue