git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@828 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-11-29 21:17:15 +00:00
parent 77ec32ef42
commit 77ea00f047
4 changed files with 11 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ static int create(MwWidget handle) {
MwSetDefault(handle);
MwSetInteger(handle, MwNflat, 0);
MwSetInteger(handle, MwNpadding, 0);
return 0;
}
@@ -54,6 +55,8 @@ static void draw(MwWidget handle) {
r.width = px->common.width * sh;
r.height = px->common.height * sh;
}
r.width -= MwGetInteger(handle, MwNpadding) * 2;
r.height -= MwGetInteger(handle, MwNpadding) * 2;
r.x += (double)(ow - r.width) / 2;
r.y += (double)(oh - r.height) / 2;
@@ -75,7 +78,7 @@ static void click(MwWidget handle) {
}
static void prop_change(MwWidget handle, const char* key) {
if(strcmp(key, MwNtext) == 0 || strcmp(key, MwNpixmap) == 0 || strcmp(key, MwNflat) == 0) MwForceRender(handle);
if(strcmp(key, MwNtext) == 0 || strcmp(key, MwNpixmap) == 0 || strcmp(key, MwNflat) == 0 || strcmp(key, MwNpadding) == 0) MwForceRender(handle);
}
MwClassRec MwButtonClassRec = {