Commit 67b9e229 authored by Laurent Montel's avatar Laurent Montel
Browse files

Fix dialog size in hdpi

parent 54fa7ae1
Pipeline #238619 passed with stage
in 14 minutes and 34 seconds
......@@ -10,11 +10,17 @@
#include <KLocalizedString>
#include <KSharedConfig>
#include <KStandardGuiItem>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myConfigVCardViewerDialog[] = "VCardViewerDialog";
}
VCardViewerDialog::VCardViewerDialog(const KContacts::Addressee::List &list, QWidget *parent)
: QDialog(parent)
, mContacts(list)
......@@ -72,17 +78,17 @@ VCardViewerDialog::~VCardViewerDialog()
void VCardViewerDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "VCardViewerDialog");
const QSize size = group.readEntry("Size", QSize(600, 400));
if (size.isValid()) {
resize(size);
}
create(); // ensure a window is created
windowHandle()->resize(QSize(600, 400));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigVCardViewerDialog);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void VCardViewerDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "VCardViewerDialog");
group.writeEntry("Size", size());
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigVCardViewerDialog);
KWindowConfig::saveWindowSize(windowHandle(), group);
group.sync();
}
......
......@@ -9,9 +9,11 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWindow>
using namespace KABGravatar;
namespace
......@@ -99,16 +101,16 @@ void GravatarUpdateDialog::setOriginalPixmap(const QPixmap &pix)
void GravatarUpdateDialog::readConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myConfigGroupName);
const QSize size = grp.readEntry("Size", QSize(300, 200));
if (size.isValid()) {
resize(size);
}
create(); // ensure a window is created
windowHandle()->resize(QSize(300, 200));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void GravatarUpdateDialog::writeConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myConfigGroupName);
grp.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), grp);
grp.sync();
}
......@@ -5,7 +5,6 @@
*/
#include "mergecontactsdialog.h"
#include "job/mergecontactsjob.h"
#include "manualmerge/mergecontactwidget.h"
#include "widgets/mergecontacterrorlabel.h"
#include "widgets/mergecontactinfowidget.h"
......@@ -15,10 +14,12 @@
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QStackedWidget>
#include <QVBoxLayout>
#include <QWindow>
using namespace KABMergeContacts;
namespace
......@@ -93,17 +94,17 @@ void MergeContactsDialog::slotCustomizeMergeContact(const Akonadi::Item::List &l
void MergeContactsDialog::readConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myConfigGroupName);
const QSize size = grp.readEntry("Size", QSize(300, 200));
if (size.isValid()) {
resize(size);
}
create(); // ensure a window is created
windowHandle()->resize(QSize(300, 200));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void MergeContactsDialog::writeConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myConfigGroupName);
grp.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), grp);
grp.sync();
}
......
......@@ -16,10 +16,12 @@
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QStackedWidget>
#include <QVBoxLayout>
#include <QWindow>
using namespace KABMergeContacts;
namespace
......@@ -92,17 +94,17 @@ void SearchAndMergeContactDuplicateContactDialog::searchPotentialDuplicateContac
void SearchAndMergeContactDuplicateContactDialog::readConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), mySearchAndMergeContactDuplicateContactDialogGroupName);
const QSize size = grp.readEntry("Size", QSize(300, 200));
if (size.isValid()) {
resize(size);
}
create(); // ensure a window is created
windowHandle()->resize(QSize(300, 200));
KConfigGroup group(KSharedConfig::openStateConfig(), mySearchAndMergeContactDuplicateContactDialogGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void SearchAndMergeContactDuplicateContactDialog::writeConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), mySearchAndMergeContactDuplicateContactDialogGroupName);
grp.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), grp);
grp.sync();
}
......
......@@ -9,8 +9,10 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
......@@ -49,14 +51,15 @@ void ConfirmBeforeDeletingDialog::slotSave()
void ConfirmBeforeDeletingDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfirmBeforeDeletingConfigGroupName);
KWindowConfig::saveWindowSize(windowHandle(), group);
group.writeEntry("Size", size());
}
void ConfirmBeforeDeletingDialog::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(500, 300));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfirmBeforeDeletingConfigGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
}
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
......@@ -9,9 +9,16 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myMarkdownCreateImageDialogGroupName[] = "MarkdownCreateImageDialog";
}
MarkdownCreateImageDialog::MarkdownCreateImageDialog(QWidget *parent)
: QDialog(parent)
......@@ -54,15 +61,15 @@ QString MarkdownCreateImageDialog::linkStr() const
void MarkdownCreateImageDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "MarkdownCreateImageDialog");
group.writeEntry("Size", size());
KConfigGroup group(KSharedConfig::openStateConfig(), myMarkdownCreateImageDialogGroupName);
KWindowConfig::saveWindowSize(windowHandle(), group);
}
void MarkdownCreateImageDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "MarkdownCreateImageDialog");
const QSize sizeDialog = group.readEntry("Size", QSize(300, 200));
if (sizeDialog.isValid()) {
resize(sizeDialog);
}
create(); // ensure a window is created
windowHandle()->resize(QSize(300, 200));
KConfigGroup group(KSharedConfig::openStateConfig(), myMarkdownCreateImageDialogGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
......@@ -9,10 +9,16 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myMarkdownCreateLinkDialogGroupName[] = "MarkdownCreateLinkDialog";
}
MarkdownCreateLinkDialog::MarkdownCreateLinkDialog(QWidget *parent)
: QDialog(parent)
, mMarkdownCreateLinkWidget(new MarkdownCreateLinkWidget(this))
......@@ -55,15 +61,15 @@ QString MarkdownCreateLinkDialog::linkStr() const
void MarkdownCreateLinkDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "MarkdownCreateLinkDialog");
group.writeEntry("Size", size());
KConfigGroup group(KSharedConfig::openStateConfig(), myMarkdownCreateLinkDialogGroupName);
KWindowConfig::saveWindowSize(windowHandle(), group);
}
void MarkdownCreateLinkDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "MarkdownCreateLinkDialog");
const QSize sizeDialog = group.readEntry("Size", QSize(300, 200));
if (sizeDialog.isValid()) {
resize(sizeDialog);
}
create(); // ensure a window is created
windowHandle()->resize(QSize(300, 200));
KConfigGroup group(KSharedConfig::openStateConfig(), myMarkdownCreateLinkDialogGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
......@@ -9,9 +9,15 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myMarkdownPreviewDialogGroupName[] = "MarkdownPreviewDialog";
}
MarkdownPreviewDialog::MarkdownPreviewDialog(QWidget *parent)
: QDialog(parent)
, mPreviewWidget(new MarkdownPreviewWidget(this))
......@@ -39,17 +45,17 @@ MarkdownPreviewDialog::~MarkdownPreviewDialog()
void MarkdownPreviewDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "MarkdownPreviewDialog");
group.writeEntry("Size", size());
KConfigGroup group(KSharedConfig::openStateConfig(), myMarkdownPreviewDialogGroupName);
KWindowConfig::saveWindowSize(windowHandle(), group);
}
void MarkdownPreviewDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "MarkdownPreviewDialog");
const QSize sizeDialog = group.readEntry("Size", QSize(500, 300));
if (sizeDialog.isValid()) {
resize(sizeDialog);
}
create(); // ensure a window is created
windowHandle()->resize(QSize(500, 300));
KConfigGroup group(KSharedConfig::openStateConfig(), myMarkdownPreviewDialogGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void MarkdownPreviewDialog::setText(const QString &str)
......
......@@ -8,8 +8,10 @@
#include "selectmailwidget.h"
#include <KConfigGroup>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
......@@ -56,16 +58,16 @@ void SelectMailDialog::accept()
void SelectMailDialog::readConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myConfigGroupName);
const QSize size = grp.readEntry("Size", QSize(300, 200));
if (size.isValid()) {
resize(size);
}
create(); // ensure a window is created
windowHandle()->resize(QSize(300, 200));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void SelectMailDialog::writeConfig()
{
KConfigGroup grp(KSharedConfig::openStateConfig(), myConfigGroupName);
grp.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), grp);
grp.sync();
}
......@@ -9,10 +9,12 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QCloseEvent>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
......@@ -52,16 +54,16 @@ QuickTextConfigureDialog::~QuickTextConfigureDialog()
void QuickTextConfigureDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
group.writeEntry("Size", size());
KWindowConfig::saveWindowSize(windowHandle(), group);
}
void QuickTextConfigureDialog::readConfig()
{
create(); // ensure a window is created
windowHandle()->resize(QSize(300, 350));
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigGroupName);
const QSize sizeDialog = group.readEntry("Size", QSize(300, 350));
if (sizeDialog.isValid()) {
resize(sizeDialog);
}
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void QuickTextConfigureDialog::slotImport()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment