Make display scaling apply to InputRoll column header widths.

This commit is contained in:
J.D. Purcell 2020-02-17 12:34:37 -05:00
parent dd2b3509e5
commit f7174eb398
12 changed files with 61 additions and 52 deletions

View File

@ -24,6 +24,15 @@
/// <summary> /// <summary>
/// If drawn rotated, specifies the desired height, or null to auto-size /// If drawn rotated, specifies the desired height, or null to auto-size
/// </summary> /// </summary>
public int? RotatedHeight { get; set; } public int? RotatedHeight { get; set; }
/// <summary>
/// Sets the desired width as appropriate for a display with no scaling. If display
/// scaling is enabled, the actual column width will be scaled accordingly.
/// </summary>
public int UnscaledWidth
{
set => Width = UIHelper.ScaleX(value);
}
} }
} }

View File

@ -66,19 +66,19 @@ namespace BizHawk.Client.EmuHawk
lvCDL.AllColumns.Clear(); lvCDL.AllColumns.Clear();
lvCDL.AllColumns.AddRange(new [] lvCDL.AllColumns.AddRange(new []
{ {
new RollColumn { Name = "CDLFile", Text = "CDL File @", Width = 107, Type = ColumnType.Text }, new RollColumn { Name = "CDLFile", Text = "CDL File @", UnscaledWidth = 107, Type = ColumnType.Text },
new RollColumn { Name = "Domain", Text = "Domain", Width = 126, Type = ColumnType.Text }, new RollColumn { Name = "Domain", Text = "Domain", UnscaledWidth = 126, Type = ColumnType.Text },
new RollColumn { Name = "Percent", Text = "%", Width = 58, Type = ColumnType.Text }, new RollColumn { Name = "Percent", Text = "%", UnscaledWidth = 58, Type = ColumnType.Text },
new RollColumn { Name = "Mapped", Text = "Mapped", Width = 64, Type = ColumnType.Text }, new RollColumn { Name = "Mapped", Text = "Mapped", UnscaledWidth = 64, Type = ColumnType.Text },
new RollColumn { Name = "Size", Text = "Size", Width = 112, Type = ColumnType.Text }, new RollColumn { Name = "Size", Text = "Size", UnscaledWidth = 112, Type = ColumnType.Text },
new RollColumn { Name = "0x01", Text = "0x01", Width = 56, Type = ColumnType.Text }, new RollColumn { Name = "0x01", Text = "0x01", UnscaledWidth = 56, Type = ColumnType.Text },
new RollColumn { Name = "0x02", Text = "0x02", Width = 56, Type = ColumnType.Text }, new RollColumn { Name = "0x02", Text = "0x02", UnscaledWidth = 56, Type = ColumnType.Text },
new RollColumn { Name = "0x04", Text = "0x04", Width = 56, Type = ColumnType.Text }, new RollColumn { Name = "0x04", Text = "0x04", UnscaledWidth = 56, Type = ColumnType.Text },
new RollColumn { Name = "0x08", Text = "0x08", Width = 56, Type = ColumnType.Text }, new RollColumn { Name = "0x08", Text = "0x08", UnscaledWidth = 56, Type = ColumnType.Text },
new RollColumn { Name = "0x10", Text = "0x10", Width = 56, Type = ColumnType.Text }, new RollColumn { Name = "0x10", Text = "0x10", UnscaledWidth = 56, Type = ColumnType.Text },
new RollColumn { Name = "0x20", Text = "0x20", Width = 56, Type = ColumnType.Text }, new RollColumn { Name = "0x20", Text = "0x20", UnscaledWidth = 56, Type = ColumnType.Text },
new RollColumn { Name = "0x40", Text = "0x40", Width = 56, Type = ColumnType.Text }, new RollColumn { Name = "0x40", Text = "0x40", UnscaledWidth = 56, Type = ColumnType.Text },
new RollColumn { Name = "0x80", Text = "0x80", Width = 56, Type = ColumnType.Text } new RollColumn { Name = "0x80", Text = "0x80", UnscaledWidth = 56, Type = ColumnType.Text }
}); });
} }

View File

@ -727,15 +727,15 @@ namespace BizHawk.Client.EmuHawk
{ {
Columns = new List<RollColumn> Columns = new List<RollColumn>
{ {
new RollColumn { Text = "Names", Name = NameColumn, Visible = true, Width = 128, Type = ColumnType.Text }, new RollColumn { Text = "Names", Name = NameColumn, Visible = true, UnscaledWidth = 128, Type = ColumnType.Text },
new RollColumn { Text = "Address", Name = AddressColumn, Visible = true, Width = 60, Type = ColumnType.Text }, new RollColumn { Text = "Address", Name = AddressColumn, Visible = true, UnscaledWidth = 60, Type = ColumnType.Text },
new RollColumn { Text = "Value", Name = ValueColumn, Visible = true, Width = 59, Type = ColumnType.Text }, new RollColumn { Text = "Value", Name = ValueColumn, Visible = true, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Compare", Name = CompareColumn, Visible = true, Width = 63, Type = ColumnType.Text }, new RollColumn { Text = "Compare", Name = CompareColumn, Visible = true, UnscaledWidth = 63, Type = ColumnType.Text },
new RollColumn { Text = "Compare Type", Name = ComparisonTypeColumn, Visible = true, Width = 98, Type = ColumnType.Text }, new RollColumn { Text = "Compare Type", Name = ComparisonTypeColumn, Visible = true, UnscaledWidth = 98, Type = ColumnType.Text },
new RollColumn { Text = "On", Name = OnColumn, Visible = false, Width = 28, Type = ColumnType.Text }, new RollColumn { Text = "On", Name = OnColumn, Visible = false, UnscaledWidth = 28, Type = ColumnType.Text },
new RollColumn { Text = "Size", Name = SizeColumn, Visible = true, Width = 55, Type = ColumnType.Text }, new RollColumn { Text = "Size", Name = SizeColumn, Visible = true, UnscaledWidth = 55, Type = ColumnType.Text },
new RollColumn { Text = "Endian", Name = EndianColumn, Visible = false, Width = 55, Type = ColumnType.Text }, new RollColumn { Text = "Endian", Name = EndianColumn, Visible = false, UnscaledWidth = 55, Type = ColumnType.Text },
new RollColumn { Text = "Display Type", Name = TypeColumn, Visible = false, Width = 88, Type = ColumnType.Text } new RollColumn { Text = "Display Type", Name = TypeColumn, Visible = false, UnscaledWidth = 88, Type = ColumnType.Text }
}; };
} }

View File

@ -27,14 +27,14 @@ namespace BizHawk.Client.EmuHawk
{ {
Name = AddressColumnName, Name = AddressColumnName,
Text = AddressColumnName, Text = AddressColumnName,
Width = 94, UnscaledWidth = 94,
Type = ColumnType.Text Type = ColumnType.Text
}, },
new RollColumn new RollColumn
{ {
Name = InstructionColumnName, Name = InstructionColumnName,
Text = InstructionColumnName, Text = InstructionColumnName,
Width = 291, UnscaledWidth = 291,
Type = ColumnType.Text Type = ColumnType.Text
} }
}); });

View File

@ -41,9 +41,9 @@ namespace BizHawk.Client.EmuHawk
{ {
Columns = new List<RollColumn> Columns = new List<RollColumn>
{ {
new RollColumn { Name = IconColumnName, Text = " ", Visible = true, Width = 22, Type = ColumnType.Image }, new RollColumn { Name = IconColumnName, Text = " ", Visible = true, UnscaledWidth = 22, Type = ColumnType.Image },
new RollColumn { Name = ScriptColumnName, Text = "Script", Visible = true, Width = 92, Type = ColumnType.Text }, new RollColumn { Name = ScriptColumnName, Text = "Script", Visible = true, UnscaledWidth = 92, Type = ColumnType.Text },
new RollColumn { Name = PathColumnName, Text = "Path", Visible = true, Width = 300, Type = ColumnType.Text } new RollColumn { Name = PathColumnName, Text = "Path", Visible = true, UnscaledWidth = 300, Type = ColumnType.Text }
}; };
} }

View File

@ -58,19 +58,19 @@ namespace BizHawk.Client.EmuHawk
{ {
Name = BranchNumberColumnName, Name = BranchNumberColumnName,
Text = "#", Text = "#",
Width = 30 UnscaledWidth = 30
}, },
new RollColumn new RollColumn
{ {
Name = FrameColumnName, Name = FrameColumnName,
Text = "Frame", Text = "Frame",
Width = 64 UnscaledWidth = 64
}, },
new RollColumn new RollColumn
{ {
Name = UserTextColumnName, Name = UserTextColumnName,
Text = "UserText", Text = "UserText",
Width = 90 UnscaledWidth = 90
}, },
}); });
} }

View File

@ -31,13 +31,13 @@ namespace BizHawk.Client.EmuHawk
{ {
Name = "FrameColumn", Name = "FrameColumn",
Text = "Frame", Text = "Frame",
Width = 52 UnscaledWidth = 52
}, },
new RollColumn new RollColumn
{ {
Name = "LabelColumn", Name = "LabelColumn",
Text = "", Text = "",
Width = 125 UnscaledWidth = 125
} }
}); });
} }

View File

@ -415,7 +415,7 @@ namespace BizHawk.Client.EmuHawk
{ {
Name = FrameColumnName, Name = FrameColumnName,
Text = "Frame#", Text = "Frame#",
Width = 68, UnscaledWidth = 68,
Type = ColumnType.Text, Type = ColumnType.Text,
Rotatable = true Rotatable = true
}); });
@ -525,7 +525,7 @@ namespace BizHawk.Client.EmuHawk
{ {
Name = columnName, Name = columnName,
Text = columnText, Text = columnText,
Width = columnWidth, UnscaledWidth = columnWidth,
Type = columnType Type = columnType
}); });
} }

View File

@ -26,8 +26,8 @@ namespace BizHawk.Client.EmuHawk
HistoryView.AllColumns.Clear(); HistoryView.AllColumns.Clear();
HistoryView.AllColumns.AddRange(new[] HistoryView.AllColumns.AddRange(new[]
{ {
new RollColumn { Name = IdColumnName, Text = IdColumnName, Width = 40, Type = ColumnType.Text }, new RollColumn { Name = IdColumnName, Text = IdColumnName, UnscaledWidth = 40, Type = ColumnType.Text },
new RollColumn { Name = UndoColumnName, Text = UndoColumnName, Width = 280, Type = ColumnType.Text } new RollColumn { Name = UndoColumnName, Text = UndoColumnName, UnscaledWidth = 280, Type = ColumnType.Text }
}); });
MaxStepsNum.Value = Log.MaxSteps; MaxStepsNum.Value = Log.MaxSteps;

View File

@ -81,14 +81,14 @@ namespace BizHawk.Client.EmuHawk
{ {
Name = DisasmColumnName, Name = DisasmColumnName,
Text = DisasmColumnName, Text = DisasmColumnName,
Width = 239, UnscaledWidth = 239,
Type = ColumnType.Text Type = ColumnType.Text
}); });
TraceView.AllColumns.Add(new RollColumn TraceView.AllColumns.Add(new RollColumn
{ {
Name = RegistersColumnName, Name = RegistersColumnName,
Text = RegistersColumnName, Text = RegistersColumnName,
Width = 357, UnscaledWidth = 357,
Type = ColumnType.Text Type = ColumnType.Text
}); });
} }

View File

@ -966,11 +966,11 @@ namespace BizHawk.Client.EmuHawk
{ {
Columns = new List<RollColumn> Columns = new List<RollColumn>
{ {
new RollColumn { Text = "Address", Name = WatchList.ADDRESS, Visible = true, Width = 60, Type = ColumnType.Text }, new RollColumn { Text = "Address", Name = WatchList.ADDRESS, Visible = true, UnscaledWidth = 60, Type = ColumnType.Text },
new RollColumn { Text = "Value", Name = WatchList.VALUE, Visible = true, Width = 59, Type = ColumnType.Text }, new RollColumn { Text = "Value", Name = WatchList.VALUE, Visible = true, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Prev", Name = WatchList.PREV, Visible = true, Width = 59, Type = ColumnType.Text }, new RollColumn { Text = "Prev", Name = WatchList.PREV, Visible = true, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Changes", Name = WatchList.CHANGES, Visible = true, Width = 60, Type = ColumnType.Text }, new RollColumn { Text = "Changes", Name = WatchList.CHANGES, Visible = true, UnscaledWidth = 60, Type = ColumnType.Text },
new RollColumn { Text = "Diff", Name = WatchList.DIFF, Visible = false, Width = 59, Type = ColumnType.Text }, new RollColumn { Text = "Diff", Name = WatchList.DIFF, Visible = false, UnscaledWidth = 59, Type = ColumnType.Text },
}; };
PreviewMode = true; PreviewMode = true;

View File

@ -79,14 +79,14 @@ namespace BizHawk.Client.EmuHawk
{ {
Columns = new List<RollColumn> Columns = new List<RollColumn>
{ {
new RollColumn { Text = "Address", Name = WatchList.ADDRESS, Visible = true, Width = 60, Type = ColumnType.Text }, new RollColumn { Text = "Address", Name = WatchList.ADDRESS, Visible = true, UnscaledWidth = 60, Type = ColumnType.Text },
new RollColumn { Text = "Value", Name = WatchList.VALUE, Visible = true, Width = 59, Type = ColumnType.Text }, new RollColumn { Text = "Value", Name = WatchList.VALUE, Visible = true, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Prev", Name = WatchList.PREV, Visible = false, Width = 59, Type = ColumnType.Text }, new RollColumn { Text = "Prev", Name = WatchList.PREV, Visible = false, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Changes", Name = WatchList.CHANGES, Visible = true, Width = 60, Type = ColumnType.Text }, new RollColumn { Text = "Changes", Name = WatchList.CHANGES, Visible = true, UnscaledWidth = 60, Type = ColumnType.Text },
new RollColumn { Text = "Diff", Name = WatchList.DIFF, Visible = false, Width = 59, Type = ColumnType.Text }, new RollColumn { Text = "Diff", Name = WatchList.DIFF, Visible = false, UnscaledWidth = 59, Type = ColumnType.Text },
new RollColumn { Text = "Type", Name = WatchList.TYPE, Visible = false, Width = 55, Type = ColumnType.Text }, new RollColumn { Text = "Type", Name = WatchList.TYPE, Visible = false, UnscaledWidth = 55, Type = ColumnType.Text },
new RollColumn { Text = "Domain", Name = WatchList.DOMAIN, Visible = true, Width = 55, Type = ColumnType.Text }, new RollColumn { Text = "Domain", Name = WatchList.DOMAIN, Visible = true, UnscaledWidth = 55, Type = ColumnType.Text },
new RollColumn { Text = "Notes", Name = WatchList.NOTES, Visible = true, Width = 128, Type = ColumnType.Text } new RollColumn { Text = "Notes", Name = WatchList.NOTES, Visible = true, UnscaledWidth = 128, Type = ColumnType.Text }
}; };
} }