hides scaler on minimize + tweaked clip panel rect

This commit is contained in:
vurtun
2015-04-07 18:28:29 +02:00
parent 0a7b0b44f8
commit 8d0aba0dc6
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -196,7 +196,7 @@ main(int argc, char *argv[])
config.colors[GUI_COLOR_TEXT].g = 255;
config.colors[GUI_COLOR_TEXT].b = 255;
config.colors[GUI_COLOR_TEXT].a = 255;
panel = gui_panel_new(ctx, 50, 50, 500, 300, &config, font);
panel = gui_panel_new(ctx, 50, 50, 500, 320, &config, font);
message = gui_panel_new(ctx, 150, 150, 200, 100, &config, font);
color_panel = gui_panel_new(ctx, 250, 250, 400, 250, &config, font);
+5 -5
View File
@@ -1602,15 +1602,15 @@ gui_panel_begin(struct gui_panel *panel, struct gui_draw_buffer *out,
gui_draw_rectf(out, x, y, w, panel->header_height, *header);
clip.x = x; clip.w = w;
clip.y = y + panel->header_height;
clip.h = h - panel->header_height;
clip.y = y + panel->header_height - 1;
clip.h = h - panel->header_height - 1;
if (panel->flags & GUI_PANEL_SCROLLBAR)
clip.h -= (config->panel_padding.y + config->item_padding.y);
else clip.h = null_rect.h;
} else {
panel->header_height = config->panel_padding.y + config->item_padding.y;
clip.x = x; clip.y = y;
clip.w = w; clip.h = h;
clip.x = x; clip.y = y - 1;
clip.w = w; clip.h = h + 1;
if (panel->flags & GUI_PANEL_SCROLLBAR)
clip.h -= panel->header_height;
else clip.h = null_rect.h;
@@ -2870,7 +2870,7 @@ gui_end_panel(struct gui_context *ctx, struct gui_panel *panel,
cpanel = (struct gui_context_panel*)panel;
gui_panel_end(panel);
if (ctx->active == cpanel && (panel->flags & GUI_PANEL_SCALEABLE) &&
if (!panel->minimized && ctx->active == cpanel && (panel->flags & GUI_PANEL_SCALEABLE) &&
(panel->flags & GUI_PANEL_SCROLLBAR)) {
const struct gui_config *config = panel->config;
struct gui_color col = config->colors[GUI_COLOR_SCALER];