mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 19:03:44 +02:00
Correct the viewport area in TextManualDialog
Hardcoded coordinates now follow gmenu2x's usual content area rules. Copy-pasted from TextDialog.
This commit is contained in:
parent
b833f59bb5
commit
b3719d1331
@ -92,7 +92,11 @@ void TextManualDialog::exec() {
|
|||||||
ss >> spagecount;
|
ss >> spagecount;
|
||||||
string pageStatus;
|
string pageStatus;
|
||||||
|
|
||||||
const unsigned rowsPerPage = max(180u / gmenu2x->font->getLineSpacing(), 1u);
|
const int fontHeight = gmenu2x->font->getLineSpacing();
|
||||||
|
unsigned int contentY, contentHeight;
|
||||||
|
tie(contentY, contentHeight) = gmenu2x->getContentArea();
|
||||||
|
const unsigned rowsPerPage = max(contentHeight / fontHeight, 1u);
|
||||||
|
contentY += (contentHeight % fontHeight) / 2;
|
||||||
|
|
||||||
unsigned page = 0, firstRow = 0;
|
unsigned page = 0, firstRow = 0;
|
||||||
bool close = false;
|
bool close = false;
|
||||||
@ -102,7 +106,7 @@ void TextManualDialog::exec() {
|
|||||||
|
|
||||||
bg.blit(s,0,0);
|
bg.blit(s,0,0);
|
||||||
writeSubTitle(s, pages[page].title);
|
writeSubTitle(s, pages[page].title);
|
||||||
drawText(pages[page].text, 42 /* TODO */, firstRow, rowsPerPage);
|
drawText(pages[page].text, contentY, firstRow, rowsPerPage);
|
||||||
|
|
||||||
ss.clear();
|
ss.clear();
|
||||||
ss << page+1;
|
ss << page+1;
|
||||||
|
Loading…
Reference in New Issue
Block a user