Skip to content

Commit

Permalink
Improve preferences layout for long translations (#1856)
Browse files Browse the repository at this point in the history
  • Loading branch information
J5lx authored Jul 2, 2024
1 parent a7cfa31 commit 258c31b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
7 changes: 7 additions & 0 deletions app/src/preferencesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ PreferencesDialog::PreferencesDialog(QWidget* parent) :
ui(new Ui::PreferencesDialog)
{
ui->setupUi(this);

for (int i = 0; i < 0 + 1 * ui->contentsWidget->count(); i++) {
QListWidgetItem* item = ui->contentsWidget->item(i);
// Fill entire width
item->setSizeHint({std::numeric_limits<int>::max(),
ui->contentsWidget->visualItemRect(item).height()});
}
}

PreferencesDialog::~PreferencesDialog()
Expand Down
12 changes: 0 additions & 12 deletions app/ui/generalpage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea">
<property name="minimumSize">
<size>
<width>128</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>400</width>
<height>16777215</height>
</size>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
Expand Down
32 changes: 19 additions & 13 deletions app/ui/preferencesdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@
<rect>
<x>0</x>
<y>0</y>
<width>534</width>
<height>445</height>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>600</width>
<height>680</height>
</size>
</property>
<property name="windowTitle">
<string>Preferences</string>
</property>
Expand All @@ -32,16 +26,22 @@
</property>
<property name="minimumSize">
<size>
<width>120</width>
<width>175</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>128</width>
<width>175</width>
<height>16777215</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="iconSize">
<size>
<width>64</width>
Expand All @@ -51,17 +51,23 @@
<property name="movement">
<enum>QListView::Static</enum>
</property>
<property name="spacing">
<number>20</number>
<property name="flow">
<enum>QListView::TopToBottom</enum>
</property>
<property name="isWrapping" stdset="0">
<bool>false</bool>
</property>
<property name="viewMode">
<enum>QListView::IconMode</enum>
</property>
<property name="uniformItemSizes">
<bool>false</bool>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="currentRow">
<number>-1</number>
<number>0</number>
</property>
<item>
<property name="text">
Expand Down

0 comments on commit 258c31b

Please sign in to comment.