While I am at it, some minor fixes to Game Properties/Cartridge dialog

This commit is contained in:
thrust26 2017-10-03 22:26:08 +02:00
parent 0839bcb8d7
commit 46f2ae0cab
3 changed files with 19 additions and 16 deletions

View File

@ -72,6 +72,9 @@ void EditTextWidget::drawWidget(bool hilite)
// Highlight changes // Highlight changes
if(_changed) if(_changed)
s.fillRect(_x, _y, _w, _h, kDbgChangedColor); s.fillRect(_x, _y, _w, _h, kDbgChangedColor);
if(!isEditable())
s.fillRect(_x, _y, _w, _h, kBGColorHi);
// 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);

View File

@ -76,43 +76,43 @@ GameInfoDialog::GameInfoDialog(
fwidth = _w - xpos - lwidth - hSpace - hBorder * 2; fwidth = _w - xpos - lwidth - hSpace - hBorder * 2;
new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight, new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight,
"Name", kTextAlignLeft); "Name", kTextAlignLeft);
myName = new EditTextWidget(myTab, font, xpos+lwidth, ypos, myName = new EditTextWidget(myTab, font, xpos+lwidth, ypos-1,
fwidth, fontHeight, ""); fwidth, lineHeight, "");
wid.push_back(myName); wid.push_back(myName);
ypos += lineHeight + vGap; ypos += lineHeight + vGap;
new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight, new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight,
"MD5", kTextAlignLeft); "MD5", kTextAlignLeft);
myMD5 = new StaticTextWidget(myTab, font, xpos+lwidth, ypos, myMD5 = new EditTextWidget(myTab, font, xpos + lwidth, ypos-1,
fwidth, fontHeight, fwidth, lineHeight, "");
"", kTextAlignLeft); myMD5->setEditable(false);
ypos += lineHeight + vGap; ypos += lineHeight + vGap;
new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight, new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight,
"Manufacturer", kTextAlignLeft); "Manufacturer", kTextAlignLeft);
myManufacturer = new EditTextWidget(myTab, font, xpos+lwidth, ypos, myManufacturer = new EditTextWidget(myTab, font, xpos+lwidth, ypos-1,
fwidth, fontHeight, ""); fwidth, lineHeight, "");
wid.push_back(myManufacturer); wid.push_back(myManufacturer);
ypos += lineHeight + vGap; ypos += lineHeight + vGap;
new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight, new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight,
"Model", kTextAlignLeft); "Model", kTextAlignLeft);
myModelNo = new EditTextWidget(myTab, font, xpos+lwidth, ypos, myModelNo = new EditTextWidget(myTab, font, xpos+lwidth, ypos-1,
fwidth, fontHeight, ""); fwidth, lineHeight, "");
wid.push_back(myModelNo); wid.push_back(myModelNo);
ypos += lineHeight + vGap; ypos += lineHeight + vGap;
new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight, new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight,
"Rarity", kTextAlignLeft); "Rarity", kTextAlignLeft);
myRarity = new EditTextWidget(myTab, font, xpos+lwidth, ypos, myRarity = new EditTextWidget(myTab, font, xpos+lwidth, ypos-1,
fwidth, fontHeight, ""); fwidth, lineHeight, "");
wid.push_back(myRarity); wid.push_back(myRarity);
ypos += lineHeight + vGap; ypos += lineHeight + vGap;
new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight, new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight,
"Note", kTextAlignLeft); "Note", kTextAlignLeft);
myNote = new EditTextWidget(myTab, font, xpos+lwidth, ypos, myNote = new EditTextWidget(myTab, font, xpos+lwidth, ypos-1,
fwidth, fontHeight, ""); fwidth, lineHeight, "");
wid.push_back(myNote); wid.push_back(myNote);
ypos += lineHeight + vGap; ypos += lineHeight + vGap;
@ -403,7 +403,7 @@ void GameInfoDialog::loadView()
// Cartridge properties // Cartridge properties
myName->setText(myGameProperties.get(Cartridge_Name)); myName->setText(myGameProperties.get(Cartridge_Name));
myMD5->setLabel(myGameProperties.get(Cartridge_MD5)); myMD5->setText(myGameProperties.get(Cartridge_MD5));
myManufacturer->setText(myGameProperties.get(Cartridge_Manufacturer)); myManufacturer->setText(myGameProperties.get(Cartridge_Manufacturer));
myModelNo->setText(myGameProperties.get(Cartridge_ModelNo)); myModelNo->setText(myGameProperties.get(Cartridge_ModelNo));
myRarity->setText(myGameProperties.get(Cartridge_Rarity)); myRarity->setText(myGameProperties.get(Cartridge_Rarity));

View File

@ -53,7 +53,7 @@ class GameInfoDialog : public Dialog, public CommandSender
// Cartridge properties // Cartridge properties
EditTextWidget* myName; EditTextWidget* myName;
StaticTextWidget* myMD5; EditTextWidget* myMD5;
EditTextWidget* myManufacturer; EditTextWidget* myManufacturer;
EditTextWidget* myModelNo; EditTextWidget* myModelNo;
EditTextWidget* myRarity; EditTextWidget* myRarity;