Implementation for menu bar

This commit is contained in:
dijunkun
2024-06-27 17:36:13 +08:00
parent 8076e7f662
commit ad6f2c2c70
14 changed files with 40847 additions and 132 deletions

View File

@@ -1,16 +1,17 @@
#include "IconsFontAwesome6.h"
#include "render.h"
int Render::MenuWindow() {
ImGui::PushStyleColor(ImGuiCol_MenuBarBg, ImVec4(0, 0, 0, 0));
ImGui::PushStyleColor(ImGuiCol_MenuBarBg, ImVec4(255, 255, 255, 1));
static bool a, b, c, d, e;
ImGui::SetNextWindowPos(ImVec2(0, 0), ImGuiCond_Always);
ImGui::BeginChild("MenuWindow",
ImVec2(main_window_width_, menu_window_height_),
ImGuiChildFlags_Border, ImGuiWindowFlags_NoScrollbar);
ImGuiChildFlags_Border, ImGuiWindowFlags_MenuBar);
if (ImGui::BeginMenuBar()) {
if (ImGui::BeginMenu("Menu")) {
ImGui::SetWindowFontScale(0.5f);
ImGui::SetWindowFontScale(0.8f);
if (ImGui::BeginMenu(ICON_FA_BARS, true)) {
ImGui::SetWindowFontScale(0.7f);
ImGui::MenuItem("Auto-resizing window", NULL, &a);
ImGui::MenuItem("Constrained-resizing window", NULL, &b);
ImGui::MenuItem("Fullscreen window", NULL, &c);
@@ -19,11 +20,12 @@ int Render::MenuWindow() {
ImGui::SetWindowFontScale(1.0f);
ImGui::EndMenu();
}
ImGui::EndMenuBar();
}
SettingWindow();
ImGui::SetWindowFontScale(1.0f);
ImGui::Dummy(ImVec2(main_window_width_ - 97, 0));
SettingButton();
}
ImGui::PopStyleColor();
ImGui::EndChild();