ごめん
This commit is contained in:
@@ -6,7 +6,8 @@
|
|||||||
void drawbuttons(UiSystem *ui, SuwaButton *btn, XftDraw *xftdraw) {
|
void drawbuttons(UiSystem *ui, SuwaButton *btn, XftDraw *xftdraw) {
|
||||||
unsigned long curbg = btn->pressed ? BTSEL : BTCOL;
|
unsigned long curbg = btn->pressed ? BTSEL : BTCOL;
|
||||||
XSetForeground(ui->display, ui->gc, curbg);
|
XSetForeground(ui->display, ui->gc, curbg);
|
||||||
XFillRectangle(ui->display, ui->target, ui->gc, btn->x, btn->y, btn->width, btn->height);
|
XFillRectangle(ui->display, ui->target, ui->gc, btn->x, btn->y,
|
||||||
|
btn->width, btn->height);
|
||||||
|
|
||||||
// 文字の中央に
|
// 文字の中央に
|
||||||
if (btn->label && ui->font && xftdraw) {
|
if (btn->label && ui->font && xftdraw) {
|
||||||
@@ -24,7 +25,7 @@ void drawbuttons(UiSystem *ui, SuwaButton *btn, XftDraw *xftdraw) {
|
|||||||
|
|
||||||
// tx -= extents.x;
|
// tx -= extents.x;
|
||||||
|
|
||||||
XftDrawStringUtf8(xftdraw, &ui->textcolor, ui->font, tx, ty,
|
XftDrawStringUtf8(xftdraw, &ui->color, ui->font, tx, ty,
|
||||||
(FcChar8 *)btn->label, len);
|
(FcChar8 *)btn->label, len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
void cleanup(UiSystem *ui) {
|
void cleanup(UiSystem *ui) {
|
||||||
|
if (ui->textcolor.pixel != 0)
|
||||||
|
XftColorFree(ui->display, &ui->visual, ui->colormap, &ui->textcolor);
|
||||||
if (ui->btncolor.pixel != 0)
|
if (ui->btncolor.pixel != 0)
|
||||||
XftColorFree(ui->display, &ui->visual, ui->colormap, &ui->btncolor);
|
XftColorFree(ui->display, &ui->visual, ui->colormap, &ui->btncolor);
|
||||||
if (ui->color.pixel != 0)
|
if (ui->color.pixel != 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user