Skip to content

Commit

Permalink
fix: label covered by highlight mark when mark_text empty and hilited…
Browse files Browse the repository at this point in the history
…_mark_color not transparent
  • Loading branch information
fxliang committed Dec 16, 2023
1 parent 0005610 commit b9ce276
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion WeaselUI/FullScreenLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ void weasel::FullScreenLayout::DoLayout(CDCHandle dc, PDWR pDWR)
if (!_style.mark_text.empty() && (_style.hilited_mark_color & 0xff000000))
{
CSize sg;
GetTextSizeDW(_style.mark_text, _style.mark_text.length(), pDWR->pTextFormat, pDWR, &sg);
if(_style.mark_text.empty())
GetTextSizeDW(L"|", 1, pDWR->pTextFormat, pDWR, &sg);
else
GetTextSizeDW(_style.mark_text, _style.mark_text.length(), pDWR->pTextFormat, pDWR, &sg);
MARK_WIDTH = sg.cx;
MARK_HEIGHT = sg.cy;
MARK_GAP = MARK_WIDTH + 4;
Expand Down
2 changes: 1 addition & 1 deletion WeaselUI/HorizontalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void HorizontalLayout::DoLayout(CDCHandle dc, PDWR pDWR )
MARK_HEIGHT = sg.cy;
MARK_GAP = MARK_WIDTH + 4;
}
int base_offset = ((_style.hilited_mark_color & 0xff000000) && !_style.mark_text.empty()) ? MARK_GAP : 0;
int base_offset = ((_style.hilited_mark_color & 0xff000000)) ? MARK_GAP : 0;

// calc page indicator
CSize pgszl, pgszr;
Expand Down
4 changes: 2 additions & 2 deletions WeaselUI/VHorizontalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void VHorizontalLayout::DoLayout(CDCHandle dc, PDWR pDWR )
MARK_HEIGHT = sg.cy;
MARK_GAP = MARK_HEIGHT + 4;
}
int base_offset = ((_style.hilited_mark_color & 0xff000000) && !_style.mark_text.empty()) ? MARK_GAP : 0;
int base_offset = ((_style.hilited_mark_color & 0xff000000)) ? MARK_GAP : 0;

// calc page indicator
CSize pgszl, pgszr;
Expand Down Expand Up @@ -237,7 +237,7 @@ void VHorizontalLayout::DoLayoutWithWrap(CDCHandle dc, PDWR pDWR)
MARK_HEIGHT = sg.cy;
MARK_GAP = MARK_HEIGHT + 4;
}
int base_offset = ((_style.hilited_mark_color & 0xff000000) && !_style.mark_text.empty()) ? MARK_GAP : 0;
int base_offset = ((_style.hilited_mark_color & 0xff000000)) ? MARK_GAP : 0;

// calc page indicator
CSize pgszl, pgszr;
Expand Down
2 changes: 1 addition & 1 deletion WeaselUI/VerticalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void weasel::VerticalLayout::DoLayout(CDCHandle dc, PDWR pDWR)
MARK_HEIGHT = sg.cy;
MARK_GAP = MARK_WIDTH + 4;
}
int base_offset = ((_style.hilited_mark_color & 0xff000000) && !_style.mark_text.empty()) ? MARK_GAP : 0;
int base_offset = ((_style.hilited_mark_color & 0xff000000)) ? MARK_GAP : 0;

// calc page indicator
CSize pgszl, pgszr;
Expand Down

0 comments on commit b9ce276

Please sign in to comment.