ごめん
諏訪子 <suwako@076.moe>、2026-01-17 18:39
コミット c6f2982855399872d553948799429ef34070fc8d
・親 fa83f22
・ファイルを見る
2個のファイル、+5 -2
| @@ -6,7 +6,8 @@ | ||
| 6 | 6 | void drawbuttons(UiSystem *ui, SuwaButton *btn, XftDraw *xftdraw) { |
| 7 | 7 | unsigned long curbg = btn->pressed ? BTSEL : BTCOL; |
| 8 | 8 | XSetForeground(ui->display, ui->gc, curbg); |
| 9 | - XFillRectangle(ui->display, ui->target, ui->gc, btn->x, btn->y, btn->width, btn->height); | |
| 9 | + XFillRectangle(ui->display, ui->target, ui->gc, btn->x, btn->y, | |
| 10 | + btn->width, btn->height); | |
| 10 | 11 | |
| 11 | 12 | // 文字の中央に |
| 12 | 13 | if (btn->label && ui->font && xftdraw) { |
| @@ -24,7 +25,7 @@ | ||
| 24 | 25 | |
| 25 | 26 | // tx -= extents.x; |
| 26 | 27 | |
| 27 | - XftDrawStringUtf8(xftdraw, &ui->textcolor, ui->font, tx, ty, | |
| 28 | + XftDrawStringUtf8(xftdraw, &ui->color, ui->font, tx, ty, | |
| 28 | 29 | (FcChar8 *)btn->label, len); |
| 29 | 30 | } |
| 30 | 31 | } |
変更
src/utils.c
| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | #include "utils.h" |
| 2 | 2 | |
| 3 | 3 | void cleanup(UiSystem *ui) { |
| 4 | + if (ui->textcolor.pixel != 0) | |
| 5 | + XftColorFree(ui->display, &ui->visual, ui->colormap, &ui->textcolor); | |
| 4 | 6 | if (ui->btncolor.pixel != 0) |
| 5 | 7 | XftColorFree(ui->display, &ui->visual, ui->colormap, &ui->btncolor); |
| 6 | 8 | if (ui->color.pixel != 0) |