Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 4c2d411d authored by Zren (Chris Holland)'s avatar Zren (Chris Holland) Committed by Jean-Baptiste Mardelle

Scale TitleTemplateDialog preview with the window

Removed the spacer below the textbox+preview so that the preview scales vertically.
Set the preview horizontal size policy to MinimumExpanding so it's not fixed to 200px wide.

Differential Revision: https://phabricator.kde.org/D12057
parent 6d846100
......@@ -82,6 +82,12 @@ QString TitleTemplateDialog::selectedText() const
return m_view.description->toPlainText();
}
void TitleTemplateDialog::resizeEvent(QResizeEvent *event)
{
updatePreview();
QWidget::resizeEvent(event);
}
void TitleTemplateDialog::updatePreview()
{
QString textTemplate = m_view.template_list->comboBox()->itemData(m_view.template_list->comboBox()->currentIndex()).toString();
......
......@@ -24,6 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "ui_templateclip_ui.h"
class QResizeEvent;
class TitleTemplateDialog : public QDialog
{
Q_OBJECT
......@@ -33,6 +35,9 @@ public:
QString selectedTemplate() const;
QString selectedText() const;
protected:
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
private:
Ui::TemplateClip_UI m_view;
......
......@@ -39,6 +39,12 @@
</item>
<item row="0" column="1">
<widget class="QLabel" name="preview">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>300</width>
......@@ -54,19 +60,6 @@
</widget>
</item>
<item row="2" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>28</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
......
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