- geometry::Vector<int> offset((i % cols) * (ColWidth() + colGap), (i / cols) * RowHeight());
- font->DrawString(entries[start + i].title, dest, position + offset, charsPerEntry);
+ if (!entries[start + i].title) continue;
+ geometry::Vector<int> iconOffset(
+ (i % cols) * (ColWidth() + colGap),
+ (i / cols) * RowHeight());
+ if (entries[start + i].icon) {
+ entries[start + i].icon->Draw(dest, position + iconOffset);
+ }
+ geometry::Vector<int> textOffset(iconOffset.X() + iconSpace, iconOffset.Y());
+ const Font *usedFont(entries[start + i].enabled ? font : disabledFont);
+ usedFont->DrawString(entries[start + i].title, dest, position + textOffset, charsPerEntry);
+
+ textOffset += geometry::Vector<int>(charsPerEntry * usedFont->CharWidth(), 0);
+
+ if (charsPerAdditionalText) {
+ textOffset += geometry::Vector<int>(additionalTextGap, 0);
+ if (entries[start + i].additionalText) {
+ usedFont->DrawString(entries[start + i].additionalText, dest, position + textOffset, charsPerAdditionalText);
+ }
+ textOffset += geometry::Vector<int>(charsPerAdditionalText * usedFont->CharWidth(), 0);
+ }
+
+ if (charsPerNumber) {
+ usedFont->DrawChar(delimiter, dest, position + textOffset);
+ textOffset += geometry::Vector<int>(usedFont->CharWidth(), 0);
+ usedFont->DrawNumber(entries[start + i].number, dest, position + textOffset);
+ }