Skip to content

Commit

Permalink
Fix invisible positions after login (#33)
Browse files Browse the repository at this point in the history
* Set minimum size of PortfolioPanel after adding positions.

This fixes #32 but more refactoring is to come.

* Set minimal size of panels.

It's not clear if this is actually doing anything. It's possible that our use of wxScrolledWindow to show positions allows all child components to expand to their minimal size naturally. However, most example code showing sizers uses SetSizerAndFit() so parents extend to contain their children.
  • Loading branch information
krazkidd authored Jun 19, 2024
1 parent 793f6e0 commit 93a0064
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/ui/BalancePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void BalancePanel::Setup()
boxSizer->Add(lblBalance, flagsLbl);
boxSizer->Add(lblBalanceAmount, flagsLbl);

SetSizer(boxSizer);
SetSizerAndFit(boxSizer);
}

void BalancePanel::UpdateStuff()
Expand Down
2 changes: 1 addition & 1 deletion src/ui/EventPositionPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ void EventPositionPanel::Setup()
gridSizer->Add(lblTotalTraded, flagsLblRight);
gridSizer->Add(lblRestingOrders, flagsLblRight);

SetSizer(gridSizer);
SetSizerAndFit(gridSizer);
}
2 changes: 1 addition & 1 deletion src/ui/MarketPositionPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ void MarketPositionPanel::Setup()
gridSizer->Add(lblTotalTraded, flagsLblRight);
gridSizer->Add(lblRestingOrders, flagsLblRight);

SetSizer(gridSizer);
SetSizerAndFit(gridSizer);
}
4 changes: 2 additions & 2 deletions src/ui/PortfolioPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void PortfolioPanel::Setup()
boxSizer->Add(pnlBalance, flagsPnl);
boxSizer->Add(pnlPositions, flagsPnl);

SetSizer(boxSizer);
SetSizerAndFit(boxSizer);
SetScrollRate(10, 10);
}

Expand Down Expand Up @@ -62,7 +62,7 @@ void PortfolioPanel::UpdateStuff()
boxSizer->Add(new MarketPositionPanel(pnlPositions, wxID_ANY, &market), flagsPnl);
}

pnlPositions->SetSizer(boxSizer);
pnlPositions->SetSizerAndFit(boxSizer);
}
catch (std::exception &e)
{
Expand Down

0 comments on commit 93a0064

Please sign in to comment.