|
|
|
@@ -78,18 +78,27 @@ absl::Status SaveTheme(const Theme &theme) {
|
|
|
|
theme_stream << theme.name << "Theme\n";
|
|
|
|
theme_stream << theme.name << "Theme\n";
|
|
|
|
theme_stream << "MenuBarBg=#" << gui::ColorToHexString(theme.menu_bar_bg)
|
|
|
|
theme_stream << "MenuBarBg=#" << gui::ColorToHexString(theme.menu_bar_bg)
|
|
|
|
<< "\n";
|
|
|
|
<< "\n";
|
|
|
|
theme_stream << "TitleBg=#" << gui::ColorToHexString(theme.title_bar_bg) << "\n";
|
|
|
|
theme_stream << "TitleBg=#" << gui::ColorToHexString(theme.title_bar_bg)
|
|
|
|
|
|
|
|
<< "\n";
|
|
|
|
theme_stream << "Header=#" << gui::ColorToHexString(theme.header) << "\n";
|
|
|
|
theme_stream << "Header=#" << gui::ColorToHexString(theme.header) << "\n";
|
|
|
|
theme_stream << "HeaderHovered=#" << gui::ColorToHexString(theme.header_hovered) << "\n";
|
|
|
|
theme_stream << "HeaderHovered=#"
|
|
|
|
theme_stream << "HeaderActive=#" << gui::ColorToHexString(theme.header_active) << "\n";
|
|
|
|
<< gui::ColorToHexString(theme.header_hovered) << "\n";
|
|
|
|
theme_stream << "TitleBgActive=#" << gui::ColorToHexString(theme.title_bg_active) << "\n";
|
|
|
|
theme_stream << "HeaderActive=#" << gui::ColorToHexString(theme.header_active)
|
|
|
|
theme_stream << "TitleBgCollapsed=#" << gui::ColorToHexString(theme.title_bg_collapsed) << "\n";
|
|
|
|
<< "\n";
|
|
|
|
|
|
|
|
theme_stream << "TitleBgActive=#"
|
|
|
|
|
|
|
|
<< gui::ColorToHexString(theme.title_bg_active) << "\n";
|
|
|
|
|
|
|
|
theme_stream << "TitleBgCollapsed=#"
|
|
|
|
|
|
|
|
<< gui::ColorToHexString(theme.title_bg_collapsed) << "\n";
|
|
|
|
theme_stream << "Tab=#" << gui::ColorToHexString(theme.tab) << "\n";
|
|
|
|
theme_stream << "Tab=#" << gui::ColorToHexString(theme.tab) << "\n";
|
|
|
|
theme_stream << "TabHovered=#" << gui::ColorToHexString(theme.tab_hovered) << "\n";
|
|
|
|
theme_stream << "TabHovered=#" << gui::ColorToHexString(theme.tab_hovered)
|
|
|
|
theme_stream << "TabActive=#" << gui::ColorToHexString(theme.tab_active) << "\n";
|
|
|
|
<< "\n";
|
|
|
|
|
|
|
|
theme_stream << "TabActive=#" << gui::ColorToHexString(theme.tab_active)
|
|
|
|
|
|
|
|
<< "\n";
|
|
|
|
theme_stream << "Button=#" << gui::ColorToHexString(theme.button) << "\n";
|
|
|
|
theme_stream << "Button=#" << gui::ColorToHexString(theme.button) << "\n";
|
|
|
|
theme_stream << "ButtonHovered=#" << gui::ColorToHexString(theme.button_hovered) << "\n";
|
|
|
|
theme_stream << "ButtonHovered=#"
|
|
|
|
theme_stream << "ButtonActive=#" << gui::ColorToHexString(theme.button_active) << "\n";
|
|
|
|
<< gui::ColorToHexString(theme.button_hovered) << "\n";
|
|
|
|
|
|
|
|
theme_stream << "ButtonActive=#" << gui::ColorToHexString(theme.button_active)
|
|
|
|
|
|
|
|
<< "\n";
|
|
|
|
|
|
|
|
|
|
|
|
// Save the theme to a file.
|
|
|
|
// Save the theme to a file.
|
|
|
|
|
|
|
|
|
|
|
|
@@ -103,16 +112,22 @@ void ApplyTheme(const Theme &theme) {
|
|
|
|
colors[ImGuiCol_MenuBarBg] = gui::ConvertColorToImVec4(theme.menu_bar_bg);
|
|
|
|
colors[ImGuiCol_MenuBarBg] = gui::ConvertColorToImVec4(theme.menu_bar_bg);
|
|
|
|
colors[ImGuiCol_TitleBg] = gui::ConvertColorToImVec4(theme.title_bar_bg);
|
|
|
|
colors[ImGuiCol_TitleBg] = gui::ConvertColorToImVec4(theme.title_bar_bg);
|
|
|
|
colors[ImGuiCol_Header] = gui::ConvertColorToImVec4(theme.header);
|
|
|
|
colors[ImGuiCol_Header] = gui::ConvertColorToImVec4(theme.header);
|
|
|
|
colors[ImGuiCol_HeaderHovered] = gui::ConvertColorToImVec4(theme.header_hovered);
|
|
|
|
colors[ImGuiCol_HeaderHovered] =
|
|
|
|
colors[ImGuiCol_HeaderActive] = gui::ConvertColorToImVec4(theme.header_active);
|
|
|
|
gui::ConvertColorToImVec4(theme.header_hovered);
|
|
|
|
colors[ImGuiCol_TitleBgActive] = gui::ConvertColorToImVec4(theme.title_bg_active);
|
|
|
|
colors[ImGuiCol_HeaderActive] =
|
|
|
|
colors[ImGuiCol_TitleBgCollapsed] = gui::ConvertColorToImVec4(theme.title_bg_collapsed);
|
|
|
|
gui::ConvertColorToImVec4(theme.header_active);
|
|
|
|
|
|
|
|
colors[ImGuiCol_TitleBgActive] =
|
|
|
|
|
|
|
|
gui::ConvertColorToImVec4(theme.title_bg_active);
|
|
|
|
|
|
|
|
colors[ImGuiCol_TitleBgCollapsed] =
|
|
|
|
|
|
|
|
gui::ConvertColorToImVec4(theme.title_bg_collapsed);
|
|
|
|
colors[ImGuiCol_Tab] = gui::ConvertColorToImVec4(theme.tab);
|
|
|
|
colors[ImGuiCol_Tab] = gui::ConvertColorToImVec4(theme.tab);
|
|
|
|
colors[ImGuiCol_TabHovered] = gui::ConvertColorToImVec4(theme.tab_hovered);
|
|
|
|
colors[ImGuiCol_TabHovered] = gui::ConvertColorToImVec4(theme.tab_hovered);
|
|
|
|
colors[ImGuiCol_TabActive] = gui::ConvertColorToImVec4(theme.tab_active);
|
|
|
|
colors[ImGuiCol_TabActive] = gui::ConvertColorToImVec4(theme.tab_active);
|
|
|
|
colors[ImGuiCol_Button] = gui::ConvertColorToImVec4(theme.button);
|
|
|
|
colors[ImGuiCol_Button] = gui::ConvertColorToImVec4(theme.button);
|
|
|
|
colors[ImGuiCol_ButtonHovered] = gui::ConvertColorToImVec4(theme.button_hovered);
|
|
|
|
colors[ImGuiCol_ButtonHovered] =
|
|
|
|
colors[ImGuiCol_ButtonActive] = gui::ConvertColorToImVec4(theme.button_active);
|
|
|
|
gui::ConvertColorToImVec4(theme.button_hovered);
|
|
|
|
|
|
|
|
colors[ImGuiCol_ButtonActive] =
|
|
|
|
|
|
|
|
gui::ConvertColorToImVec4(theme.button_active);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ColorsYaze() {
|
|
|
|
void ColorsYaze() {
|
|
|
|
@@ -277,8 +292,7 @@ static const char *const kIdentifiers[] = {
|
|
|
|
|
|
|
|
|
|
|
|
TextEditor::LanguageDefinition GetAssemblyLanguageDef() {
|
|
|
|
TextEditor::LanguageDefinition GetAssemblyLanguageDef() {
|
|
|
|
TextEditor::LanguageDefinition language_65816;
|
|
|
|
TextEditor::LanguageDefinition language_65816;
|
|
|
|
for (auto &k : kKeywords)
|
|
|
|
for (auto &k : kKeywords) language_65816.mKeywords.emplace(k);
|
|
|
|
language_65816.mKeywords.emplace(k);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (auto &k : kIdentifiers) {
|
|
|
|
for (auto &k : kIdentifiers) {
|
|
|
|
TextEditor::Identifier id;
|
|
|
|
TextEditor::Identifier id;
|
|
|
|
@@ -389,16 +403,13 @@ void DrawDisplaySettings(ImGuiStyle *ref) {
|
|
|
|
|
|
|
|
|
|
|
|
// Default to using internal storage as reference
|
|
|
|
// Default to using internal storage as reference
|
|
|
|
static bool init = true;
|
|
|
|
static bool init = true;
|
|
|
|
if (init && ref == NULL)
|
|
|
|
if (init && ref == NULL) ref_saved_style = style;
|
|
|
|
ref_saved_style = style;
|
|
|
|
|
|
|
|
init = false;
|
|
|
|
init = false;
|
|
|
|
if (ref == NULL)
|
|
|
|
if (ref == NULL) ref = &ref_saved_style;
|
|
|
|
ref = &ref_saved_style;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.50f);
|
|
|
|
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.50f);
|
|
|
|
|
|
|
|
|
|
|
|
if (ImGui::ShowStyleSelector("Colors##Selector"))
|
|
|
|
if (ImGui::ShowStyleSelector("Colors##Selector")) ref_saved_style = style;
|
|
|
|
ref_saved_style = style;
|
|
|
|
|
|
|
|
ImGui::ShowFontSelector("Fonts##Selector");
|
|
|
|
ImGui::ShowFontSelector("Fonts##Selector");
|
|
|
|
|
|
|
|
|
|
|
|
// Simplified Settings (expose floating-pointer border sizes as boolean
|
|
|
|
// Simplified Settings (expose floating-pointer border sizes as boolean
|
|
|
|
@@ -429,11 +440,9 @@ void DrawDisplaySettings(ImGuiStyle *ref) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Save/Revert button
|
|
|
|
// Save/Revert button
|
|
|
|
if (ImGui::Button("Save Ref"))
|
|
|
|
if (ImGui::Button("Save Ref")) *ref = ref_saved_style = style;
|
|
|
|
*ref = ref_saved_style = style;
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::SameLine();
|
|
|
|
if (ImGui::Button("Revert Ref"))
|
|
|
|
if (ImGui::Button("Revert Ref")) style = *ref;
|
|
|
|
style = *ref;
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
ImGui::Separator();
|
|
|
|
@@ -605,8 +614,7 @@ void DrawDisplaySettings(ImGuiStyle *ref) {
|
|
|
|
ImGui::PushItemWidth(ImGui::GetFontSize() * -12);
|
|
|
|
ImGui::PushItemWidth(ImGui::GetFontSize() * -12);
|
|
|
|
for (int i = 0; i < ImGuiCol_COUNT; i++) {
|
|
|
|
for (int i = 0; i < ImGuiCol_COUNT; i++) {
|
|
|
|
const char *name = ImGui::GetStyleColorName(i);
|
|
|
|
const char *name = ImGui::GetStyleColorName(i);
|
|
|
|
if (!filter.PassFilter(name))
|
|
|
|
if (!filter.PassFilter(name)) continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
ImGui::PushID(i);
|
|
|
|
ImGui::PushID(i);
|
|
|
|
ImGui::ColorEdit4("##color", (float *)&style.Colors[i],
|
|
|
|
ImGui::ColorEdit4("##color", (float *)&style.Colors[i],
|
|
|
|
ImGuiColorEditFlags_AlphaBar | alpha_flags);
|
|
|
|
ImGuiColorEditFlags_AlphaBar | alpha_flags);
|
|
|
|
@@ -683,8 +691,7 @@ void DrawDisplaySettings(ImGuiStyle *ref) {
|
|
|
|
&style.CircleTessellationMaxError, 0.005f, 0.10f, 5.0f,
|
|
|
|
&style.CircleTessellationMaxError, 0.005f, 0.10f, 5.0f,
|
|
|
|
"%.2f", ImGuiSliderFlags_AlwaysClamp);
|
|
|
|
"%.2f", ImGuiSliderFlags_AlwaysClamp);
|
|
|
|
const bool show_samples = ImGui::IsItemActive();
|
|
|
|
const bool show_samples = ImGui::IsItemActive();
|
|
|
|
if (show_samples)
|
|
|
|
if (show_samples) ImGui::SetNextWindowPos(ImGui::GetCursorScreenPos());
|
|
|
|
ImGui::SetNextWindowPos(ImGui::GetCursorScreenPos());
|
|
|
|
|
|
|
|
if (show_samples && ImGui::BeginTooltip()) {
|
|
|
|
if (show_samples && ImGui::BeginTooltip()) {
|
|
|
|
ImGui::TextUnformatted("(R = radius, N = number of segments)");
|
|
|
|
ImGui::TextUnformatted("(R = radius, N = number of segments)");
|
|
|
|
ImGui::Spacing();
|
|
|
|
ImGui::Spacing();
|
|
|
|
@@ -760,7 +767,7 @@ void DrawFontManager() {
|
|
|
|
static bool font_selected = false;
|
|
|
|
static bool font_selected = false;
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::Text("Loaded fonts");
|
|
|
|
ImGui::Text("Loaded fonts");
|
|
|
|
for (const auto& loaded_font : core::global_font_state.fonts) {
|
|
|
|
for (const auto &loaded_font : core::font_registry.fonts) {
|
|
|
|
ImGui::Text("%s", loaded_font.font_path);
|
|
|
|
ImGui::Text("%s", loaded_font.font_path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ImGui::Separator();
|
|
|
|
ImGui::Separator();
|
|
|
|
|