merge git PR #3

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@468 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
IoIxD
2025-10-23 00:26:36 +00:00
parent a0cca031d6
commit 64e8898945
13 changed files with 117 additions and 121 deletions

View File

@@ -22,8 +22,7 @@ static void draw(MwWidget handle) {
r.width = MwGetInteger(handle, MwNwidth);
r.height = MwGetInteger(handle, MwNheight);
MwDrawFrame(handle, &r, base, handle->pressed);
MwDrawRect(handle, &r, base);
MwDrawWidgetBack(handle, &r, base, handle->pressed, MwTRUE);
if(px != NULL) {
int ow = r.width;

View File

@@ -18,8 +18,7 @@ static void draw(MwWidget handle) {
r.width = MwGetInteger(handle, MwNwidth);
r.height = MwGetInteger(handle, MwNheight);
MwDrawFrame(handle, &r, base, (handle->pressed || MwGetInteger(handle, MwNchecked)) ? 1 : 0);
MwDrawRect(handle, &r, base);
MwDrawWidgetBack(handle, &r, base, (handle->pressed || MwGetInteger(handle, MwNchecked)) ? 1 : 0, MwTRUE);
if(handle->pressed || MwGetInteger(handle, MwNchecked)) {
/* TODO: write check mark */
}

View File

@@ -32,8 +32,7 @@ static void draw(MwWidget handle) {
r.width = MwGetInteger(handle, MwNwidth) - t->right;
r.height = MwGetInteger(handle, MwNheight);
MwDrawFrame(handle, &r, base, (handle->pressed || MwGetInteger(handle, MwNchecked)) ? 1 : 0);
MwDrawRect(handle, &r, base);
MwDrawWidgetBack(handle, &r, base, (handle->pressed || MwGetInteger(handle, MwNchecked)) ? 1 : 0, MwTRUE);
if(str != NULL) {
int w = MwTextWidth(handle, "M");
int h = MwTextHeight(handle, "M");

View File

@@ -2,6 +2,7 @@
#include <Mw/Milsko.h>
#include "../../external/stb_ds.h"
#include "Mw/TypeDefs.h"
static void set_xywh(MwWidget handle) {
int height = 0;
@@ -101,14 +102,13 @@ static void draw(MwWidget handle) {
MwLLColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
MENU_LOOP_DECL;
MwDrawFrame(handle, &r, base, 0);
MwDrawRect(handle, &r, base);
MwDrawWidgetBack(handle, &r, base, 0, MwTRUE);
BEGIN_MENU_LOOP;
if(m->sub[i]->wsub != NULL) {
MwDrawFrame(handle, &r, base, 0);
MwDrawWidgetBack(handle, &r, base, 0, MwFALSE);
} else if(in_area && handle->pressed) {
MwDrawFrame(handle, &r, base, 0);
MwDrawWidgetBack(handle, &r, base, 0, MwFALSE);
}
MwDrawText(handle, &p, m->sub[i]->name + incr, 1, MwALIGNMENT_BEGINNING, text);

View File

@@ -34,8 +34,7 @@ static void draw(MwWidget handle) {
r.y = 0;
r.width = e->right;
r.height = h / 2;
MwDrawFrame(handle, &r, base, pr);
MwDrawRect(handle, &r, base);
MwDrawWidgetBack(handle, &r, base, pr, MwTRUE);
if(r.width > r.height) {
r.width = r.height;
@@ -51,8 +50,7 @@ static void draw(MwWidget handle) {
r.y = h / 2;
r.width = e->right;
r.height = h / 2;
MwDrawFrame(handle, &r, base, pr);
MwDrawRect(handle, &r, base);
MwDrawWidgetBack(handle, &r, base, pr, MwTRUE);
if(r.width > r.height) {
r.width = r.height;

View File

@@ -78,8 +78,7 @@ static void draw(MwWidget handle) {
ux = r.height;
dx = r.width - r.height;
MwDrawFrame(handle, &r, dark, 1);
MwDrawRect(handle, &r, dark);
MwDrawWidgetBack(handle, &r, dark, 1, MwTRUE);
rt = r;
@@ -124,15 +123,14 @@ static void draw(MwWidget handle) {
}
}
MwDrawFrame(handle, &rbar, base, 0);
MwDrawRect(handle, &rbar, base);
MwDrawWidgetBack(handle, &rbar, base, 0, MwTRUE);
MwLLFreeColor(dark);
MwLLFreeColor(base);
}
static void mouse_move(MwWidget handle) {
int or = MwGetInteger(handle, MwNorientation);
int or = MwGetInteger(handle, MwNorientation);
scrollbar_t* scr = handle->internal;
if(!handle->pressed) return;
@@ -160,9 +158,9 @@ static void mouse_move(MwWidget handle) {
}
static void mouse_down(MwWidget handle, void* ptr) {
int ww = MwGetInteger(handle, MwNwidth);
int wh = MwGetInteger(handle, MwNheight);
int or = MwGetInteger(handle, MwNorientation);
int ww = MwGetInteger(handle, MwNwidth);
int wh = MwGetInteger(handle, MwNheight);
int or = MwGetInteger(handle, MwNorientation);
scrollbar_t* scr = handle->internal;
MwLLMouse* m = ptr;

View File

@@ -37,8 +37,7 @@ static void draw(MwWidget handle) {
r.width = MwGetInteger(handle, MwNwidth);
r.height = MwGetInteger(handle, MwNheight);
MwDrawFrame(handle, &r, base, 0);
MwDrawRect(handle, &r, base);
MwDrawWidgetBack(handle, &r, base, 0, MwTRUE);
if(menu != NULL) {
MwPoint p;
@@ -56,7 +55,7 @@ static void draw(MwWidget handle) {
r.y = p.y - 3;
r.width = tw + 15 + 5 * 2;
r.height = th + 3 * 2;
MwDrawFrame(handle, &r, base, 0);
MwDrawWidgetBack(handle, &r, base, 0, MwTRUE);
}
p.x = 5 + tw / 2;