Skip to content

Commit bb58f2f

Browse files
committed
Enable docking
1 parent b2ca36f commit bb58f2f

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

crates/spaceman-dmm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ path = "src/main.rs"
1111
[dependencies]
1212
dreammaker = { path = "../dreammaker" }
1313
dmm-tools = { path = "../dmm-tools", features = ["gfx_core"] }
14-
imgui = "0.12.0"
14+
imgui = { version = "0.12.0", features = ["docking"] }
1515
imgui-sdl3 = "0.5.0"
1616
lodepng = "3.10.7"
1717
ndarray = "0.15.6"

crates/spaceman-dmm/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,8 @@ impl EditorScene {
438438
}
439439

440440
fn run_ui(&mut self, ui: &Ui, renderer: &mut ImRenderer) -> bool {
441+
ui.dockspace_over_main_viewport();
442+
441443
for tool in self.tools.iter_mut() {
442444
tool.icon.prepare(
443445
self.environment.as_ref(),

crates/spaceman-dmm/src/support.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Platform support helpers.
2-
use imgui::{Context, FontConfig};
2+
use imgui::{ConfigFlags, Context, FontConfig};
33
use imgui_sdl3::{platform::Platform, renderer::Renderer};
44
use sdl3::{
55
event::{Event, WindowEvent},
@@ -39,6 +39,7 @@ pub fn run(title: &str) {
3939
imgui.style_mut().use_dark_colors();
4040
imgui.set_ini_filename(None);
4141
imgui.set_log_filename(None);
42+
imgui.io_mut().config_flags |= ConfigFlags::DOCKING_ENABLE;
4243
imgui
4344
.fonts()
4445
.add_font(&[imgui::FontSource::DefaultFontData {

0 commit comments

Comments
 (0)