Skip to content

Commit 91503e0

Browse files
carlos-zamoraDHowett
authored andcommitted
Make panes use xaml star sizing (#4953)
## Summary of the Pull Request Dustin and Mike had a discussion on star sizing. Mcpiroman connected the dots. I just swooped in and implemented it. ## References #3996 (comment) #3744 (comment) ## PR Checklist * [X] Closes #3744 ## Detailed Description of the Pull Request / Additional comments Star sizing allows us to keep things proportional. Since a 1::1 proportion is the same as a 100::100 proportion, I just went in and added star sizing. In the words of a some dude with a big metal fist, everything is perfectly balanced now. ![image](https://user-images.githubusercontent.com/11050425/76813679-f7103f00-67b5-11ea-9b5c-d2cc73673aba.png) ## Validation Steps Performed Verified for vertical, horizontal, and uneven splits. (cherry picked from commit 1d8c5ba)
1 parent 9516372 commit 91503e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cascadia/TerminalApp/Pane.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,10 +803,10 @@ void Pane::_CreateRowColDefinitions(const Size& rootSize)
803803
const auto paneSizes = _CalcChildrenSizes(rootSize.Width);
804804

805805
auto firstColDef = Controls::ColumnDefinition();
806-
firstColDef.Width(GridLengthHelper::FromPixels(paneSizes.first));
806+
firstColDef.Width(GridLengthHelper::FromValueAndType(paneSizes.first, GridUnitType::Star));
807807

808808
auto secondColDef = Controls::ColumnDefinition();
809-
secondColDef.Width(GridLengthHelper::FromPixels(paneSizes.second));
809+
secondColDef.Width(GridLengthHelper::FromValueAndType(paneSizes.second, GridUnitType::Star));
810810

811811
_root.ColumnDefinitions().Append(firstColDef);
812812
_root.ColumnDefinitions().Append(secondColDef);
@@ -819,10 +819,10 @@ void Pane::_CreateRowColDefinitions(const Size& rootSize)
819819
const auto paneSizes = _CalcChildrenSizes(rootSize.Height);
820820

821821
auto firstRowDef = Controls::RowDefinition();
822-
firstRowDef.Height(GridLengthHelper::FromPixels(paneSizes.first));
822+
firstRowDef.Height(GridLengthHelper::FromValueAndType(paneSizes.first, GridUnitType::Star));
823823

824824
auto secondRowDef = Controls::RowDefinition();
825-
secondRowDef.Height(GridLengthHelper::FromPixels(paneSizes.second));
825+
secondRowDef.Height(GridLengthHelper::FromValueAndType(paneSizes.second, GridUnitType::Star));
826826

827827
_root.RowDefinitions().Append(firstRowDef);
828828
_root.RowDefinitions().Append(secondRowDef);

0 commit comments

Comments
 (0)