mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 13:58:40 +00:00
per-window theme-usage setting - by default, prioritize project theme settings, but allow using only user themes per-window as well.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -414,6 +414,10 @@ RD_VocabTable:
|
|||||||
'row_height': @range[1.75f, 5.f] f32,
|
'row_height': @range[1.75f, 5.f] f32,
|
||||||
@default(3.f) @description("Controls the height of tabs, in multiples of the font size.")
|
@default(3.f) @description("Controls the height of tabs, in multiples of the font size.")
|
||||||
'tab_height': @range[1.75f, 5.f] f32,
|
'tab_height': @range[1.75f, 5.f] f32,
|
||||||
|
|
||||||
|
//- rjf: theme settings
|
||||||
|
@default(1) @display_name('Use Project Theme') @description("Prefer using the project theme for this window, if any. If off, only the user's theme settings will be used.")
|
||||||
|
'use_project_theme': bool,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5757,10 +5757,20 @@ rd_window_frame(void)
|
|||||||
// that windows can have their own colors, and have those override higher-up settings.
|
// that windows can have their own colors, and have those override higher-up settings.
|
||||||
RD_Cfg *preset_cfg = &rd_nil_cfg;
|
RD_Cfg *preset_cfg = &rd_nil_cfg;
|
||||||
RD_CfgList colors_cfgs = {0};
|
RD_CfgList colors_cfgs = {0};
|
||||||
RD_Cfg *scan_parents[] = {window, rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("project")), rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("user"))};
|
RD_Cfg *theme_parents[] =
|
||||||
for EachElement(idx, scan_parents)
|
|
||||||
{
|
{
|
||||||
RD_Cfg *parent_cfg = scan_parents[idx];
|
rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("project")),
|
||||||
|
rd_cfg_child_from_string(rd_state->root_cfg, str8_lit("user"))
|
||||||
|
};
|
||||||
|
U64 theme_parents_count = ArrayCount(theme_parents);
|
||||||
|
if(!rd_setting_b32_from_name(str8_lit("use_project_theme")))
|
||||||
|
{
|
||||||
|
theme_parents[0] = theme_parents[1];
|
||||||
|
theme_parents_count -= 1;
|
||||||
|
}
|
||||||
|
for EachIndex(idx, theme_parents_count)
|
||||||
|
{
|
||||||
|
RD_Cfg *parent_cfg = theme_parents[idx];
|
||||||
if(preset_cfg != &rd_nil_cfg)
|
if(preset_cfg != &rd_nil_cfg)
|
||||||
{
|
{
|
||||||
RD_Cfg *possible_preset_cfg = rd_cfg_child_from_string(parent_cfg, str8_lit("color_preset"));
|
RD_Cfg *possible_preset_cfg = rd_cfg_child_from_string(parent_cfg, str8_lit("color_preset"));
|
||||||
|
|||||||
Reference in New Issue
Block a user