enhanced links in HelpDialog

fixed link color for Dark theme
This commit is contained in:
thrust26 2021-04-25 21:08:06 +02:00
parent e463ef2fb4
commit 7873bddee5
2 changed files with 21 additions and 3 deletions

View File

@ -1494,7 +1494,7 @@ UIPaletteArray FrameBuffer::ourLightUIPalette = {
UIPaletteArray FrameBuffer::ourDarkUIPalette = {
{ 0x646464, 0xc0c0c0, 0x3c3c3c, 0x282828, 0x989898, // base
0xc0c0c0, 0x1567a5, 0x0059a3, 0xc0c0c0, 0x1567a5, // text
0xc0c0c0, 0x1567a5, 0x0064b7, 0xc0c0c0, 0x1d92e0, // text
0x202020, 0x000000, 0x0059a3, 0xb0b0b0, // UI elements
0x282828, 0x00467f, 0x646464, 0x0059a3, 0xc0c0c0, 0xc0c0c0, // buttons
0x989898, // checkbox

View File

@ -20,6 +20,7 @@
#include "Dialog.hxx"
#include "Widget.hxx"
#include "Font.hxx"
#include "MediaFactory.hxx"
#include "HelpDialog.hxx"
@ -79,12 +80,11 @@ HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
myDesc[i] =
new StaticTextWidget(this, font, xpos+lwidth, ypos, _w - xpos - lwidth - HBORDER,
fontHeight);
myDesc[i]->setID(i);
ypos += fontHeight;
}
addToFocusList(wid);
setHelpAnchor("Hotkeys");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -105,6 +105,7 @@ void HelpDialog::updateStrings(uInt8 page, uInt8 lines, string& title)
auto ADD_TEXT = [&](const string& d) { ADD_BIND("", d); };
auto ADD_LINE = [&]() { ADD_BIND("", ""); };
setHelpAnchor("Hotkeys");
switch(page)
{
case 1:
@ -170,6 +171,7 @@ void HelpDialog::updateStrings(uInt8 page, uInt8 lines, string& title)
ADD_TEXT("remapped. Please consult the");
ADD_TEXT("'Options/Input" + ELLIPSIS + "' dialog for");
ADD_TEXT("more information.");
setHelpAnchor("Remapping");
break;
default:
@ -191,6 +193,13 @@ void HelpDialog::displayInfo()
{
myKey[i]->setLabel(myKeyStr[i]);
myDesc[i]->setLabel(myDescStr[i]);
if(BSPF::containsIgnoreCase(myDescStr[i], "Options/Input" + ELLIPSIS))
myDesc[i]->setUrl("https://stella-emu.github.io/docs/index.html#Remapping",
"Options/Input" + ELLIPSIS);
else
// extract URL from label
myDesc[i]->setUrl();
}
}
@ -220,6 +229,15 @@ void HelpDialog::handleCommand(CommandSender* sender, int cmd,
displayInfo();
break;
case StaticTextWidget::kOpenUrlCmd:
{
const string url = myDesc[id]->getUrl();
if(url != EmptyString)
MediaFactory::openURL(url);
break;
}
default:
Dialog::handleCommand(sender, cmd, data, 0);
}