diff --git a/src/app/editor/code/assembly_editor.h b/src/app/editor/code/assembly_editor.h index bf794441..85e3730d 100644 --- a/src/app/editor/code/assembly_editor.h +++ b/src/app/editor/code/assembly_editor.h @@ -54,19 +54,16 @@ class AssemblyEditor : public Editor { private: void DrawFileMenu(); void DrawEditMenu(); - void SetEditorText(); - void DrawCurrentFolder(); - void DrawFileTabView(); bool file_is_loaded_ = false; + int current_file_id_ = 0; std::vector files_; std::vector open_files_; ImVector active_files_; - int current_file_id_ = 0; std::string current_file_; FolderItem current_folder_; diff --git a/src/app/editor/graphics/graphics_editor.cc b/src/app/editor/graphics/graphics_editor.cc index 4af61d48..bf55f674 100644 --- a/src/app/editor/graphics/graphics_editor.cc +++ b/src/app/editor/graphics/graphics_editor.cc @@ -499,16 +499,15 @@ absl::Status GraphicsEditor::UpdateScadView() { absl::Status GraphicsEditor::DrawToolset() { static constexpr absl::string_view kGfxToolsetColumnNames[] = { "#memoryEditor", - "##separator_gfx1", }; - if (ImGui::BeginTable("GraphicsToolset", 2, ImGuiTableFlags_SizingFixedFit, + if (ImGui::BeginTable("GraphicsToolset", 1, ImGuiTableFlags_SizingFixedFit, ImVec2(0, 0))) { for (const auto& name : kGfxToolsetColumnNames) ImGui::TableSetupColumn(name.data()); TableNextColumn(); - if (Button(ICON_MD_MEMORY)) { + if (Button(absl::StrCat(ICON_MD_MEMORY, "Open Memory Editor").c_str())) { if (!open_memory_editor_) { open_memory_editor_ = true; } else { @@ -516,8 +515,6 @@ absl::Status GraphicsEditor::DrawToolset() { } } - TEXT_COLUMN("Open Memory Editor") // Separator - ImGui::EndTable(); } return absl::OkStatus(); diff --git a/src/app/editor/graphics/screen_editor.cc b/src/app/editor/graphics/screen_editor.cc index 39b8089f..768bf9a6 100644 --- a/src/app/editor/graphics/screen_editor.cc +++ b/src/app/editor/graphics/screen_editor.cc @@ -98,14 +98,34 @@ void ScreenEditor::DrawInventoryToolset() { ImGui::TableSetupColumn("#bg3Tool"); ImGui::TableSetupColumn("#itemTool"); - BUTTON_COLUMN(ICON_MD_UNDO) - BUTTON_COLUMN(ICON_MD_REDO) - TEXT_COLUMN(ICON_MD_MORE_VERT) - BUTTON_COLUMN(ICON_MD_ZOOM_OUT) - BUTTON_COLUMN(ICON_MD_ZOOM_IN) - TEXT_COLUMN(ICON_MD_MORE_VERT) - BUTTON_COLUMN(ICON_MD_DRAW) - BUTTON_COLUMN(ICON_MD_BUILD) + ImGui::TableNextColumn(); + if (ImGui::Button(ICON_MD_UNDO)) { + // status_ = inventory_.Undo(); + } + ImGui::TableNextColumn(); + if (ImGui::Button(ICON_MD_REDO)) { + // status_ = inventory_.Redo(); + } + ImGui::TableNextColumn(); + ImGui::Text(ICON_MD_MORE_VERT); + ImGui::TableNextColumn(); + if (ImGui::Button(ICON_MD_ZOOM_OUT)) { + screen_canvas_.ZoomOut(); + } + ImGui::TableNextColumn(); + if (ImGui::Button(ICON_MD_ZOOM_IN)) { + screen_canvas_.ZoomIn(); + } + ImGui::TableNextColumn(); + ImGui::Text(ICON_MD_MORE_VERT); + ImGui::TableNextColumn(); + if (ImGui::Button(ICON_MD_DRAW)) { + current_mode_ = EditingMode::DRAW; + } + ImGui::TableNextColumn(); + if (ImGui::Button(ICON_MD_BUILD)) { + // current_mode_ = EditingMode::BUILD; + } ImGui::EndTable(); } diff --git a/src/app/editor/music/music_editor.cc b/src/app/editor/music/music_editor.cc index dc26db60..e305b781 100644 --- a/src/app/editor/music/music_editor.cc +++ b/src/app/editor/music/music_editor.cc @@ -194,9 +194,21 @@ void MusicEditor::DrawToolset() { is_playing = !is_playing; } - BUTTON_COLUMN(ICON_MD_FAST_REWIND) - BUTTON_COLUMN(ICON_MD_FAST_FORWARD) - BUTTON_COLUMN(ICON_MD_VOLUME_UP) + ImGui::TableNextColumn(); + if (ImGui::Button(ICON_MD_FAST_REWIND)) { + // Handle rewind button click + } + + ImGui::TableNextColumn(); + if (ImGui::Button(ICON_MD_FAST_FORWARD)) { + // Handle fast forward button click + } + + ImGui::TableNextColumn(); + if (ImGui::Button(ICON_MD_VOLUME_UP)) { + // Handle volume up button click + } + if (ImGui::Button(ICON_MD_ACCESS_TIME)) { music_tracker_.LoadSongs(*rom()); } diff --git a/src/util/macro.h b/src/util/macro.h index 08edac2a..50986c43 100644 --- a/src/util/macro.h +++ b/src/util/macro.h @@ -6,17 +6,6 @@ ImGui::EndTabItem(); \ } -#define MENU_ITEM(w) if (ImGui::MenuItem(w)) -#define MENU_ITEM2(w, v) if (ImGui::MenuItem(w, v)) - -#define BUTTON_COLUMN(w) \ - ImGui::TableNextColumn(); \ - ImGui::Button(w); - -#define TEXT_COLUMN(w) \ - ImGui::TableNextColumn(); \ - ImGui::Text(w); - #define BEGIN_TABLE(l, n, f) if (ImGui::BeginTable(l, n, f, ImVec2(0, 0))) { #define SETUP_COLUMN(l) ImGui::TableSetupColumn(l);