mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-11 03:43:29 +00:00
fix memleak
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@520 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -280,6 +280,13 @@ MWDECL void MwHideCursor(MwWidget handle);
|
|||||||
*/
|
*/
|
||||||
MWDECL void MwToggleDarkTheme(MwWidget handle, int toggle);
|
MWDECL void MwToggleDarkTheme(MwWidget handle, int toggle);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Gets the parent widget
|
||||||
|
* @param handle Widget
|
||||||
|
* @return Parent widget
|
||||||
|
*/
|
||||||
|
MWDECL MwWidget MwGetParent(MwWidget handle);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -588,3 +588,7 @@ void MwToggleDarkTheme(MwWidget handle, int toggle) {
|
|||||||
force_render_all(handle);
|
force_render_all(handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MwWidget MwGetParent(MwWidget handle){
|
||||||
|
return handle->parent;
|
||||||
|
}
|
||||||
|
|||||||
@@ -121,6 +121,8 @@ void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color) {
|
|||||||
pixmap = MwLLCreatePixmap(handle->lowlevel, data, rect->width / 4, rect->height);
|
pixmap = MwLLCreatePixmap(handle->lowlevel, data, rect->width / 4, rect->height);
|
||||||
MwLLDrawPixmap(handle->lowlevel, rect, pixmap);
|
MwLLDrawPixmap(handle->lowlevel, rect, pixmap);
|
||||||
MwLLDestroyPixmap(pixmap);
|
MwLLDestroyPixmap(pixmap);
|
||||||
|
|
||||||
|
free(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert) {
|
void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert) {
|
||||||
|
|||||||
@@ -192,6 +192,8 @@ static void frame_draw(MwWidget handle) {
|
|||||||
int i;
|
int i;
|
||||||
MwPoint p;
|
MwPoint p;
|
||||||
int st = 0;
|
int st = 0;
|
||||||
|
int ent;
|
||||||
|
int area;
|
||||||
|
|
||||||
r.x = 0;
|
r.x = 0;
|
||||||
r.y = 0;
|
r.y = 0;
|
||||||
@@ -203,7 +205,10 @@ static void frame_draw(MwWidget handle) {
|
|||||||
|
|
||||||
st = get_first_entry(handle->parent, lb);
|
st = get_first_entry(handle->parent, lb);
|
||||||
|
|
||||||
for(i = st; i < arrlen(lb->list) && i < st + (r.height - MwGetDefaultBorderWidth(handle) * 2) / MwTextHeight(handle, "M"); i++) {
|
area = r.height - MwGetDefaultBorderWidth(handle) * 2;
|
||||||
|
ent = area / MwTextHeight(handle, "M");
|
||||||
|
|
||||||
|
for(i = st; i < arrlen(lb->list) && i < st + ent; i++) {
|
||||||
int selected = lb->selected == i ? 1 : 0;
|
int selected = lb->selected == i ? 1 : 0;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user