}
switch(w->type) {
+ case RTK_WIN:
+ rect->width = w->any.width;
+ rect->height = w->any.height;
+ break;
+
case RTK_BUTTON:
if(w->bn.icon) {
rect->width = w->bn.icon->width + OFFS * 2;
case RTK_SEP:
if(w->any.par->win.layout == RTK_VBOX) {
rect->width = w->any.par->any.width - PAD * 2;
- rect->height = (PAD + BEVELSZ) * 2;
+ rect->height = PAD * 4 + BEVELSZ * 2;
} else if(w->any.par->win.layout == RTK_HBOX) {
- rect->width = (PAD + BEVELSZ) * 2;
+ rect->width = PAD * 4 + BEVELSZ * 2;
rect->height = w->any.par->any.height - PAD * 2;
} else {
rect->width = rect->height = 0;
{
int x, y;
rtk_widget *c;
+ rtk_rect rect;
if(w->any.type == RTK_WIN && w->win.layout != RTK_NONE) {
x = y = PAD;
calc_layout(c);
if(w->win.layout == RTK_VBOX) {
- y += c->any.height + PAD;
+ y += c->any.height + PAD * 2;
} else {
- x += c->any.width + PAD;
+ x += c->any.width + PAD * 2;
}
c = c->any.next;
}
}
+ calc_widget_rect(w, &rect);
+ w->any.width = rect.width;
+ w->any.height = rect.height;
+
w->any.flags = (w->any.flags & ~GEOMCHG) | DIRTY;
}
#define COL_BG 0xff666666
#define COL_LBEV 0xffaaaaaa
-#define COL_SBEV 0xff333333
+#define COL_SBEV 0xff222222
#define COL_TEXT 0xff000000
static void hline(int x, int y, int sz, uint32_t col)
rtk_widget *win = w->any.par;
rtk_rect rect;
+ if(!win) return;
+
widget_rect(w, &rect);
abs_pos(w, &rect.x, &rect.y);
+ switch(win->win.layout) {
+ case RTK_VBOX:
+ rect.y += PAD * 2;
+ rect.height = 2;
+ break;
+
+ case RTK_HBOX:
+ rect.x += PAD * 2;
+ rect.width = 2;
+ break;
+
+ default:
+ break;
+ }
+
draw_frame(&rect, FRM_INSET);
}