add disabled widgets
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit

This commit is contained in:
IoIxD 2026-05-22 11:41:08 -07:00
commit 149f99622a
7 changed files with 91 additions and 20 deletions

View file

@ -57,6 +57,7 @@ static void lldrawhandler(MwLL handle, void* data) {
static void lluphandler(MwLL handle, void* data) {
MwWidget h = (MwWidget)handle->common.user;
MwMouse* p = data;
if(MwGetInteger(h, MwNdisabled) == 1) return;
if(p->button == MwMOUSE_LEFT) h->pressed = 0;
h->mouse_point.x = p->point.x;
@ -70,6 +71,7 @@ static void lluphandler(MwLL handle, void* data) {
static void lldownhandler(MwLL handle, void* data) {
MwWidget h = (MwWidget)handle->common.user;
MwMouse* p = data;
if(MwGetInteger(h, MwNdisabled) == 1) return;
if(p->button == MwMOUSE_LEFT) h->pressed = 1;
h->mouse_point.x = p->point.x;
@ -124,6 +126,7 @@ static void llmovehandler(MwLL handle, void* data) {
static void llkeyhandler(MwLL handle, void* data) {
MwWidget h = (MwWidget)handle->common.user;
int key = *(int*)data;
if(MwGetInteger(h, MwNdisabled) == 1) return;
MwDispatch3(h, key, key);
MwDispatchUserHandler(h, MwNkeyHandler, data);
@ -131,24 +134,28 @@ static void llkeyhandler(MwLL handle, void* data) {
static void llkeyrelhandler(MwLL handle, void* data) {
MwWidget h = (MwWidget)handle->common.user;
if(MwGetInteger(h, MwNdisabled) == 1) return;
MwDispatchUserHandler(h, MwNkeyReleaseHandler, data);
}
static void llfocusinhandler(MwLL handle, void* data) {
MwWidget h = (MwWidget)handle->common.user;
if(MwGetInteger(h, MwNdisabled) == 1) return;
MwDispatchUserHandler(h, MwNfocusInHandler, data);
}
static void llfocusouthandler(MwLL handle, void* data) {
MwWidget h = (MwWidget)handle->common.user;
if(MwGetInteger(h, MwNdisabled) == 1) return;
MwDispatchUserHandler(h, MwNfocusOutHandler, data);
}
static void llclipboardhandler(MwLL handle, void* data) {
MwWidget h = (MwWidget)handle->common.user;
if(MwGetInteger(h, MwNdisabled) == 1) return;
MwDispatch3(h, clipboard, data);
MwDispatchUserHandler(h, MwNclipboardHandler, data);
@ -691,6 +698,7 @@ int MwGetInteger(MwWidget handle, const char* key) {
#endif
if(strcmp(key, MwNdarkTheme) == 0) return inherit_integer(handle, key, 0);
if(strcmp(key, MwNuseMonospace) == 0) return inherit_integer(handle, key, 0);
if(strcmp(key, MwNdisabled) == 0) return inherit_integer(handle, key, 0);
}
return shget(handle->integer, key);
}