1
0

gui: mainwindow: Add vertical scroll option, default to it

Seems horizontal mode is too unusual according to multiple
feedback.

Allow choosing this the mode in the settings
Dieser Commit ist enthalten in:
Albert S. 2022-08-21 22:57:46 +02:00
Ursprung fe610d3068
Commit 14730ed208
3 geänderte Dateien mit 71 neuen und 18 gelöschten Zeilen

Datei anzeigen

@ -585,6 +585,9 @@ void MainWindow::initSettingsTabs()
ui->txtSettingMountPaths->setText(mountPaths); ui->txtSettingMountPaths->setText(mountPaths);
ui->spinSettingNumerPerPages->setValue(numPagesPerPreview); ui->spinSettingNumerPerPages->setValue(numPagesPerPreview);
ui->txtSettingDatabasePath->setText(databasePath); ui->txtSettingDatabasePath->setText(databasePath);
bool horizontalScroll = settings.value(SETTINGS_KEY_PREVIEWS_SCROLL_HORIZONTALLY).toBool();
ui->radioScrollHorizontally->setChecked(horizontalScroll);
ui->radioScrollVertically->setChecked(!horizontalScroll);
} }
void MainWindow::saveSettings() void MainWindow::saveSettings()
@ -612,6 +615,7 @@ void MainWindow::saveSettings()
settings.setValue(SETTINGS_KEY_MOUNTPATHS, mountPaths); settings.setValue(SETTINGS_KEY_MOUNTPATHS, mountPaths);
settings.setValue(SETTINGS_KEY_PREVIEWSPERPAGE, ui->spinSettingNumerPerPages->value()); settings.setValue(SETTINGS_KEY_PREVIEWSPERPAGE, ui->spinSettingNumerPerPages->value());
settings.setValue(SETTINGS_KEY_DBPATH, databasePath); settings.setValue(SETTINGS_KEY_DBPATH, databasePath);
settings.setValue(SETTINGS_KEY_PREVIEWS_SCROLL_HORIZONTALLY, ui->radioScrollHorizontally->isChecked());
settings.sync(); settings.sync();
@ -866,7 +870,17 @@ void MainWindow::makePreviews(int page)
} }
qDeleteAll(ui->scrollAreaWidgetContents->children()); qDeleteAll(ui->scrollAreaWidgetContents->children());
QSettings settings;
bool horizontalScroll = settings.value(SETTINGS_KEY_PREVIEWS_SCROLL_HORIZONTALLY, false).toBool();
if(horizontalScroll)
{
ui->scrollAreaWidgetContents->setLayout(new QHBoxLayout()); ui->scrollAreaWidgetContents->setLayout(new QHBoxLayout());
}
else
{
ui->scrollAreaWidgetContents->setLayout(new QVBoxLayout());
ui->scrollAreaWidgetContents->layout()->setAlignment(Qt::AlignCenter);
}
ui->previewProcessBar->setMaximum(this->previewableSearchResults.size()); ui->previewProcessBar->setMaximum(this->previewableSearchResults.size());
processedPdfPreviews = 0; processedPdfPreviews = 0;

Datei anzeigen

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1280</width> <width>1280</width>
<height>855</height> <height>888</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -27,7 +27,7 @@
<enum>QTabWidget::South</enum> <enum>QTabWidget::South</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>3</number>
</property> </property>
<widget class="QWidget" name="resultsTab"> <widget class="QWidget" name="resultsTab">
<attribute name="title"> <attribute name="title">
@ -82,7 +82,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1244</width> <width>1244</width>
<height>565</height> <height>598</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"/> <layout class="QHBoxLayout" name="horizontalLayout"/>
@ -542,6 +542,19 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QGroupBox" name="Misc"> <widget class="QGroupBox" name="Misc">
<property name="title"> <property name="title">
@ -551,7 +564,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<item> <item>
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="lblMaxNumbersPreviewPages">
<property name="text"> <property name="text">
<string>Max number of previews per 'page' in 'Previews' tab: </string> <string>Max number of previews per 'page' in 'Previews' tab: </string>
</property> </property>
@ -575,22 +588,47 @@
</item> </item>
</layout> </layout>
</item> </item>
</layout> <item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="lblScrollModeForPreviews">
<property name="text">
<string>Scroll mode for previews:</string>
</property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer"> <widget class="QRadioButton" name="radioScrollVertically">
<property name="text">
<string>Vertically</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioScrollHorizontally">
<property name="text">
<string>Horizontally</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>40</width>
<height>40</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="btnSaveSettings"> <widget class="QPushButton" name="btnSaveSettings">
<property name="text"> <property name="text">

Datei anzeigen

@ -10,6 +10,7 @@
#define SETTINGS_KEY_MOUNTPATHS "mountpaths" #define SETTINGS_KEY_MOUNTPATHS "mountpaths"
#define SETTINGS_KEY_PREVIEWSPERPAGE "previewsPerPage" #define SETTINGS_KEY_PREVIEWSPERPAGE "previewsPerPage"
#define SETTINGS_KEY_SEARCHHISTORY "searchhistory" #define SETTINGS_KEY_SEARCHHISTORY "searchhistory"
#define SETTINGS_KEY_PREVIEWS_SCROLL_HORIZONTALLY "horizontalscroll"
namespace Common namespace Common
{ {