Commit 4bff2b20 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix EncodingProfilesChooser layout

parent 70b9f512
Pipeline #238731 passed with stage
in 4 minutes and 53 seconds
......@@ -187,9 +187,8 @@ EncodingProfilesChooser::EncodingProfilesChooser(QWidget *parent, EncodingProfil
, m_type(type)
, m_showAutoItem(showAutoItem)
{
QGridLayout *grid = new QGridLayout();
QVBoxLayout *grid = new QVBoxLayout(this);
grid->setContentsMargins(0, 0, 0, 0);
setLayout(grid);
m_profilesCombo = new QComboBox();
if (!configName.isEmpty()) {
m_profilesCombo->setObjectName(QStringLiteral("kcfg_%1").arg(configName));
......@@ -205,15 +204,15 @@ EncodingProfilesChooser::EncodingProfilesChooser(QWidget *parent, EncodingProfil
buttonConfigure->setToolTip(i18n("Show Profile Parameters"));
m_info = new QPlainTextEdit();
m_info->setVisible(false);
m_info->setReadOnly(true);
m_info->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 3);
grid->addWidget(m_profilesCombo, 0, 0);
grid->addWidget(buttonConfigure, 0, 1);
grid->addWidget(buttonInfo, 0, 2);
grid->addWidget(m_info, 1, 0, -1, -1);
m_info->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 4);
QHBoxLayout *hor = new QHBoxLayout(this);
hor->addWidget(m_profilesCombo);
hor->addWidget(buttonConfigure);
hor->addWidget(buttonInfo);
grid->addLayout(hor);
grid->addWidget(m_info);
m_info->setVisible(false);
connect(buttonConfigure, &QAbstractButton::clicked, this, &EncodingProfilesChooser::slotManageEncodingProfile);
connect(buttonInfo, &QAbstractButton::clicked, m_info, &QWidget::setVisible);
connect(m_profilesCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &EncodingProfilesChooser::slotUpdateProfile);
......@@ -224,6 +223,7 @@ EncodingProfilesChooser::EncodingProfilesChooser(QWidget *parent, EncodingProfil
m_profilesCombo->setCurrentIndex(ix);
slotUpdateProfile(ix);
}
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
}
void EncodingProfilesChooser::slotManageEncodingProfile()
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>665</width>
<width>543</width>
<height>278</height>
</rect>
</property>
......
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