suwako / UnixCalc アーカイブ

このリポジトリはアーカイブされています。読むだけで、プッシュやイシューの変更は出来ません。

ごめん

諏訪子 <suwako@076.moe>、2026-01-17 18:39
コミット c6f2982855399872d553948799429ef34070fc8d ・親 fa83f22 ・ファイルを見る

2個のファイル、+5 -2

変更 src/display.c
@@ -6,7 +6,8 @@
66 void drawbuttons(UiSystem *ui, SuwaButton *btn, XftDraw *xftdraw) {
77 unsigned long curbg = btn->pressed ? BTSEL : BTCOL;
88 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);
1011
1112 // 文字の中央に
1213 if (btn->label && ui->font && xftdraw) {
@@ -24,7 +25,7 @@
2425
2526 // tx -= extents.x;
2627
27- XftDrawStringUtf8(xftdraw, &ui->textcolor, ui->font, tx, ty,
28+ XftDrawStringUtf8(xftdraw, &ui->color, ui->font, tx, ty,
2829 (FcChar8 *)btn->label, len);
2930 }
3031 }
変更 src/utils.c
@@ -1,6 +1,8 @@
11 #include "utils.h"
22
33 void cleanup(UiSystem *ui) {
4+ if (ui->textcolor.pixel != 0)
5+ XftColorFree(ui->display, &ui->visual, ui->colormap, &ui->textcolor);
46 if (ui->btncolor.pixel != 0)
57 XftColorFree(ui->display, &ui->visual, ui->colormap, &ui->btncolor);
68 if (ui->color.pixel != 0)