diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-01-03 11:50:41 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-01-03 11:50:41 +0100 |
commit | 756da05c384e3d9258fc07cf9441d899238503f1 (patch) | |
tree | b3385216148d51a2378a2bed5dfc3f0a27d4f1ec /test/uitests/framewidgettest.cc | |
parent | 645250e1cd8ce9bc1faea599df7a1b05836bfeb8 (diff) |
Add dggui namespace to libdggui components.
Diffstat (limited to 'test/uitests/framewidgettest.cc')
-rw-r--r-- | test/uitests/framewidgettest.cc | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/test/uitests/framewidgettest.cc b/test/uitests/framewidgettest.cc index 4f0e0fd..97f9ed0 100644 --- a/test/uitests/framewidgettest.cc +++ b/test/uitests/framewidgettest.cc @@ -40,65 +40,65 @@ // TODO: fix segfault on close -class Widget1 : public GUI::Widget +class Widget1 : public dggui::Widget { public: - Widget1(GUI::Widget* parent) : GUI::Widget(parent) + Widget1(dggui::Widget* parent) : dggui::Widget(parent) { layout.setResizeChildren(true); - layout.setHAlignment(GUI::HAlignment::center); + layout.setHAlignment(dggui::HAlignment::center); label1.setText("Label1"); - label1.setAlignment(GUI::TextAlignment::left); + label1.setAlignment(dggui::TextAlignment::left); layout.addItem(&label1); label2.setText("Label2"); - label2.setAlignment(GUI::TextAlignment::center); + label2.setAlignment(dggui::TextAlignment::center); layout.addItem(&label2); label3.setText("Label3"); - label3.setAlignment(GUI::TextAlignment::right); + label3.setAlignment(dggui::TextAlignment::right); layout.addItem(&label3); } private: - GUI::VBoxLayout layout{this}; - GUI::Label label1{this}; - GUI::Label label2{this}; - GUI::Label label3{this}; + dggui::VBoxLayout layout{this}; + dggui::Label label1{this}; + dggui::Label label2{this}; + dggui::Label label3{this}; }; -class Widget2 : public GUI::Widget +class Widget2 : public dggui::Widget { public: - Widget2(GUI::Widget* parent) : GUI::Widget(parent) + Widget2(dggui::Widget* parent) : dggui::Widget(parent) { layout.setSpacing(10); layout.setResizeChildren(true); - layout.setVAlignment(GUI::VAlignment::top); + layout.setVAlignment(dggui::VAlignment::top); label1.setText("Label1"); - label1.setAlignment(GUI::TextAlignment::right); + label1.setAlignment(dggui::TextAlignment::right); layout.addItem(&label1); label2.setText("Label2"); - label2.setAlignment(GUI::TextAlignment::left); + label2.setAlignment(dggui::TextAlignment::left); layout.addItem(&label2); layout.addItem(&checkbox); } private: - GUI::HBoxLayout layout{this}; - GUI::Label label1{this}; - GUI::Label label2{this}; - GUI::CheckBox checkbox{this}; + dggui::HBoxLayout layout{this}; + dggui::Label label1{this}; + dggui::Label label2{this}; + dggui::CheckBox checkbox{this}; }; -class TestWindow : public GUI::Window +class TestWindow : public dggui::Window { public: - TestWindow() : GUI::Window(nullptr) + TestWindow() : dggui::Window(nullptr) { setCaption("FrameWidgetTest Window"); CONNECT(eventHandler(), closeNotifier, this, @@ -107,7 +107,7 @@ public: layout.setSpacing(10); layout.setResizeChildren(true); - layout.setHAlignment(GUI::HAlignment::center); + layout.setHAlignment(dggui::HAlignment::center); layout.addItem(&frame1); layout.addItem(&frame2); @@ -141,22 +141,22 @@ public: return !closing; } - void repaintEvent(GUI::RepaintEvent* repaintEvent) override + void repaintEvent(dggui::RepaintEvent* repaintEvent) override { - GUI::Painter painter(*this); - painter.setColour(GUI::Colour(0.85)); + dggui::Painter painter(*this); + painter.setColour(dggui::Colour(0.85)); painter.drawFilledRectangle(0, 0, width() - 1, height() - 1); } private: bool closing{false}; - GUI::VBoxLayout layout{this}; + dggui::VBoxLayout layout{this}; - GUI::FrameWidget frame1{this, true}; - GUI::FrameWidget frame2{this, false}; - GUI::FrameWidget frame3{this, true}; - GUI::FrameWidget frame4{this, false}; + dggui::FrameWidget frame1{this, true}; + dggui::FrameWidget frame2{this, false}; + dggui::FrameWidget frame3{this, true}; + dggui::FrameWidget frame4{this, false}; Widget1 w1_1{this}; Widget1 w1_2{this}; |