Skip to content

Commit 3169096

Browse files
committed
Fix: Allow DockSpace to be resizable/movable for docking
1 parent a7afbb1 commit 3169096

5 files changed

Lines changed: 84 additions & 83 deletions

File tree

docs/developer.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,38 @@ This guide covers **pcode-editor version 0.2.28**.
1313
pcode-editor is built with a layered architecture:
1414

1515
```
16-
┌──────────────────────────────────
17-
│ EDITOR APP CORE │
18-
│ (editor_app.cpp, main loop) │
16+
┌────────────────────────────────┐
17+
│ EDITOR APP CORE
18+
│ (editor_app.cpp, main loop)
1919
├─────────────────┬──────────────┤
20-
│ TEXT EDITOR │ UI │
21-
│(ImGuiColorText) │(Dear ImGui) │
20+
│ TEXT EDITOR │ UI
21+
│(ImGuiColorText) │(Dear ImGui)
2222
├─────────────────┼──────────────┤
23-
│ INPUT & WINDOW (GLFW) │
23+
│ INPUT & WINDOW (GLFW)
2424
├─────────────────┼──────────────┤
25-
│ PLATFORM BACKENDS │
26-
│ Win32 │ Wayland │ X11 │ Cocoa│
25+
PLATFORM BACKENDS │
26+
Win32 │ Wayland │ X11 │ Cocoa
2727
└─────────────────┴──────────────┘
2828
```
29-
┌──────────────────────────────────────────────────────────────────────
30-
│ LAYER ARCHITECTURE │
31-
├──────────────────────────────────────────────────────────────────────
32-
│ │
29+
┌───────────────────────────────────────────────────────────────┐
30+
│ LAYER ARCHITECTURE
31+
├───────────────────────────────────────────────────────────────┤
32+
3333
│ ┌──────────────────────────────────────────────────────────┐ │
34-
│ │ EDITOR APP CORE │ │
35-
│ │ (editor_app.cpp main loop) │ │
36-
│ ├──────────────────────────┬─────────────────────────────┤ │
37-
│ │ TEXT EDITOR │ UI RENDERING │ │
38-
│ │ (ImGuiColorTextEdit) │ (Dear ImGui widgets) │ │
39-
│ └──────────────────────────┴─────────────────────────────┘ │
40-
│ ├──────────────────────────────────────────────────────────────┤ │
41-
│ │ INPUT & WINDOW MANAGEMENT │ │
42-
│ │ (GLFW) │ │
43-
│ ├──────────────────────────────────────────────────────────────┤ │
44-
│ │ PLATFORM BACKENDS │ │
45-
│ │ Win32 │ Wayland │ X11 │ Cocoa │ │
46-
│ └──────────────────────────┴─���───────────────────────────┘ │
47-
└──────────────────────────────────────────────────────────────────────
34+
│ │ EDITOR APP CORE │ │
35+
│ │ (editor_app.cpp main loop) │ │
36+
│ ├──────────────────────────┬───────────────────────────────┤ │
37+
│ │ TEXT EDITOR │ UI RENDERING │ │
38+
│ │ (ImGuiColorTextEdit) │ (Dear ImGui widgets) │ │
39+
│ └──────────────────────────┴───────────────────────────────┘ │
40+
│ ├──────────────────────────────────────────────────────────┤ │
41+
│ │ INPUT & WINDOW MANAGEMENT │ │
42+
│ │ (GLFW) │ │
43+
│ ├──────────────────────────────────────────────────────────┤ │
44+
│ │ PLATFORM BACKENDS │ │
45+
│ │ Win32 │ Wayland │ X11 │ Cocoa │ │
46+
│ └──────────────────────────┴───────────────────────────────┘ │
47+
└───────────────────────────────────────────────────────────────┘
4848
```
4949
5050
### Source Files

docs/userguide.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ This guide covers **pcode-editor version 0.2.28**.
3232

3333
```
3434
┌─────────────────────────────────────────────────────────────────┐
35-
│ File Edit View Help [─][□][×] │
35+
│ File Edit View Help [─][□][×] │
3636
├─────────────────────────────────────────────────────────────────┤
37-
│ untitled.cpp [×] config.json [×]
37+
│ untitled.cpp [×] config.json [×]
3838
├─────────────────────────────────────────────────────────────────┤
39-
│ 1 │ #include <stdio.h> │
40-
│ 2 │ │
41-
│ 3 │ int main() { │
42-
│ 4 │ printf("Hello, World!\n"); │
43-
│ 5 │ return 0; │
44-
│ 6 │ } │
45-
├────────────────────────────────────────────────┤ minimap ████
46-
│ MODE │ Ln 4, Col 10 │ UTF-8 │ 100% │ main.cpp │
39+
│ 1 │ #include <stdio.h>
40+
│ 2 │
41+
│ 3 │ int main() {
42+
│ 4 │ printf("Hello, World!\n");
43+
│ 5 │ return 0;
44+
│ 6 │ }
45+
├───────────────────────────────────────────────────┤ minimap ████
46+
│ MODE │ Ln 4, Col 10 │ UTF-8 │ 100% │ main.cpp
4747
└─────────────────────────────────────────────────────────────────┘
4848
```
4949

@@ -129,17 +129,17 @@ pcode-editor supports Vim-style editing with multiple modes.
129129

130130
```
131131
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
132-
│ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │
132+
│ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7
133133
├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
134-
│ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │
134+
│ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7
135135
├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
136-
│ TAB │ Q │ W │ E │ R │ T │ Y │ U │
136+
│ TAB │ Q │ W │ E │ R │ T │ Y │ U
137137
├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
138-
│CTRL │ A │ S │ D │ F │ G │ H │ J │
138+
│CTRL │ A │ S │ D │ F │ G │ H │ J
139139
├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
140-
│SHFT │ Z │ X │ C │ V │ B │ N │ M │
140+
│SHFT │ Z │ X │ C │ V │ B │ N │ M
141141
├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
142-
│ │ - │ = │ SPACE │
142+
│ - │ = │ SPACE
143143
└─────┴─────┴─────┴─────────────────────────────┘
144144
```
145145

@@ -194,29 +194,29 @@ pcode-editor supports Vim-style editing with multiple modes.
194194
Horizontal Split (`:sp`):
195195
```
196196
┌─────────────────────────────────────────┐
197-
│ FILE A (Top) [─][□][×] │
197+
│ FILE A (Top) [─][□][×] │
198198
├─────────────────────────────────────────┤
199-
│ 1 │ #include <stdio.h> │
200-
│ 2 │ │
201-
│ 3 │ int main() { │
199+
│ 1 │ #include <stdio.h>
200+
│ 2 │
201+
│ 3 │ int main() {
202202
├─────────────────────────────────────────┤
203-
│ FILE B (Bottom) [×]
204-
├──────────────────────────���──────────────┤
205-
│ 1 │ #include <stdlib.h> │
206-
│ 2 │ │
203+
│ FILE B (Bottom) [×]
204+
├────────────────────────────────────────┤
205+
│ 1 │ #include <stdlib.h>
206+
│ 2 │
207207
└─────────────────────────────────────────┘
208208
```
209209

210210
Vertical Split (`:vsp`):
211211
```
212212
┌────────────────────┬──────────────────┐
213-
│ FILE A (Left) FILE B (Right) │
213+
│ FILE A (Left) FILE B (Right)
214214
├────────────────────┼──────────────────┤
215-
│ 1 │ #include │ 1 │ #include │
216-
│ 2 │ │ 2 │ │
217-
│ 3 │ int main │ 3 │ int main │
218-
│ 4 │ { │ 4 │ { │
219-
│ │ 5 │ } │
215+
│ 1 │ #include │ 1 │ #include
216+
│ 2 │ │ 2 │
217+
│ 3 │ int main │ 3 │ int main
218+
│ 4 │ { │ 4 │ {
219+
│ 5 │ }
220220
└────────────────────┴──────────────────┘
221221
```
222222

@@ -259,16 +259,16 @@ Open terminal with `:term`, `:shell`, or `:sh`.
259259

260260
```
261261
┌─────────────────────────────────────────┐
262-
│ TERMINAL [─][□][×] │
262+
│ TERMINAL [─][□][×] │
263263
├─────────────────────────────────────────┤
264-
│ $ make │
265-
│ gcc -o main main.c │
266-
│ ./main │
267-
│ Hello, World! │
268-
│ │
269-
│ $ _ │
264+
│ $ make
265+
│ gcc -o main main.c
266+
│ ./main
267+
│ Hello, World!
268+
269+
│ $ _
270270
├─────────────────────────────────────────┤
271-
│ Zoom: 100% (Ctrl++/-) │
271+
│ Zoom: 100% (Ctrl++/-)
272272
└─────────────────────────────────────────┘
273273
```
274274

imgui.ini

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
11
[Window][Editor]
2-
Pos=0,26
3-
Size=1280,774
2+
Pos=292,25
3+
Size=988,775
44
Collapsed=0
5-
DockId=0x00000003
5+
DockId=0x00000003,0
66

77
[Window][DockSpace]
88
Pos=0,0
9-
Size=1042,463
9+
Size=1280,800
1010
Collapsed=0
1111

1212
[Window][Debug##Default]
13-
Pos=60,60
14-
Size=400,521
15-
Collapsed=0
13+
Pos=0,0
14+
Size=1280,800
15+
Collapsed=1
16+
DockId=0x00000013,0
1617

1718
[Window][Font Settings]
18-
Pos=359,285
19-
Size=501,229
19+
Pos=389,285
20+
Size=476,221
2021
Collapsed=0
2122

2223
[Window][Explorer]
23-
Pos=0,26
24-
Size=250,437
24+
Pos=0,25
25+
Size=290,775
2526
Collapsed=0
2627
DockId=0x00000005,0
2728

2829
[Docking][Data]
29-
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,26 Size=1042,437 Split=X Selected=0xDF0EC458
30-
DockNode ID=0x00000005 Parent=0xCCBD8CF7 SizeRef=250,774 Selected=0x00F0E82E
31-
DockNode ID=0x00000006 Parent=0xCCBD8CF7 SizeRef=1028,774 Split=X
30+
DockNode ID=0x00000013 Pos=0,0 Size=1280,800
31+
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,25 Size=1280,775 Split=X Selected=0xDF0EC458
32+
DockNode ID=0x00000005 Parent=0xCCBD8CF7 SizeRef=290,774 Selected=0x00F0E82E
33+
DockNode ID=0x00000006 Parent=0xCCBD8CF7 SizeRef=988,774 Split=X
3234
DockNode ID=0x00000011 Parent=0x00000006 SizeRef=1306,851 Split=Y
3335
DockNode ID=0x0000000F Parent=0x00000011 SizeRef=1280,480 Split=Y
3436
DockNode ID=0x0000000D Parent=0x0000000F SizeRef=1280,472 Split=Y

pcode-settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"show_status_bar": true,
66
"word_wrap": true,
77
"show_line_numbers": true,
8-
"show_minimap": true,
8+
"show_minimap": false,
99
"show_spaces": true,
1010
"highlight_line": 2,
1111
"show_tabs": true,
1212
"tab_size": 4,
13-
"font_size": 18,
13+
"font_size": 17,
1414
"font_name": "CascadiaMono",
1515
"last_open_dir": ".\\src",
16-
"recent_files": [".\\src\\editor_app.h", ".\\src\\editor_app.cpp", ".\\docs\\versioning.md", ".\\docs\\imgui_tutorial.md", ".\\docs\\VIM_MOTIONS_SPEC.md", "./src/editor_app.h", "./src/main.cpp", "./src/editor_app.cpp", "VERSION", "./CMakeLists.txt"]
16+
"recent_files": [".\\src\\editor_app.h", ".\\src\\main.cpp", ".\\src\\editor_app.cpp", ".\\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: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,15 +1786,14 @@ void EditorApp::render() {
17861786
}
17871787
}
17881788

1789-
// Full-screen dockspace
1789+
// Full-screen dockspace - allows docking to edges
17901790
ImGuiViewport* viewport = ImGui::GetMainViewport();
17911791
ImGui::SetNextWindowPos(viewport->Pos);
17921792
ImGui::SetNextWindowSize(viewport->Size);
17931793
ImGui::SetNextWindowViewport(viewport->ID);
17941794

17951795
ImGuiWindowFlags flags = ImGuiWindowFlags_MenuBar;
17961796
flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse;
1797-
flags |= ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove;
17981797
flags |= ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus;
17991798

18001799
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0);

0 commit comments

Comments
 (0)