- fixed the spacing for the sliders.

- moved the scroll indicators in the menu to the right and use a brighter color for them - the old ones were only barely visible.
This commit is contained in:
Christoph Oelckers 2019-03-17 18:14:12 +01:00
parent 1beaa8da58
commit 95adbc58a8
3 changed files with 14 additions and 10 deletions

View file

@ -310,6 +310,14 @@ class Menu : Object native ui version("2.4")
return OptionFont().StringWidth(s);
}
static void DrawOptionText(int x, int y, int color, String text, bool grayed = false)
{
String label = Stringtable.Localize(text);
int overlay = grayed? Color(96,48,0,0) : 0;
screen.DrawText (OptionFont(), OptionColor(color), x, y, text, DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay);
}
}
class MenuDescriptor : Object native ui version("2.4")

View file

@ -480,11 +480,11 @@ class OptionMenu : Menu
if (CanScrollUp)
{
DrawConText(Font.CR_ORANGE, 3 * CleanXfac_1, ytop, "\x1a");
DrawOptionText(screen.GetWidth() - 11 * CleanXfac_1, ytop, Font.CR_UNTRANSLATED, "▲");
}
if (CanScrollDown)
{
DrawConText(Font.CR_ORANGE, 3 * CleanXfac_1, y - 8*CleanYfac_1, "\x1b");
DrawOptionText(screen.GetWidth() - 11 * CleanXfac_1 , y - 8*CleanYfac_1, Font.CR_UNTRANSLATED, "▼");
}
Super.Drawer();
}

View file

@ -46,11 +46,7 @@ class OptionMenuItem : MenuItemBase
protected void drawText(int x, int y, int color, String text, bool grayed = false)
{
String label = Stringtable.Localize(mLabel);
int overlay = grayed? Color(96,48,0,0) : 0;
screen.DrawText (Menu.OptionFont(), Menu.OptionColor(color), x, y, text, DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay);
Menu.DrawOptionText(x, y, color, text, grayed);
}
protected int drawLabel(int indent, int y, int color, bool grayed = false)
@ -61,13 +57,13 @@ class OptionMenuItem : MenuItemBase
int w = Menu.OptionWidth(label) * CleanXfac_1;
if (!mCentered) x = indent - w;
else x = (screen.GetWidth() - w) / 2;
DrawText(x, y, color, label, grayed);
Menu.DrawOptionText(x, y, color, label, grayed);
return x;
}
protected void drawValue(int indent, int y, int color, String text, bool grayed = false)
{
DrawText(indent + CursorSpace(), y, color, text, grayed);
Menu.DrawOptionText(indent + CursorSpace(), y, color, text, grayed);
}
@ -731,7 +727,7 @@ class OptionMenuSliderBase : OptionMenuItem
String textbuf;
double range;
int maxlen = 0;
int right = x + (12*8 + 4) * CleanXfac_1;
int right = x + (12*8 + 4) * CleanXfac; // length of slider. This uses the old ConFont and
int cy = y;
range = max - min;