This commit is contained in:
parent
8d48075f50
commit
ae2d859e63
1 changed files with 16 additions and 15 deletions
|
|
@ -474,6 +474,21 @@ static void add_clickable(MwDocument d, char* c_title, MwRect* clickable) {
|
||||||
arrput(d->clickables, c);
|
arrput(d->clickables, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void mouse_move(MwWidget handle) {
|
||||||
|
char* event = in_hitbox(handle, &handle->mouse_point);
|
||||||
|
MwDocument d = handle->internal;
|
||||||
|
|
||||||
|
if(d->center_cursor && event == NULL) {
|
||||||
|
MwLLSetCursor(handle->lowlevel, &MwCursorDefault, &MwCursorDefaultMask);
|
||||||
|
|
||||||
|
d->center_cursor = 0;
|
||||||
|
} else if(!d->center_cursor && event != NULL) {
|
||||||
|
MwLLSetCursor(handle->lowlevel, &MwCursorCenter, &MwCursorCenterMask);
|
||||||
|
|
||||||
|
d->center_cursor = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void layout(MwWidget handle) {
|
static void layout(MwWidget handle) {
|
||||||
MwDocument d = handle->internal;
|
MwDocument d = handle->internal;
|
||||||
int w = MwGetInteger(handle, MwNwidth);
|
int w = MwGetInteger(handle, MwNwidth);
|
||||||
|
|
@ -602,6 +617,7 @@ static void layout(MwWidget handle) {
|
||||||
|
|
||||||
arrfree(fontstack);
|
arrfree(fontstack);
|
||||||
|
|
||||||
|
mouse_move(handle);
|
||||||
MwForceRender(handle);
|
MwForceRender(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -629,21 +645,6 @@ static void prop_change(MwWidget handle, const char* key) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mouse_move(MwWidget handle) {
|
|
||||||
char* event = in_hitbox(handle, &handle->mouse_point);
|
|
||||||
MwDocument d = handle->internal;
|
|
||||||
|
|
||||||
if(d->center_cursor && event == NULL) {
|
|
||||||
MwLLSetCursor(handle->lowlevel, &MwCursorDefault, &MwCursorDefaultMask);
|
|
||||||
|
|
||||||
d->center_cursor = 0;
|
|
||||||
} else if(!d->center_cursor && event != NULL) {
|
|
||||||
MwLLSetCursor(handle->lowlevel, &MwCursorCenter, &MwCursorCenterMask);
|
|
||||||
|
|
||||||
d->center_cursor = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void resize(MwWidget handle) {
|
static void resize(MwWidget handle) {
|
||||||
layout(handle);
|
layout(handle);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue