Attempt to scale the column widths when changing fonts
This commit is contained in:
parent
59c46f374b
commit
72e326459c
|
@ -138,7 +138,18 @@ void AbstractTableView::updateColorsSlot()
|
|||
|
||||
void AbstractTableView::updateFontsSlot()
|
||||
{
|
||||
auto oldCharWidth = getCharWidth();
|
||||
updateFonts();
|
||||
auto newCharWidth = getCharWidth();
|
||||
|
||||
// Scale the column widths to the new font
|
||||
for(int col = 0; col < getColumnCount(); col++)
|
||||
{
|
||||
auto width = getColumnWidth(col);
|
||||
auto charCount = width / oldCharWidth;
|
||||
auto padding = width % oldCharWidth;
|
||||
setColumnWidth(col, charCount * newCharWidth + padding);
|
||||
}
|
||||
}
|
||||
|
||||
void AbstractTableView::updateShortcutsSlot()
|
||||
|
|
|
@ -1675,19 +1675,6 @@ border-width: 1px 2px 2px 1px;</string>
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
|
Loading…
Reference in New Issue