mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-15 22:02:51 -06:00
Ide: AppPreview header now supports dark theme and fix minor rendering problem related to this class.
git-svn-id: svn://ultimatepp.org/upp/trunk@13080 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
e4e2759a5a
commit
452a60e97b
1 changed files with 7 additions and 5 deletions
|
|
@ -107,15 +107,17 @@ void AppPreview::Layout()
|
|||
void AppPreview::Paint(Draw& w)
|
||||
{
|
||||
Size sz = GetSize();
|
||||
Font fnt = CourierZ(12);
|
||||
int y = 0;
|
||||
int i = sb;
|
||||
while(y < sz.cy) {
|
||||
bool hdr = i < line.GetCount() && line[i].header;
|
||||
w.DrawRect(0, y, sz.cx, fnt.GetCy(), hdr ? LtCyan : SColorPaper);
|
||||
auto is_header = i < line.GetCount() && line[i].header;
|
||||
auto font = is_header ? ArialZ(12).Bold().Italic() : CourierZ(12);
|
||||
auto rect_color = is_header ? (IsDarkTheme() ? DarkTheme(LtCyan) : LtCyan) : SColorPaper;
|
||||
|
||||
w.DrawRect(0, y, sz.cx, font.GetCy(), rect_color);
|
||||
if(i < line.GetCount())
|
||||
w.DrawText(0, y, line[i].text, hdr ? ArialZ(12).Bold().Italic() : fnt, SColorText);
|
||||
y += fnt.GetCy();
|
||||
w.DrawText(0, y, line[i].text, font, SColorText);
|
||||
y += font.GetCy();
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue