Skip to content

Commit

Permalink
Removed unused style properties
Browse files Browse the repository at this point in the history
  • Loading branch information
vurtun committed Apr 1, 2016
1 parent 08ab2b4 commit 803e369
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 106 deletions.
70 changes: 2 additions & 68 deletions zahnrad.c
Original file line number Diff line number Diff line change
Expand Up @@ -7774,9 +7774,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
button->text_alignment = ZR_TEXT_CENTERED;
button->border = 1.0f;
button->rounding = 4.0f;
button->fixed_width = 0;
button->fixed_height = 0;
button->has_fixed_size = 0;
button->draw_begin = 0;
button->draw_end = 0;

Expand All @@ -7797,9 +7794,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
button->text_alignment = ZR_TEXT_CENTERED;
button->border = 0.0f;
button->rounding = 0.0f;
button->fixed_width = 0;
button->fixed_height = 0;
button->has_fixed_size = 0;
button->draw_begin = 0;
button->draw_end = 0;

Expand All @@ -7820,9 +7814,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
button->text_alignment = ZR_TEXT_CENTERED;
button->border = 0.0f;
button->rounding = 1.0f;
button->fixed_width = 0;
button->fixed_height = 0;
button->has_fixed_size = 0;
button->draw_begin = 0;
button->draw_end = 0;

Expand All @@ -7841,9 +7832,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
toggle->text_active = table[ZR_COLOR_TEXT];
toggle->padding = zr_vec2(4.0f, 4.0f);
toggle->touch_padding = zr_vec2(0,0);
toggle->fixed_width = 0;
toggle->fixed_height = 0;
toggle->has_fixed_size = 0;

/* option toggle */
toggle = &style->option;
Expand All @@ -7860,9 +7848,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
toggle->text_active = table[ZR_COLOR_TEXT];
toggle->padding = zr_vec2(4.0f, 4.0f);
toggle->touch_padding = zr_vec2(0,0);
toggle->fixed_width = 0;
toggle->fixed_height = 0;
toggle->has_fixed_size = 0;

/* selectable */
select = &style->selectable;
Expand All @@ -7882,10 +7867,7 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
select->padding = zr_vec2(4.0f,4.0f);
select->touch_padding = zr_vec2(0,0);
select->userdata = zr_handle_ptr(0);
select->fixed_width = 0;
select->fixed_height = 0;
select->rounding = 0.0f;
select->has_fixed_size = 0;
select->draw_begin = 0;
select->draw = 0;
select->draw_end = 0;
Expand All @@ -7912,9 +7894,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
slider->show_buttons = zr_false;
slider->bar_height = 8;
slider->rounding = 0;
slider->fixed_width = 0;
slider->fixed_height = 0;
slider->has_fixed_size = 0;
slider->draw_begin = 0;
slider->draw = 0;
slider->draw_end = 0;
Expand All @@ -7935,9 +7914,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
button->text_alignment = ZR_TEXT_CENTERED;
button->border = 1.0f;
button->rounding = 0.0f;
button->fixed_width = 0;
button->fixed_height = 0;
button->has_fixed_size = 0;
button->draw_begin = 0;
button->draw_end = 0;
style->slider.dec_button = style->slider.inc_button;
Expand All @@ -7954,9 +7930,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
prog->userdata = zr_handle_ptr(0);
prog->padding = zr_vec2(4,4);
prog->rounding = 0;
prog->fixed_width = 0;
prog->fixed_height = 0;
prog->has_fixed_size = 0;
prog->draw_begin = 0;
prog->draw = 0;
prog->draw_end = 0;
Expand Down Expand Up @@ -7999,9 +7972,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
button->text_alignment = ZR_TEXT_CENTERED;
button->border = 1.0f;
button->rounding = 0.0f;
button->fixed_width = 0;
button->fixed_height = 0;
button->has_fixed_size = 0;
button->draw_begin = 0;
button->draw_end = 0;
style->scrollh.dec_button = style->scrollh.inc_button;
Expand Down Expand Up @@ -8030,9 +8000,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
edit->cursor_size = 4;
edit->border = 1;
edit->rounding = 0;
edit->fixed_width = 0;
edit->fixed_height = 0;
edit->has_fixed_size = 0;
edit->draw_begin = 0;
edit->draw = 0;
edit->draw_end = 0;
Expand All @@ -8053,9 +8020,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
property->padding = zr_vec2(4,4);
property->border = 1;
property->rounding = 10;
property->has_fixed_size = 0;
property->fixed_width = 0;
property->fixed_height = 0;
property->draw_begin = 0;
property->draw = 0;
property->draw_end = 0;
Expand All @@ -8077,9 +8041,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
button->text_alignment = ZR_TEXT_CENTERED;
button->border = 0.0f;
button->rounding = 0.0f;
button->fixed_width = 0;
button->fixed_height = 0;
button->has_fixed_size = 0;
button->draw_begin = 0;
button->draw_end = 0;
style->property.inc_button = style->property.dec_button;
Expand Down Expand Up @@ -8107,9 +8068,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
edit->cursor_size = 8;
edit->border = 0;
edit->rounding = 0;
edit->fixed_width = 0;
edit->fixed_height = 0;
edit->has_fixed_size = 0;
edit->draw_begin = 0;
edit->draw = 0;
edit->draw_end = 0;
Expand All @@ -8123,9 +8081,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
chart->color = table[ZR_COLOR_CHART_COLOR];
chart->border = 0;
chart->rounding = 0;
chart->has_fixed_size = 0;
chart->fixed_width = 0;
chart->fixed_height = 0;
chart->padding = zr_vec2(4,4);
style->column_chart = *chart;

Expand All @@ -8146,9 +8101,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
combo->spacing = zr_vec2(4,0);
combo->border = 1;
combo->rounding = 0;
combo->has_fixed_size = 0;
combo->fixed_width = 0;
combo->fixed_height = 0;

/* combo button */
button = &style->combo.button;
Expand All @@ -8167,9 +8119,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
button->text_alignment = ZR_TEXT_CENTERED;
button->border = 0.0f;
button->rounding = 0.0f;
button->fixed_width = 0;
button->fixed_height = 0;
button->has_fixed_size = 0;
button->draw_begin = 0;
button->draw_end = 0;

Expand Down Expand Up @@ -8202,9 +8151,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
button->text_alignment = ZR_TEXT_CENTERED;
button->border = 0.0f;
button->rounding = 0.0f;
button->fixed_width = 0;
button->fixed_height = 0;
button->has_fixed_size = 0;
button->draw_begin = 0;
button->draw_end = 0;

Expand All @@ -8225,9 +8171,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
button->text_alignment = ZR_TEXT_CENTERED;
button->border = 0.0f;
button->rounding = 0.0f;
button->fixed_width = 0;
button->fixed_height = 0;
button->has_fixed_size = 0;
button->draw_begin = 0;
button->draw_end = 0;

Expand Down Expand Up @@ -8264,9 +8207,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
button->text_alignment = ZR_TEXT_CENTERED;
button->border = 0.0f;
button->rounding = 0.0f;
button->fixed_width = 0;
button->fixed_height = 0;
button->has_fixed_size = 0;
button->draw_begin = 0;
button->draw_end = 0;

Expand All @@ -8287,9 +8227,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
button->text_alignment = ZR_TEXT_CENTERED;
button->border = 0.0f;
button->rounding = 0.0f;
button->fixed_width = 0;
button->fixed_height = 0;
button->has_fixed_size = 0;
button->draw_begin = 0;
button->draw_end = 0;

Expand All @@ -8301,9 +8238,6 @@ zr_style_from_table(struct zr_context *ctx, const struct zr_color *table)
win->footer_padding = zr_vec2(4,4);
win->border = 1.0f;
win->rounding = 0.0f;
win->has_fixed_size = 0;
win->fixed_width = 0;
win->fixed_height = 0;
win->scaler_size = zr_vec2(16,16);
win->padding = zr_vec2(8,8);
win->spacing = zr_vec2(4,4);
Expand Down Expand Up @@ -9502,7 +9436,6 @@ zr_panel_begin(struct zr_context *ctx, const char *title)
#endif

/* setup window layout */
out = &win->buffer;
layout->bounds = win->bounds;
layout->at_x = win->bounds.x;
layout->at_y = win->bounds.y;
Expand All @@ -9516,6 +9449,7 @@ zr_panel_begin(struct zr_context *ctx, const char *title)
layout->row.item_width = 0;
layout->row.tree_depth = 0;
layout->flags = win->flags;
out = &win->buffer;

/* calculate window header */
if (win->flags & ZR_WINDOW_MINIMIZED) {
Expand Down Expand Up @@ -9567,7 +9501,7 @@ zr_panel_begin(struct zr_context *ctx, const char *title)
layout->height -= layout->footer_h;

/* select correct header background and text color */
if (ctx->active == win) {;
if (ctx->active == win) {
background = &style->window.header.active;
text.text = style->window.header.label_active;
} else if (zr_input_is_mouse_hovering_rect(&ctx->input, header)) {
Expand Down
45 changes: 7 additions & 38 deletions zahnrad.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,12 @@ extern "C" {
/* setting this define to 1 adds header <assert.h> for the assert macro
IMPORTANT: it also adds the standard library assert so only use it if wanted */
#define ZR_COMPILE_WITH_DEFAULT_ALLOCATOR 1
/* setting this to 1 create a default allocator to be used for memory management
* everywhere inside this library. if 0 you either have to provide a fixed size
* memory block or a custom allocator.
/* setting this to 1 adds default allocator functions to ease memory management
* if 0 you either have to provide a fixed size memory block or a custom allocator.
* IMPORTANT: this adds <stdlib.h> with malloc and free so set 0 if you don't want
* to link to the standard library!*/
#define ZR_COMPILE_WITH_STANDARD_IO 1
/* setting this to 1 create a default allocator to be used for memory management
/* setting this to 1 includes standard file IO and variable arguments
* IMPORTANT: this adds <stdio.h> with fopen,fclose,... and <stdarg> so set 0
* if you don't want to link to the standard library!*/
#define ZR_COMPILE_WITH_VERTEX_BUFFER 1
Expand Down Expand Up @@ -1244,9 +1243,6 @@ struct zr_style_button {
/* properties */
float border;
float rounding;
float fixed_width;
float fixed_height;
int has_fixed_size;
struct zr_vec2 padding;
struct zr_vec2 image_padding;
struct zr_vec2 touch_padding;
Expand Down Expand Up @@ -1290,9 +1286,6 @@ struct zr_style_toggle {
zr_flags text_alignment;

/* properties */
float fixed_width;
float fixed_height;
int has_fixed_size;
struct zr_vec2 padding;
struct zr_vec2 touch_padding;

Expand Down Expand Up @@ -1327,10 +1320,7 @@ struct zr_style_selectable {
zr_flags text_alignment;

/* properties */
float fixed_width;
float fixed_height;
float rounding;
int has_fixed_size;
struct zr_vec2 padding;
struct zr_vec2 touch_padding;

Expand Down Expand Up @@ -1370,10 +1360,6 @@ struct zr_style_slider {
struct zr_vec2 spacing;
struct zr_vec2 cursor_size;

int has_fixed_size;
float fixed_width;
float fixed_height;

/* optional buttons */
int show_buttons;
struct zr_style_button inc_button;
Expand Down Expand Up @@ -1403,9 +1389,6 @@ struct zr_style_progress {

/* properties */
float rounding;
float fixed_width;
float fixed_height;
int has_fixed_size;
struct zr_vec2 padding;

/* optional user callbacks */
Expand Down Expand Up @@ -1477,9 +1460,6 @@ struct zr_style_edit {
float border;
float rounding;
float cursor_size;
float fixed_width;
float fixed_height;
int has_fixed_size;
struct zr_vec2 padding;

/* optional user callbacks */
Expand Down Expand Up @@ -1513,9 +1493,6 @@ struct zr_style_property {
/* properties */
float border;
float rounding;
int has_fixed_size;
float fixed_width;
float fixed_height;
struct zr_vec2 padding;

struct zr_style_edit edit;
Expand All @@ -1541,9 +1518,6 @@ struct zr_style_chart {
/* properties */
float border;
float rounding;
int has_fixed_size;
float fixed_width;
float fixed_height;
struct zr_vec2 padding;
};

Expand Down Expand Up @@ -1573,9 +1547,6 @@ struct zr_style_combo {
/* properties */
float border;
float rounding;
int has_fixed_size;
float fixed_width;
float fixed_height;
struct zr_vec2 content_padding;
struct zr_vec2 button_padding;
struct zr_vec2 spacing;
Expand Down Expand Up @@ -1640,10 +1611,8 @@ struct zr_style_window {
struct zr_vec2 footer_padding;

float border;
float fixed_border;
float rounding;
int has_fixed_size;
float fixed_width;
float fixed_height;
struct zr_vec2 scaler_size;
struct zr_vec2 padding;
struct zr_vec2 spacing;
Expand Down Expand Up @@ -1790,8 +1759,8 @@ enum zr_chart_event {
};

enum zr_color_picker_format {
ZR_RGB = 0,
ZR_RGBA = 1
ZR_RGB,
ZR_RGBA
};

enum zr_popup_type {
Expand Down Expand Up @@ -1955,9 +1924,9 @@ struct zr_property_state {
struct zr_table;
struct zr_window {
zr_hash name;
zr_flags flags;
unsigned int seq;
struct zr_rect bounds;
zr_flags flags;
struct zr_scroll scrollbar;
struct zr_command_buffer buffer;
struct zr_panel *layout;
Expand Down

0 comments on commit 803e369

Please sign in to comment.