Skip to content

Commit

Permalink
Don't set the minimum value of the row height.
Browse files Browse the repository at this point in the history
  • Loading branch information
skanmera committed Dec 25, 2017
1 parent 475a92b commit 648b00c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 26 deletions.
7 changes: 0 additions & 7 deletions ExcelMerge.GUI/Settings/ApplicationSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,6 @@ public int ColumnWidth
set { SetProperty(ref columnWidth, value); }
}

private int minRowHeight = 20;
public int MinRowHeight
{
get { return minRowHeight; }
set { SetProperty(ref minRowHeight, value); }
}

private int maxRowHeight = 200;
public int MaxRowHeight
{
Expand Down
17 changes: 1 addition & 16 deletions ExcelMerge.GUI/Views/DiffExtractionSettingWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,6 @@
Value="{Binding Setting.ColumnWidth, UpdateSourceTrigger=PropertyChanged}" />
</Grid>

<Grid Margin="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="80*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0"
VerticalAlignment="Center"
Content="{x:Static props:Resources.Label_MinRowHeight}"/>
<xctk:IntegerUpDown Grid.Column="1"
Width="100"
HorizontalAlignment="Left"
Minimum="20"
Value="{Binding Setting.MinRowHeight, UpdateSourceTrigger=PropertyChanged}" />
</Grid>

<Grid Margin="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20*"/>
Expand Down Expand Up @@ -242,7 +227,7 @@
<StackPanel Orientation="Horizontal" Grid.Column="1">
<TextBox Text="{Binding Path=SelectedColor, ElementName=NewColorPicker, Mode=OneWay}" IsReadOnly="True" Width="100" Height="25" Margin="3 0 0 0" />
<xctk:ColorPicker x:Name="NewColorPicker" Width="250" Height="25" Margin="3" SelectedColor="AliceBlue"/>
<Button Content="+" Margin="3" Width="50"
<Button Content="+" Margin="0 3 3 3" Width="50"
Command="{Binding AddAlternationColorCommand}"
CommandParameter="{Binding Path=SelectedColor, ElementName=NewColorPicker}"/>
</StackPanel>
Expand Down
1 change: 0 additions & 1 deletion ExcelMerge.GUI/Views/EventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public void OnApplicationSettingUpdated(IUnityContainer container)
grid.SetMaxColumnSize(App.Instance.Setting.ColumnWidth);
grid.SetMinColumnSize(App.Instance.Setting.ColumnWidth);
grid.SetMaxRowSize(App.Instance.Setting.MaxRowHeight);
grid.SetMinRowSize(App.Instance.Setting.MinRowHeight);
grid.AllowFlexibleRows = App.Instance.Setting.FitRowHeight;

DataGridEventDispatcher.DispatchModelUpdateEvent(grid, container);
Expand Down
5 changes: 3 additions & 2 deletions FastWpfGrid/FastWpfGrid/FastGridControl_Arrange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,9 @@ private bool CountVisibleRowHeights()
{
var cell = _isTransposed ? GetModelCell(col, row) : GetModelCell(row, col);
var cellContentHeight = Math.Min(GetCellContentHeight(cell), _rowSizes.MaxSize.Value);
cellContentHeight = Math.Max(cellContentHeight, _rowSizes.MinSize.Value);
_rowSizes.PutSizeOverride(modelRow, cellContentHeight + 2 * CellPaddingVertical + 2 + RowHeightReserve);

if (cellContentHeight > _rowSizes.DefaultSize)
_rowSizes.PutSizeOverride(modelRow, cellContentHeight + 2 * CellPaddingVertical + 2 + RowHeightReserve);
}
}
_rowSizes.BuildIndex();
Expand Down

0 comments on commit 648b00c

Please sign in to comment.