Skip to content

Commit

Permalink
UI: properly inherit hgrow for tabbed
Browse files Browse the repository at this point in the history
  • Loading branch information
black-sliver committed Nov 27, 2024
1 parent 7946771 commit 137b018
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ui/trackerview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ bool TrackerView::addLayoutNode(Container* container, const LayoutNode& node, si
if (node.getType() == "container" || node.getType() == "tab") {
Container *w = new SimpleContainer(0,0,container->getWidth(),container->getHeight());
w->setDropShaodw(node.getDropShadow(container->getDropShadow()));
w->setGrow(1,1); // required at the moment -- TODO: make this depend on children
w->setGrow(0,1); // required at the moment -- TODO: make this depend on children
if (!node.getBackground().empty()) w->setBackground(node.getBackground());
addLayoutNodes(w, children, depth+1);
container->addChild(w);
Expand Down Expand Up @@ -631,7 +631,7 @@ bool TrackerView::addLayoutNode(Container* container, const LayoutNode& node, si
// + a private hbox for tab buttons
Tabs *w = new Tabs(0,0,container->getWidth(),container->getHeight(),_font);
w->setDropShaodw(node.getDropShadow(container->getDropShadow()));
w->setGrow(1,1); // required at the moment -- TODO: make this depend on children
w->setGrow(0,1); // required at the moment -- TODO: make this depend on children
if (!node.getBackground().empty())
w->setBackground(node.getBackground());
if (children.empty())
Expand Down
2 changes: 2 additions & 0 deletions src/uilib/tabs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ void Tabs::addChild(Widget* w)
{
w->setVisible(false);
_children.push_back(w);
if (w->getHGrow() > _hGrow)
_hGrow = w->getHGrow();
Button* btn = new Button(0,0,0,0,_font,"Tab");
btn->setSize(btn->getMinSize());
btn->onClick += {this, [this](void* sender,int x, int y, int btn) {
Expand Down

0 comments on commit 137b018

Please sign in to comment.