Commit 41821cb5 authored by Laurent Montel's avatar Laurent Montel
Browse files

Fix dialog size

parent 81ae3dc2
Pipeline #240952 passed with stage
in 6 minutes and 45 seconds
......@@ -13,11 +13,16 @@
#include <KConfigGroup>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myInsertHtmlDialogConfigGroupName[] = "InsertHtmlDialog";
}
namespace KPIMTextEdit
{
class InsertHtmlDialogPrivate
......@@ -90,17 +95,17 @@ QString InsertHtmlDialog::html() const
void InsertHtmlDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "InsertHtmlDialog");
const QSize sizeDialog = group.readEntry("Size", QSize(640, 480));
if (sizeDialog.isValid()) {
resize(sizeDialog);
}
create(); // ensure a window is created
windowHandle()->resize(QSize(640, 480));
KConfigGroup group(KSharedConfig::openStateConfig(), myInsertHtmlDialogConfigGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void InsertHtmlDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "InsertHtmlDialog");
group.writeEntry("Size", size());
KConfigGroup group(KSharedConfig::openStateConfig(), myInsertHtmlDialogConfigGroupName);
KWindowConfig::saveWindowSize(windowHandle(), group);
}
}
......
......@@ -9,9 +9,15 @@
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char mySelectSpecialCharDialogConfigGroupName[] = "ConfirmBeforeDeletingDialog";
}
namespace KPIMTextEdit
{
......@@ -107,17 +113,17 @@ void SelectSpecialCharDialog::setOkButtonText(const QString &text)
void SelectSpecialCharDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SelectSpecialCharDialog");
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(), mySelectSpecialCharDialogConfigGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void SelectSpecialCharDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "SelectSpecialCharDialog");
group.writeEntry("Size", size());
KConfigGroup group(KSharedConfig::openStateConfig(), mySelectSpecialCharDialogConfigGroupName);
KWindowConfig::saveWindowSize(windowHandle(), group);
}
}
......
......@@ -10,10 +10,15 @@
#include <KConfigGroup>
#include <KSharedConfig>
#include <KWindowConfig>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWindow>
namespace
{
static const char myTextToSpeechConfigDialogConfigGroupName[] = "TextToSpeechConfigDialog";
}
using namespace KPIMTextEdit;
TextToSpeechConfigDialog::TextToSpeechConfigDialog(QWidget *parent)
......@@ -48,17 +53,17 @@ void TextToSpeechConfigDialog::slotRestoreDefaults()
void TextToSpeechConfigDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "TextToSpeechConfigDialog");
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(), myTextToSpeechConfigDialogConfigGroupName);
KWindowConfig::restoreWindowSize(windowHandle(), group);
resize(windowHandle()->size()); // workaround for QTBUG-40584
}
void TextToSpeechConfigDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "TextToSpeechConfigDialog");
group.writeEntry("Size", size());
KConfigGroup group(KSharedConfig::openStateConfig(), myTextToSpeechConfigDialogConfigGroupName);
KWindowConfig::saveWindowSize(windowHandle(), group);
}
void TextToSpeechConfigDialog::slotAccepted()
......
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