Commit adc675d8 authored by Alexander Semke's avatar Alexander Semke

Fixed broken layout in ImageSettingsDialog.

parent 4fc75e9c
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>649</width>
<height>343</height>
<width>586</width>
<height>352</height>
</rect>
</property>
<property name="windowTitle">
......@@ -67,7 +67,16 @@
</widget>
</item>
<item row="1" column="1" rowspan="2">
<widget class="KImageFilePreview" name="imagePreview"/>
<widget class="QGroupBox" name="gbPreview">
<property name="title">
<string>Preview</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="KImageFilePreview" name="imagePreview"/>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox_2">
......@@ -111,7 +120,7 @@
</layout>
</widget>
</item>
<item row="3" column="0">
<item row="3" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
......
......@@ -29,12 +29,18 @@
ImageSettingsDialog::ImageSettingsDialog(QWidget* parent) : QDialog(parent)
{
QWidget *w = new QWidget(this);
QWidget* w = new QWidget(this);
m_ui.setupUi(w);
QVBoxLayout* vLayout = new QVBoxLayout(this);
vLayout->setSpacing(0);
vLayout->setContentsMargins(0,0,0,0);
vLayout->addWidget(w);
m_ui.buttonBox->button(QDialogButtonBox::Ok)->setIcon(QApplication::style()->standardIcon(QStyle::SP_DialogOkButton));
m_ui.buttonBox->button(QDialogButtonBox::Apply)->setIcon(QApplication::style()->standardIcon(QStyle::SP_DialogApplyButton));
m_ui.buttonBox->button(QDialogButtonBox::Cancel)->setIcon(QApplication::style()->standardIcon(QStyle::SP_DialogCancelButton));
m_ui.openDialogButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_DirOpenIcon));
m_unitNames << i18n("(auto)") << i18n("px") << i18n("%");
......@@ -74,11 +80,6 @@ ImageSettingsDialog::ImageSettingsDialog(QWidget* parent) : QDialog(parent)
connect(m_ui.useDisplaySize, &QCheckBox::stateChanged, this, &ImageSettingsDialog::updatePrintingGroup);
}
ImageSettingsDialog::~ImageSettingsDialog()
{
}
void ImageSettingsDialog::setData(const QString& file, const ImageSize& displaySize, const ImageSize& printSize, bool useDisplaySizeForPrinting)
{
m_ui.pathEdit->setText(file);
......@@ -102,7 +103,6 @@ void ImageSettingsDialog::setData(const QString& file, const ImageSize& displayS
updatePreview();
updatePrintingGroup(useDisplaySizeForPrinting);
//updateInputWidgets();
}
void ImageSettingsDialog::sendChangesAndClose()
......@@ -123,21 +123,19 @@ void ImageSettingsDialog::sendChanges()
printSize.widthUnit = m_ui.printWidthCombo->currentIndex();
printSize.heightUnit = m_ui.printHeightCombo->currentIndex();
emit dataChanged
(m_ui.pathEdit->text(), displaySize, printSize,
(m_ui.useDisplaySize->checkState() == Qt::Checked));
emit dataChanged(m_ui.pathEdit->text(), displaySize, printSize, m_ui.useDisplaySize->isChecked());
}
void ImageSettingsDialog::openDialog()
{
QList<QByteArray> formats = QImageReader::supportedImageFormats();
const QList<QByteArray> formats = QImageReader::supportedImageFormats();
QString formatString = QLatin1String("Images(");
foreach(QByteArray format, formats)
{
formatString += QLatin1String("*.") + QString::fromLatin1(format).toLower() + QLatin1String(" ");
}
formatString += QLatin1String(")");
QString file = QFileDialog::getOpenFileName(this, i18n("Open image file"), m_ui.pathEdit->text(), formatString);
const QString file = QFileDialog::getOpenFileName(this, i18n("Open image file"), m_ui.pathEdit->text(), formatString);
if (!file.isEmpty())
{
m_ui.pathEdit->setText(file);
......@@ -175,7 +173,6 @@ void ImageSettingsDialog::updateInputWidgets()
void ImageSettingsDialog::updatePrintingGroup(int b)
{
m_ui.printWidthCombo->setEnabled(!b);
m_ui.printHeightCombo->setEnabled(!b);
......
......@@ -36,10 +36,9 @@ struct ImageSize
class ImageSettingsDialog : public QDialog
{
Q_OBJECT
Q_OBJECT
public:
ImageSettingsDialog(QWidget* parent);
~ImageSettingsDialog();
void setData(const QString& file, const ImageSize& displaySize, const ImageSize& printSize, bool useDisplaySizeForPrinting);
......
Markdown is supported
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