Skip to content

Commit 22ed829

Browse files
committed
simplification
1 parent ce706be commit 22ed829

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

virgo.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ static HICON trayicon_draw(Trayicon *t, char *text, unsigned len)
7777
SelectObject(t->mdc, hOldFont);
7878
iconInfo.fIcon = TRUE;
7979
iconInfo.xHotspot = iconInfo.yHotspot = 0;
80-
iconInfo.hbmMask = t->hBitmap;
81-
iconInfo.hbmColor = t->hBitmap;
80+
iconInfo.hbmMask = iconInfo.hbmColor = t->hBitmap;
8281
return CreateIconIndirect(&iconInfo);
8382
}
8483

@@ -112,7 +111,7 @@ static void trayicon_init(Trayicon *t)
112111
static void trayicon_set(Trayicon *t, unsigned number)
113112
{
114113
char snumber[2];
115-
if (!(number>=0 && number<=9)) {
114+
if (number>9) {
116115
return;
117116
}
118117
snumber[0] = number + '0';
@@ -245,8 +244,8 @@ static void virgo_toggle_hotkeys(Virgo *v)
245244
v->handle_hotkeys = !v->handle_hotkeys;
246245
if (v->handle_hotkeys) {
247246
for (i=0; i<NUM_DESKTOPS; i++) {
248-
register_hotkey(i*2, MOD_ALT|MOD_NOREPEAT, i+1+0x30);
249-
register_hotkey(i*2+1, MOD_CONTROL|MOD_NOREPEAT, i+1+0x30);
247+
register_hotkey(i*2, MOD_ALT|MOD_NOREPEAT, i+1+'0');
248+
register_hotkey(i*2+1, MOD_CONTROL|MOD_NOREPEAT, i+1+'0');
250249
}
251250
} else {
252251
for (i=0; i<NUM_DESKTOPS; i++) {
@@ -261,8 +260,8 @@ static void virgo_init(Virgo *v)
261260
unsigned i;
262261
v->handle_hotkeys = 1;
263262
for (i=0; i<NUM_DESKTOPS; i++) {
264-
register_hotkey(i*2, MOD_ALT|MOD_NOREPEAT, i+1+0x30);
265-
register_hotkey(i*2+1, MOD_CONTROL|MOD_NOREPEAT, i+1+0x30);
263+
register_hotkey(i*2, MOD_ALT|MOD_NOREPEAT, i+1+'0');
264+
register_hotkey(i*2+1, MOD_CONTROL|MOD_NOREPEAT, i+1+'0');
266265
}
267266
register_hotkey(i*2, MOD_ALT|MOD_CONTROL|MOD_SHIFT|MOD_NOREPEAT, 'Q');
268267
register_hotkey(i*2+1, MOD_ALT|MOD_CONTROL|MOD_SHIFT|MOD_NOREPEAT, 'S');
@@ -330,4 +329,4 @@ void __main(void)
330329
}
331330
virgo_deinit(&v);
332331
ExitProcess(0);
333-
}
332+
}

0 commit comments

Comments
 (0)