automatically resize all dialogs which are bigger than available screen
This commit is contained in:
parent
001f0b4ee5
commit
e48677b665
@ -921,12 +921,12 @@ Item ID: %5</source>
|
||||
<context>
|
||||
<name>FeedReader</name>
|
||||
<message>
|
||||
<location filename="../src/librssguard/miscellaneous/feedreader.cpp" line="361"/>
|
||||
<location filename="../src/librssguard/miscellaneous/feedreader.cpp" line="367"/>
|
||||
<source>Starting auto-download of some feeds' articles</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../src/librssguard/miscellaneous/feedreader.cpp" line="362"/>
|
||||
<location filename="../src/librssguard/miscellaneous/feedreader.cpp" line="368"/>
|
||||
<source>I will auto-download new articles for %n feed(s).</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
|
@ -58,8 +58,6 @@ FormSettings::FormSettings(QWidget& parent) : QDialog(&parent), m_settings(*qApp
|
||||
m_ui.m_listSettings->setMaximumWidth(m_ui.m_listSettings->sizeHintForColumn(0) +
|
||||
6 * m_ui.m_listSettings->frameWidth());
|
||||
m_ui.m_listSettings->setCurrentRow(0);
|
||||
|
||||
resize(qApp->settings()->value(GROUP(GUI), GUI::SettingsWindowInitialSize, size()).toSize());
|
||||
}
|
||||
|
||||
FormSettings::~FormSettings() {
|
||||
@ -121,8 +119,6 @@ void FormSettings::applySettings() {
|
||||
}
|
||||
|
||||
m_btnApply->setEnabled(false);
|
||||
|
||||
qApp->settings()->setValue(GROUP(GUI), GUI::SettingsWindowInitialSize, size());
|
||||
}
|
||||
|
||||
void FormSettings::cancelSettings() {
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "definitions/definitions.h"
|
||||
|
||||
#include <QScreen>
|
||||
#include <QSettings>
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
@ -34,6 +35,22 @@ void GuiUtilities::applyDialogProperties(QWidget& widget, const QIcon& icon, con
|
||||
if (!title.isEmpty()) {
|
||||
widget.setWindowTitle(title);
|
||||
}
|
||||
|
||||
// We fix too big dialog size or out-of-bounds position.
|
||||
auto size_widget = widget.size();
|
||||
auto size_screen = widget.screen()->availableSize();
|
||||
|
||||
if (size_widget.width() > size_screen.width()) {
|
||||
size_widget.setWidth(size_screen.width() * 0.9);
|
||||
}
|
||||
|
||||
if (size_widget.height() > size_screen.height()) {
|
||||
size_widget.setHeight(size_screen.height() * 0.9);
|
||||
}
|
||||
|
||||
if (size_widget != widget.size()) {
|
||||
widget.resize(size_widget);
|
||||
}
|
||||
}
|
||||
|
||||
void GuiUtilities::restoreState(QWidget* wdg, QByteArray state) {
|
||||
|
@ -333,6 +333,12 @@ void FeedReader::executeNextAutoUpdate() {
|
||||
synchronizeMessageData(caches);
|
||||
}
|
||||
|
||||
if (disable_update_with_window) {
|
||||
qDebugNN << LOGSEC_CORE << "Delaying scheduled feed auto-download for some time since window "
|
||||
<< "is focused. Article cache was synchronised nonetheless.";
|
||||
return;
|
||||
}
|
||||
|
||||
// Pass needed interval data and lets the model decide which feeds
|
||||
// should be updated in this pass.
|
||||
QDateTime current_time = QDateTime::currentDateTimeUtc();
|
||||
|
@ -278,7 +278,6 @@ DVALUE(char*)
|
||||
GUI::StatusbarActionsDef = "m_barProgressDownloadAction,m_barProgressFeedsAction,m_actionUpdateAllItems,m_"
|
||||
"actionUpdateSelectedItems,m_actionStopRunningItemsUpdate,m_actionFullscreen,m_actionQuit";
|
||||
|
||||
DKEY GUI::SettingsWindowInitialSize = "settings_window_size";
|
||||
DKEY GUI::MainWindowInitialSize = "window_size";
|
||||
DKEY GUI::MainWindowInitialPosition = "window_position";
|
||||
|
||||
|
@ -292,7 +292,6 @@ namespace GUI {
|
||||
KEY StatusbarActions;
|
||||
VALUE(char*) StatusbarActionsDef;
|
||||
|
||||
KEY SettingsWindowInitialSize;
|
||||
KEY MainWindowInitialSize;
|
||||
KEY MainWindowInitialPosition;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user