diff options
author | quou <quou@disroot.org> | 2024-12-31 23:38:11 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-12-31 23:38:11 +1100 |
commit | 96b27fe9841e537614962e273ef9f0802365ea6d (patch) | |
tree | d1373862f700a83dd476555913b50c969159a836 /debugger.cpp | |
parent | ae7824be86ecc53752a3bee1038c0677ac203cf7 (diff) |
ui stuf and things hmm m mmm m シ
Diffstat (limited to 'debugger.cpp')
-rw-r--r-- | debugger.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/debugger.cpp b/debugger.cpp index 6a71e15..6cda856 100644 --- a/debugger.cpp +++ b/debugger.cpp @@ -11,6 +11,14 @@ struct Vram_Debugger : UI::Modal { } }; +struct Device_Debugger : UI::Modal { + UI::Element* enable_btn; + + Device_Debugger(UI* ui, UI::Element* parent): + UI::Modal(ui, parent, "Device debugger") { + } +}; + void create_vram_debugger( UI* ui, UI::Element* parent, @@ -28,6 +36,23 @@ void create_vram_debugger( ui->create_element<UI::Label>(window->contents, "Hello, I'm the VRAM debugger!"); } +void create_device_debugger( + UI* ui, + UI::Element* parent, + UI::Element* button +) { + auto window = ui->create_element<Device_Debugger>(parent); + window->enable_btn = button; + window->handler = [](UI::Element* e, const UI::Message& m) { + if (m.type == UI::Message::Type::destroy) { + auto window = (Device_Debugger*)e; + window->enable_btn->enable(); + } + return 0; + }; + ui->create_element<UI::Label>(window->contents, "Hello, I'm the device debugger!"); +} + void register_debuggers(UI* ui, UI::Toolbar* toolbar) { auto btnvram = ui->create_element<UI::Button>(toolbar, "VRAM Debugger"); btnvram->handler = [](UI::Element* e, const UI::Message& m) { @@ -37,4 +62,13 @@ void register_debuggers(UI* ui, UI::Toolbar* toolbar) { } return 0; }; + auto btndevice = ui->create_element<UI::Button>(toolbar, "Device Debugger"); + btndevice->handler = [](UI::Element* e, const UI::Message& m) { + if (m.type == UI::Message::Type::click) { + e->disable(); + create_device_debugger(e->ui, e->ui->root, e); + } + return 0; + }; } + |