这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed for the size hints to work properly. Since this is essentially an entirely vertical widget, this only really affects the position of the scrollbar in rtl languages. Given that the dialog is now by default large enough to show all items without scrolling, that shouldn’t be a big deal.

</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