Skip to content

Commit ddf71f6

Browse files
committed
Fix: Menu inside editor window. v0.2.32
1 parent 1d44171 commit ddf71f6

4 files changed

Lines changed: 22 additions & 35 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.31
1+
0.2.32

imgui.ini

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[Window][Editor]
2-
Pos=228,24
3-
Size=1052,776
2+
Pos=323,-1
3+
Size=957,800
44
Collapsed=0
5-
DockId=0xCCBD8CF7
5+
DockId=0x00000014,0
66

77
[Window][DockSpace]
88
Size=1280,800
@@ -19,34 +19,22 @@ Size=476,221
1919
Collapsed=0
2020

2121
[Window][Explorer]
22-
Pos=41,683
23-
Size=356,600
22+
Pos=0,-1
23+
Size=321,800
2424
Collapsed=0
25-
DockId=0x00000005,0
25+
DockId=0x00000013,0
2626

2727
[Window][MainDock]
28+
Size=1280,800
29+
Collapsed=0
30+
31+
[Window][pcode-editor]
2832
Pos=0,0
2933
Size=1280,800
3034
Collapsed=0
3135

3236
[Docking][Data]
33-
DockNode ID=0x00000005 Pos=41,683 Size=356,600
34-
DockSpace ID=0x44CD06D0 Window=0x18D25B74 Pos=0,24 Size=1280,776 CentralNode=1
35-
DockSpace ID=0xCCBD8CF7 Pos=0,24 Size=1280,776 Split=X Selected=0xDF0EC458
36-
DockNode ID=0x00000011 Parent=0xCCBD8CF7 SizeRef=1306,851 Split=Y
37-
DockNode ID=0x0000000F Parent=0x00000011 SizeRef=1280,480 Split=Y
38-
DockNode ID=0x0000000D Parent=0x0000000F SizeRef=1280,472 Split=Y
39-
DockNode ID=0x0000000B Parent=0x0000000D SizeRef=1280,720 Split=Y
40-
DockNode ID=0x00000009 Parent=0x0000000B SizeRef=1280,686 Split=Y
41-
DockNode ID=0x00000007 Parent=0x00000009 SizeRef=1280,703 Split=Y
42-
DockNode ID=0x00000001 Parent=0x00000007 SizeRef=1280,386 Selected=0x00F0E82E
43-
DockNode ID=0x00000002 Parent=0x00000007 SizeRef=1280,261 Split=X
44-
DockNode ID=0x00000003 Parent=0x00000002 SizeRef=678,778 CentralNode=1 Selected=0xDF0EC458
45-
DockNode ID=0x00000004 Parent=0x00000002 SizeRef=600,778 Selected=0xD33228A6
46-
DockNode ID=0x00000008 Parent=0x00000009 SizeRef=1280,64 HiddenTabBar=1 Selected=0x2AB9DED9
47-
DockNode ID=0x0000000A Parent=0x0000000B SizeRef=1280,81 HiddenTabBar=1 Selected=0x2AB9DED9
48-
DockNode ID=0x0000000C Parent=0x0000000D SizeRef=1280,47 HiddenTabBar=1 Selected=0x2AB9DED9
49-
DockNode ID=0x0000000E Parent=0x0000000F SizeRef=1280,300 Selected=0xD33228A6
50-
DockNode ID=0x00000010 Parent=0x00000011 SizeRef=1280,300 Selected=0xD33228A6
51-
DockNode ID=0x00000012 Parent=0xCCBD8CF7 SizeRef=612,851 Selected=0xD33228A6
37+
DockNode ID=0x00000001 Pos=0,-1 Size=1280,800 Split=X
38+
DockNode ID=0x00000013 Parent=0x00000001 SizeRef=257,800 Selected=0x00F0E82E
39+
DockNode ID=0x00000014 Parent=0x00000001 SizeRef=766,800 Selected=0xDF0EC458
5240

pcode-settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
"font_size": 17,
1414
"font_name": "CascadiaMono",
1515
"last_open_dir": ".\\src",
16-
"recent_files": [".\\src\\main.cpp", ".\\src\\editor_app.cpp", ".\\src\\editor_app.h", ".\\docs\\versioning.md", ".\\docs\\imgui_tutorial.md", ".\\docs\\VIM_MOTIONS_SPEC.md", "./src/editor_app.h", "./src/main.cpp", "./src/editor_app.cpp", "VERSION"]
16+
"recent_files": [".\\src\\editor_app.cpp", ".\\src\\main.cpp", ".\\src\\editor_app.h", ".\\docs\\versioning.md", ".\\docs\\imgui_tutorial.md", ".\\docs\\VIM_MOTIONS_SPEC.md", "./src/editor_app.h", "./src/main.cpp", "./src/editor_app.cpp", "VERSION"]
1717
}

src/editor_app.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static void settings_load(AppSettings& s, const std::string& path) {
159159
// Version
160160
// ============================================================================
161161
std::string EditorApp::get_version() {
162-
return "pCode Editor version 0.2.30";
162+
return "pCode Editor version 0.2.31";
163163
}
164164

165165
// ============================================================================
@@ -1786,14 +1786,13 @@ void EditorApp::render() {
17861786
}
17871787
}
17881788

1789-
// Main window with menu and sidebar
1789+
// Main window - just sidebar
17901790
ImGuiViewport* viewport = ImGui::GetMainViewport();
17911791
ImGui::SetNextWindowPos(viewport->Pos);
17921792
ImGui::SetNextWindowSize(viewport->Size);
17931793
ImGui::SetNextWindowViewport(viewport->ID);
17941794

1795-
ImGuiWindowFlags flags = ImGuiWindowFlags_MenuBar;
1796-
flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse;
1795+
ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse;
17971796
flags |= ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove;
17981797

17991798
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0);
@@ -1802,16 +1801,16 @@ void EditorApp::render() {
18021801
ImGui::Begin("pcode-editor", nullptr, flags);
18031802
ImGui::PopStyleVar(3);
18041803

1805-
render_menu_bar();
18061804
render_sidebar();
18071805

18081806
ImGui::End();
18091807

1810-
// Editor as independent floating window - fully movable
1808+
// Editor as independent floating window - fully movable, with menu inside
18111809
ImGui::SetNextWindowPos(ImVec2(viewport->Pos.x + 80, viewport->Pos.y + 80), ImGuiCond_FirstUseEver);
18121810
ImGui::SetNextWindowSize(ImVec2(800, 600), ImGuiCond_FirstUseEver);
18131811

1814-
if (ImGui::Begin("Editor", nullptr, ImGuiWindowFlags_NoCollapse)) {
1812+
if (ImGui::Begin("Editor", nullptr, ImGuiWindowFlags_MenuBar)) {
1813+
render_menu_bar();
18151814
render_editor_area();
18161815
ImGui::End();
18171816
}
@@ -2796,7 +2795,7 @@ void EditorApp::render_status_bar() {
27962795
ImGui::SameLine();
27972796

27982797
// Version with git hash
2799-
ImGui::Text("v0.2.31");
2798+
ImGui::Text("v0.2.32");
28002799
}
28012800

28022801
ImGui::PopStyleColor();

0 commit comments

Comments
 (0)