housekeeping

This commit is contained in:
scawful
2024-07-19 16:41:08 -04:00
parent d73a970e57
commit 1f61d3bd27
5 changed files with 29 additions and 41 deletions

View File

@@ -5,8 +5,6 @@
#include "absl/strings/string_view.h"
#define BASIC_BUTTON(w) if (ImGui::Button(w))
#define TAB_BAR(w) if (ImGui::BeginTabBar(w)) {
#define END_TAB_BAR() \
ImGui::EndTabBar(); \
@@ -17,11 +15,6 @@
ImGui::EndTabItem(); \
}
#define MENU_BAR() if (ImGui::BeginMenuBar()) {
#define END_MENU_BAR() \
ImGui::EndMenuBar(); \
}
#define MENU_ITEM(w) if (ImGui::MenuItem(w))
#define MENU_ITEM2(w, v) if (ImGui::MenuItem(w, v))

View File

@@ -3,9 +3,9 @@
#include <ImGuiColorTextEdit/TextEditor.h>
#include "app/core/platform/file_dialog.h"
#include "app/gui/widgets.h"
#include "app/gui/input.h"
#include "app/gui/icons.h"
#include "app/gui/input.h"
#include "app/gui/widgets.h"
#include "core/constants.h"
namespace yaze {
@@ -101,10 +101,11 @@ void AssemblyEditor::OpenFolder(const std::string& folder_path) {
void AssemblyEditor::Update(bool& is_loaded) {
ImGui::Begin("Assembly Editor", &is_loaded);
MENU_BAR()
DrawFileMenu();
DrawEditMenu();
END_MENU_BAR()
if (ImGui::BeginMenuBar()) {
DrawFileMenu();
DrawEditMenu();
ImGui::EndMenuBar();
}
auto cpos = text_editor_.GetCursorPosition();
SetEditorText();

View File

@@ -24,9 +24,6 @@ namespace context {
* @brief Shared graphical context across editors.
*/
class GfxContext {
public:
absl::Status Update();
protected:
// Palettesets for the tile16 individual tiles
static std::unordered_map<uint8_t, gfx::Paletteset> palettesets_;

View File

@@ -79,10 +79,6 @@ class Tile16Editor : public context::GfxContext, public SharedRom {
core::NotifyValue<uint32_t> notify_tile16;
core::NotifyValue<uint8_t> notify_palette;
// Canvas dimensions
int canvas_width;
int canvas_height;
// Texture ID for the canvas
int texture_id;

View File

@@ -356,30 +356,31 @@ void MasterEditor::DrawYazeMenu() {
static bool show_display_settings = false;
static bool show_command_line_interface = false;
MENU_BAR()
DrawFileMenu();
DrawEditMenu();
DrawViewMenu();
DrawProjectMenu();
DrawHelpMenu();
if (ImGui::BeginMenuBar()) {
DrawFileMenu();
DrawEditMenu();
DrawViewMenu();
DrawProjectMenu();
DrawHelpMenu();
SameLine(ImGui::GetWindowWidth() - ImGui::GetStyle().ItemSpacing.x -
ImGui::CalcTextSize(ICON_MD_DISPLAY_SETTINGS).x - 150);
// Modify the style of the button to have no background color
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
if (ImGui::Button(ICON_MD_DISPLAY_SETTINGS)) {
show_display_settings = !show_display_settings;
SameLine(ImGui::GetWindowWidth() - ImGui::GetStyle().ItemSpacing.x -
ImGui::CalcTextSize(ICON_MD_DISPLAY_SETTINGS).x - 150);
// Modify the style of the button to have no background color
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
if (ImGui::Button(ICON_MD_DISPLAY_SETTINGS)) {
show_display_settings = !show_display_settings;
}
if (ImGui::Button(ICON_MD_TERMINAL)) {
show_command_line_interface = !show_command_line_interface;
}
ImGui::PopStyleColor();
Text("%s", absl::StrCat("yaze v", core::kYazeVersion).c_str());
ImGui::EndMenuBar();
}
if (ImGui::Button(ICON_MD_TERMINAL)) {
show_command_line_interface = !show_command_line_interface;
}
ImGui::PopStyleColor();
Text("%s", absl::StrCat("yaze v", core::kYazeVersion).c_str());
END_MENU_BAR()
if (show_display_settings) {
ImGui::Begin("Display Settings", &show_display_settings,
ImGuiWindowFlags_None);