updated examples

This commit is contained in:
vurtun 2015-11-05 19:39:14 +01:00
parent 05742a2f9e
commit cb2e9c2f41
3 changed files with 14 additions and 15 deletions

View File

@ -506,7 +506,7 @@ file_browser_run(struct file_browser *browser, int width, int height)
zr_style_push_property(&browser->config, ZR_PROPERTY_ITEM_SPACING, zr_vec2(0, 4));
/* output special important directory list in own window */
zr_group_begin(&context, &sub, NULL, ZR_WINDOW_NO_SCROLLBAR, browser->sel);
zr_group_begin(&context, &sub, NULL, ZR_WINDOW_NO_SCROLLBAR|ZR_WINDOW_BORDER, browser->sel);
{
struct zr_image home = icons->home.img;
struct zr_image desktop = icons->desktop.img;
@ -542,7 +542,7 @@ file_browser_run(struct file_browser *browser, int width, int height)
}
/* output directory content window */
zr_group_begin(&context, &sub, NULL, 0, browser->dir);
zr_group_begin(&context, &sub, NULL, ZR_WINDOW_BORDER, browser->dir);
{
int index = -1;
size_t i = 0, j = 0, k = 0;

View File

@ -1,5 +1,5 @@
# Install
BIN = zahnrad
BIN = nodedit
# Compiler
CC = clang

View File

@ -230,10 +230,8 @@ node_editor_draw(struct zr_context *layout, struct node_editor *nodedit,
zr_group_begin(layout, &node, it->name,
ZR_WINDOW_MOVEABLE|ZR_WINDOW_NO_SCROLLBAR, zr_vec2(0,0));
{
struct zr_color color;
const char *str[] = {"R:", "G:", "B:", "A:"};
zr_int r,g,b;
zr_float ratio[] = {0.25f, 0.75f};
zr_byte *iter = &it->color.r;
/* always have last selected node on top */
if (zr_input_mouse_clicked(in, ZR_BUTTON_LEFT, node.bounds) &&
@ -246,16 +244,17 @@ node_editor_draw(struct zr_context *layout, struct node_editor *nodedit,
/* ================= NODE CONTENT =====================*/
zr_layout_row_dynamic(&node, 30, 1);
color = it->color;
zr_button_color(&node, color, ZR_BUTTON_DEFAULT);
r = it->color.r, g = it->color.g, b = it->color.b;
zr_button_color(&node, it->color, ZR_BUTTON_DEFAULT);
zr_layout_row(&node, ZR_DYNAMIC, 30, 2, ratio);
for (n = 0; n < 3; ++n) {
zr_float t = *iter;
zr_label(&node, str[n], ZR_TEXT_LEFT);
t = zr_slider(&node, 0, t, 255, 10);
*iter = (zr_byte)t;
iter++;
}
zr_label(&node, "R:", ZR_TEXT_LEFT);
zr_slider_int(&node, 0, &r, 255, 10);
zr_label(&node, "G:", ZR_TEXT_LEFT);
zr_slider_int(&node, 0, &g, 255, 10);
zr_label(&node, "B:", ZR_TEXT_LEFT);
zr_slider_int(&node, 0, &b, 255, 10);
it->color.r = r; it->color.g = g; it->color.b = b;
/* ====================================================*/
}
zr_group_end(layout, &node, NULL);