This commit is contained in:
parent
dce15aed4d
commit
3542d7524a
2 changed files with 97 additions and 30 deletions
|
|
@ -3,6 +3,72 @@
|
|||
#define TitleHeight 20
|
||||
#define ButtonSize 14
|
||||
|
||||
static void close_draw(MwWidget handle) {
|
||||
int w = MwGetInteger(handle, MwNwidth);
|
||||
int h = MwGetInteger(handle, MwNheight);
|
||||
MwPoint p[2];
|
||||
MwLLColor c = MwParseColor(handle, MwGetText(handle, MwNforeground));
|
||||
int bw = MwDefaultBorderWidth(handle);
|
||||
|
||||
p[0].x = bw * 2;
|
||||
p[0].y = bw * 2;
|
||||
p[1].x = w - bw * 2 - 1;
|
||||
p[1].y = h - bw * 2 - 1;
|
||||
MwLLLine(handle->lowlevel, p, c);
|
||||
|
||||
p[0].x = w - bw * 2 - 1;
|
||||
p[0].y = bw * 2;
|
||||
p[1].x = bw * 2;
|
||||
p[1].y = h - bw * 2 - 1;
|
||||
MwLLLine(handle->lowlevel, p, c);
|
||||
|
||||
MwLLFreeColor(c);
|
||||
}
|
||||
|
||||
static void maximize_draw(MwWidget handle) {
|
||||
int w = MwGetInteger(handle, MwNwidth);
|
||||
int h = MwGetInteger(handle, MwNheight);
|
||||
MwPoint p[2];
|
||||
MwLLColor c = MwParseColor(handle, MwGetText(handle, MwNforeground));
|
||||
int bw = MwDefaultBorderWidth(handle);
|
||||
|
||||
p[0].x = bw * 2;
|
||||
p[0].y = bw * 2;
|
||||
p[1].x = w - bw * 2 - 1;
|
||||
p[1].y = bw * 2;
|
||||
MwLLLine(handle->lowlevel, p, c);
|
||||
|
||||
p[0].y = p[1].y = h - bw * 2 - 1;
|
||||
MwLLLine(handle->lowlevel, p, c);
|
||||
|
||||
p[0].x = bw * 2;
|
||||
p[0].y = bw * 2;
|
||||
p[1].x = bw * 2;
|
||||
p[1].y = h - bw * 2 - 1;
|
||||
MwLLLine(handle->lowlevel, p, c);
|
||||
|
||||
p[0].x = p[1].x = w - bw * 2 - 1;
|
||||
MwLLLine(handle->lowlevel, p, c);
|
||||
|
||||
MwLLFreeColor(c);
|
||||
}
|
||||
|
||||
static void minimize_draw(MwWidget handle) {
|
||||
int w = MwGetInteger(handle, MwNwidth);
|
||||
int h = MwGetInteger(handle, MwNheight);
|
||||
MwPoint p[2];
|
||||
MwLLColor c = MwParseColor(handle, MwGetText(handle, MwNforeground));
|
||||
int bw = MwDefaultBorderWidth(handle);
|
||||
|
||||
p[0].x = bw * 2;
|
||||
p[0].y = h - bw * 2 - 1;
|
||||
p[1].x = w - bw * 2 - 1;
|
||||
p[1].y = h - bw * 2 - 1;
|
||||
MwLLLine(handle->lowlevel, p, c);
|
||||
|
||||
MwLLFreeColor(c);
|
||||
}
|
||||
|
||||
static void resize(MwWidget handle) {
|
||||
MwSubWindow sw = handle->internal;
|
||||
int x, y, w, h;
|
||||
|
|
@ -36,6 +102,7 @@ static void resize(MwWidget handle){
|
|||
x -= ButtonSize; \
|
||||
if(sw->name == NULL) { \
|
||||
sw->name = MwCreateWidget(MwButtonClass, #name, handle, x, y, w, h); \
|
||||
sw->name->draw_inject = name##_draw; \
|
||||
} else { \
|
||||
MwVaApply(sw->name, \
|
||||
MwNx, x, \
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "../../external/stb_ds.h"
|
||||
|
||||
#define OpenerSize 10
|
||||
#define OpenerSize 11
|
||||
#define LineSpace 16
|
||||
#define LinePadding 4
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ static void recursion(MwWidget handle, MwTreeViewEntry* tree, MwTreeViewEntry**
|
|||
MwDrawRect(handle, &r, col);
|
||||
MwDrawFrame(handle, &r, base, tree->opened);
|
||||
if(tree->opened) {
|
||||
l[0].x = r.x + (r.width - len) / 2;
|
||||
l[0].x = r.x + (r.width - 1 - len) / 2;
|
||||
l[0].y = r.y + r.height / 2;
|
||||
|
||||
l[1].x = l[0].x + len;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue