Skip to content

Commit

Permalink
tweak home page
Browse files Browse the repository at this point in the history
  • Loading branch information
kjk committed Aug 10, 2024
1 parent 798d8db commit 2fc9383
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/HomePage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ constexpr int kThumbsSeparatorDy = 2;
constexpr int kThumbsBorderDx = 1;
#define kThumbsMarginLeft DpiScale(hdc, 40)
#define kThumbsMarginRight DpiScale(hdc, 40)
#define kThumbsMarginTop DpiScale(hdc, 60)
#define kThumbsMarginTop DpiScale(hdc, 50)
#define kThumbsMarginBottom DpiScale(hdc, 40)
#define kThumbsSpaceBetweenX DpiScale(hdc, 30)
#define kThumbsSpaceBetweenY DpiScale(hdc, 50)
Expand Down Expand Up @@ -636,6 +636,7 @@ void LayoutHomePage(HomePageLayout& l) {
auto rc = l.rc;
auto win = l.win;

bool isRtl = IsUIRtl();
HFONT fontText = CreateSimpleFont(hdc, "MS Shell Dlg", 14);
HFONT fontFrequentlyRead = CreateSimpleFont(hdc, "MS Shell Dlg", 24);

Expand All @@ -649,10 +650,6 @@ void LayoutHomePage(HomePageLayout& l) {

l.rcLine = {0, sz.dy, rc.dx, 0};

bool isRtl = IsUIRtl();

/* render recent files list */

Rect& titleBox = l.rcAppWithVer;
rc.SubTB(titleBox.dy, kThumbsBottomBoxDy);

Expand All @@ -666,6 +663,7 @@ void LayoutHomePage(HomePageLayout& l) {
(rc.dx - thumbsCols * kThumbnailDx - (thumbsCols - 1) * kThumbsSpaceBetweenX - kThumbsMarginLeft -
kThumbsMarginRight) /
2;
rc.y = 0;
Point ptOff(x, rc.y + kThumbsMarginTop);
if (ptOff.x < DpiScale(hdc, kInnerPadding)) {
ptOff.x = DpiScale(hdc, kInnerPadding);
Expand Down Expand Up @@ -758,6 +756,7 @@ void LayoutHomePage(HomePageLayout& l) {
}

static void DrawHomePageLayout(const HomePageLayout& l) {
bool isRtl = IsUIRtl();
auto hdc = l.hdc;
auto win = l.win;
auto textColor = ThemeWindowTextColor();
Expand All @@ -769,13 +768,16 @@ static void DrawHomePageLayout(const HomePageLayout& l) {
FillRect(hdc, rc, color);
}

const Rect& r = l.rcAppWithVer;
DrawSumatraVersion(hdc, r);
if (false) {
const Rect& r = l.rcAppWithVer;
DrawSumatraVersion(hdc, r);
}

auto color = ThemeWindowTextColor();
ScopedSelectObject pen(hdc, CreatePen(PS_SOLID, 1, color), true);
DrawLine(hdc, l.rcLine);
bool isRtl = IsUIRtl();
if (false) {
ScopedSelectObject pen(hdc, CreatePen(PS_SOLID, 1, color), true);
DrawLine(hdc, l.rcLine);
}
HFONT fontText = CreateSimpleFont(hdc, "MS Shell Dlg", 14);

AutoDeletePen penThumbBorder(CreatePen(PS_SOLID, kThumbsBorderDx, color));
Expand Down Expand Up @@ -839,10 +841,11 @@ static void DrawHomePageLayout(const HomePageLayout& l) {

l.openDoc->Draw(hdc);

Rect rcFreqRead = DrawHideFrequentlyReadLink(win->hwndCanvas, hdc, _TRA("Hide frequently read"));

auto sl = new StaticLinkInfo(rcFreqRead, kLinkHideList);
win->staticLinks.Append(sl);
if (false) {
Rect rcFreqRead = DrawHideFrequentlyReadLink(win->hwndCanvas, hdc, _TRA("Hide frequently read"));
auto sl = new StaticLinkInfo(rcFreqRead, kLinkHideList);
win->staticLinks.Append(sl);
}
}

void DrawHomePage(MainWindow* win, HDC hdc) {
Expand Down

0 comments on commit 2fc9383

Please sign in to comment.