mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-02-03 18:57:37 +01:00
Added responsize resizer.
This commit is contained in:
parent
bfea4d4aed
commit
8540f6977a
@ -33,9 +33,7 @@ FormAddAccount::FormAddAccount(const QList<ServiceEntryPoint*>& entry_points, Fe
|
||||
: QDialog(parent), m_ui(new Ui::FormAddAccount), m_model(model), m_entryPoints(entry_points) {
|
||||
m_ui->setupUi(this);
|
||||
|
||||
#if defined (Q_OS_ANDROID)
|
||||
GuiUtilities::applyResponsiveDialogResize(*this);
|
||||
#endif
|
||||
|
||||
// Set flags and attributes.
|
||||
GuiUtilities::applyDialogProperties(*this, qApp->icons()->fromTheme(QSL("document-new")));
|
||||
|
@ -20,9 +20,11 @@
|
||||
|
||||
#include "definitions/definitions.h"
|
||||
|
||||
#if defined (Q_OS_ANDROID)
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QSize>
|
||||
#endif
|
||||
|
||||
void GuiUtilities::setLabelAsNotice(QLabel& label, bool is_warning) {
|
||||
label.setMargin(6);
|
||||
@ -45,10 +47,12 @@ void GuiUtilities::applyDialogProperties(QWidget& widget, const QIcon& icon, con
|
||||
}
|
||||
|
||||
void GuiUtilities::applyResponsiveDialogResize(QWidget& widget, double factor) {
|
||||
#if defined (Q_OS_ANDROID)
|
||||
auto desktop_geom = QApplication::desktop()->screenGeometry();
|
||||
auto ratio = double(widget.size().height()) / widget.size().width();
|
||||
int widt = desktop_geom.width() * factor;
|
||||
int heig = widt * ratio;
|
||||
|
||||
widget.resize(widt, heig);
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user