Skip to content

Commit 6f6560c

Browse files
committed
Use contain-column for toolbox size calculation
1 parent 3f8d5f0 commit 6f6560c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

data/skins/default/gui/style.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ maxsize = 32
8787
[@toolbox]
8888
padding = 0 0 0 0
8989
absolute = true
90+
flow = contain-column
9091
width = 24px
9192
x = 10px
9293
y = 50%-50%

src/gui/controllers/ToolBox.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class ToolBox : public ui::Controller {
1515
Vector<std::shared_ptr<ui::Node>> buttonPool;
1616
HashMap<Tool*, std::shared_ptr<ui::Node>> toolButton;
1717
Property<String> containerId{this, "container", "", &ToolBox::setContainer};
18-
Property<S32> extraHeight{this, "extra-height", 0};
1918
std::weak_ptr<ui::Node> container;
2019

2120
public:
@@ -67,7 +66,6 @@ class ToolBox : public ui::Controller {
6766
}
6867
}
6968

70-
U32 height = *extraHeight + node()->padding->y + node()->padding->height;
7169
for (auto entry : enabled) {
7270
std::shared_ptr<ui::Node> button;
7371
auto tool = entry->second;
@@ -87,12 +85,10 @@ class ToolBox : public ui::Controller {
8785
}
8886
toolButton[tool.get()] = button;
8987
button->load(entry->second->getPropertySet());
88+
logI(String(*button->height));
9089
}
91-
height += button->outerHeight();
9290
container->addChild(button);
9391
}
94-
95-
node()->set("height", height);
9692
}
9793

9894
void attach() override {

0 commit comments

Comments
 (0)