mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 22:08:41 +00:00
default settings categories to closed
This commit is contained in:
@@ -8490,7 +8490,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings)
|
|||||||
DF_ThemeColor color_ctx_menu_color;
|
DF_ThemeColor color_ctx_menu_color;
|
||||||
Vec4F32 color_ctx_menu_color_hsva;
|
Vec4F32 color_ctx_menu_color_hsva;
|
||||||
DF_ThemePreset preset_apply_confirm;
|
DF_ThemePreset preset_apply_confirm;
|
||||||
B32 category_collapsed[DF_SettingsItemKind_COUNT];
|
B32 category_opened[DF_SettingsItemKind_COUNT];
|
||||||
};
|
};
|
||||||
DF_SettingsViewState *sv = df_view_user_state(view, DF_SettingsViewState);
|
DF_SettingsViewState *sv = df_view_user_state(view, DF_SettingsViewState);
|
||||||
if(!sv->initialized)
|
if(!sv->initialized)
|
||||||
@@ -8514,12 +8514,12 @@ DF_VIEW_UI_FUNCTION_DEF(Settings)
|
|||||||
items_list.count += 1;
|
items_list.count += 1;
|
||||||
n->v.kind = DF_SettingsItemKind_CategoryHeader;
|
n->v.kind = DF_SettingsItemKind_CategoryHeader;
|
||||||
n->v.string = str8_lit("Interface Settings");
|
n->v.string = str8_lit("Interface Settings");
|
||||||
n->v.icon_kind = sv->category_collapsed[DF_SettingsItemKind_Setting] ? DF_IconKind_RightCaret : DF_IconKind_DownCaret;
|
n->v.icon_kind = sv->category_opened[DF_SettingsItemKind_Setting] ? DF_IconKind_DownCaret : DF_IconKind_RightCaret;
|
||||||
n->v.category = DF_SettingsItemKind_Setting;
|
n->v.category = DF_SettingsItemKind_Setting;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- rjf: gather all settings
|
//- rjf: gather all settings
|
||||||
if(!sv->category_collapsed[DF_SettingsItemKind_Setting] || query.size != 0)
|
if(sv->category_opened[DF_SettingsItemKind_Setting] || query.size != 0)
|
||||||
{
|
{
|
||||||
for(EachEnumVal(DF_SettingCode, code))
|
for(EachEnumVal(DF_SettingCode, code))
|
||||||
{
|
{
|
||||||
@@ -8552,12 +8552,12 @@ DF_VIEW_UI_FUNCTION_DEF(Settings)
|
|||||||
items_list.count += 1;
|
items_list.count += 1;
|
||||||
n->v.kind = DF_SettingsItemKind_CategoryHeader;
|
n->v.kind = DF_SettingsItemKind_CategoryHeader;
|
||||||
n->v.string = str8_lit("Theme Presets");
|
n->v.string = str8_lit("Theme Presets");
|
||||||
n->v.icon_kind = sv->category_collapsed[DF_SettingsItemKind_ThemePreset] ? DF_IconKind_RightCaret : DF_IconKind_DownCaret;
|
n->v.icon_kind = sv->category_opened[DF_SettingsItemKind_Setting] ? DF_IconKind_DownCaret : DF_IconKind_RightCaret;
|
||||||
n->v.category = DF_SettingsItemKind_ThemePreset;
|
n->v.category = DF_SettingsItemKind_ThemePreset;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- rjf: gather theme presets
|
//- rjf: gather theme presets
|
||||||
if(!sv->category_collapsed[DF_SettingsItemKind_ThemePreset] || query.size != 0)
|
if(sv->category_opened[DF_SettingsItemKind_ThemePreset] || query.size != 0)
|
||||||
{
|
{
|
||||||
for(EachEnumVal(DF_ThemePreset, preset))
|
for(EachEnumVal(DF_ThemePreset, preset))
|
||||||
{
|
{
|
||||||
@@ -8590,12 +8590,12 @@ DF_VIEW_UI_FUNCTION_DEF(Settings)
|
|||||||
items_list.count += 1;
|
items_list.count += 1;
|
||||||
n->v.kind = DF_SettingsItemKind_CategoryHeader;
|
n->v.kind = DF_SettingsItemKind_CategoryHeader;
|
||||||
n->v.string = str8_lit("Theme Colors");
|
n->v.string = str8_lit("Theme Colors");
|
||||||
n->v.icon_kind = sv->category_collapsed[DF_SettingsItemKind_ThemeColor] ? DF_IconKind_RightCaret : DF_IconKind_DownCaret;
|
n->v.icon_kind = sv->category_opened[DF_SettingsItemKind_Setting] ? DF_IconKind_DownCaret : DF_IconKind_RightCaret;
|
||||||
n->v.category = DF_SettingsItemKind_ThemeColor;
|
n->v.category = DF_SettingsItemKind_ThemeColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- rjf: gather all theme colors
|
//- rjf: gather all theme colors
|
||||||
if(!sv->category_collapsed[DF_SettingsItemKind_ThemeColor] || query.size != 0)
|
if(sv->category_opened[DF_SettingsItemKind_ThemeColor] || query.size != 0)
|
||||||
{
|
{
|
||||||
for(EachNonZeroEnumVal(DF_ThemeColor, color))
|
for(EachNonZeroEnumVal(DF_ThemeColor, color))
|
||||||
{
|
{
|
||||||
@@ -9026,7 +9026,7 @@ DF_VIEW_UI_FUNCTION_DEF(Settings)
|
|||||||
}
|
}
|
||||||
if(item->kind == DF_SettingsItemKind_CategoryHeader && ui_pressed(sig))
|
if(item->kind == DF_SettingsItemKind_CategoryHeader && ui_pressed(sig))
|
||||||
{
|
{
|
||||||
sv->category_collapsed[item->category] ^= 1;
|
sv->category_opened[item->category] ^= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -1733,10 +1733,10 @@ ui_layout_position__in_place_rec(UI_Box *root, Axis2 axis)
|
|||||||
child->rect.p0.v[axis] = root->rect.p0.v[axis] + child->fixed_position.v[axis] - !(child->flags&(UI_BoxFlag_SkipViewOffX<<axis))*floor_f32(root->view_off.v[axis]);
|
child->rect.p0.v[axis] = root->rect.p0.v[axis] + child->fixed_position.v[axis] - !(child->flags&(UI_BoxFlag_SkipViewOffX<<axis))*floor_f32(root->view_off.v[axis]);
|
||||||
}
|
}
|
||||||
child->rect.p1.v[axis] = child->rect.p0.v[axis] + child->fixed_size.v[axis];
|
child->rect.p1.v[axis] = child->rect.p0.v[axis] + child->fixed_size.v[axis];
|
||||||
child->rect.p0.x = floorf(child->rect.p0.x);
|
child->rect.p0.x = floor_f32(child->rect.p0.x);
|
||||||
child->rect.p0.y = floorf(child->rect.p0.y);
|
child->rect.p0.y = floor_f32(child->rect.p0.y);
|
||||||
child->rect.p1.x = floorf(child->rect.p1.x);
|
child->rect.p1.x = floor_f32(child->rect.p1.x);
|
||||||
child->rect.p1.y = floorf(child->rect.p1.y);
|
child->rect.p1.y = floor_f32(child->rect.p1.y);
|
||||||
|
|
||||||
// rjf: grab new position
|
// rjf: grab new position
|
||||||
F32 new_position = Min(child->rect.p0.v[axis], child->rect.p1.v[axis]);
|
F32 new_position = Min(child->rect.p0.v[axis], child->rect.p1.v[axis]);
|
||||||
@@ -2411,7 +2411,7 @@ ui_box_text_position(UI_Box *box)
|
|||||||
case UI_TextAlign_Center:
|
case UI_TextAlign_Center:
|
||||||
{
|
{
|
||||||
Vec2F32 text_dim = box->display_string_runs.dim;
|
Vec2F32 text_dim = box->display_string_runs.dim;
|
||||||
result.x = round_f32((box->rect.p0.x + box->rect.p1.x)/2 - text_dim.x/2) - 1.f;
|
result.x = floor_f32((box->rect.p0.x + box->rect.p1.x)/2 - text_dim.x/2);
|
||||||
result.x = ClampBot(result.x, box->rect.x0);
|
result.x = ClampBot(result.x, box->rect.x0);
|
||||||
}break;
|
}break;
|
||||||
case UI_TextAlign_Right:
|
case UI_TextAlign_Right:
|
||||||
|
|||||||
Reference in New Issue
Block a user