Skip to content

Commit

Permalink
æsthetic changes for menu's checkmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
dk committed Oct 6, 2024
1 parent f9528a6 commit b942613
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/menu.pl
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ package UserInit;
maxLen => 200,
onChange => sub {
$_[0]-> owner-> text( $_[0]-> text);
$_[0]-> owner-> Label1-> text( $_[0]-> text);
$_[0]-> owner-> Hint-> text( $_[0]-> text);
$_[0]-> owner-> menu-> coexistentor-> text( $_[0]-> text)
if $_[0]-> owner-> menu-> has_item( 'coexistentor');
},
Expand Down
11 changes: 8 additions & 3 deletions unix/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,16 +1130,19 @@ DECL_DRAW(radio)

DECL_DRAW(check)
{
DEFMM;
PCachedFont kf = XX->font;
int bottom = y + ix->height - MENU_ITEM_GAP - ix-> height * 0.2;
int ax = x + MENU_XOFFSET / 2;
y -= kf->font.descent/2;

if ( can_antialias(self)) {
#ifdef HAVE_X11_EXTENSIONS_XRENDER_H
DEFMM;
XPointDouble pts[] = {
{ax, y + ix->height/2},
{ax + 1, y + ix->height/2 + 2},
{ax + MENU_XOFFSET, bottom - 2},
{ax + MENU_CHECK_XOFFSET, y + MENU_ITEM_GAP + ix->height * 0.2},
{ax + MENU_CHECK_XOFFSET + 1, + MENU_ITEM_GAP + ix->height * 0.2 - 1},
{ax + MENU_CHECK_XOFFSET - 2, y + MENU_ITEM_GAP + ix->height * 0.2 + 4},
{ax + MENU_XOFFSET, bottom + 2},
{ax + 4, y + ix->height/2 + 4}
Expand Down Expand Up @@ -1171,9 +1174,11 @@ DECL_DRAW(check)

DECL_DRAW(checkbox)
{
DEFMM;
PCachedFont kf = XX->font;
int
x1 = x + MENU_XOFFSET / 2 + 1,
y1 = y + (ix-> height/2) - MENU_CHECK_XOFFSET/2 + 1,
y1 = y + (ix-> height/2) - MENU_CHECK_XOFFSET/2 + 1 - kf->font.descent/2,
x2 = x1 + MENU_CHECK_XOFFSET - 2,
y2 = y1 + MENU_CHECK_XOFFSET - 2;

Expand Down

0 comments on commit b942613

Please sign in to comment.