QLabel allows scaling of the Pixmap by itself, and we have a FixedAspectRatioLabel that scales a pixmap nicely. Use that. (The new label type needed to be introduced to designer) The screenshot should expand more agressively, so that it does not get margins -- that just leave space around the name and description -- when the window expands. Adjust some of the stretching and layout in the UI file.
105 lines
3.0 KiB
XML
105 lines
3.0 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<ui version="4.0">
|
|
<author>
|
|
SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
</author>
|
|
<class>PackageChooserPage</class>
|
|
<widget class="QWidget" name="PackageChooserPage">
|
|
<property name="geometry">
|
|
<rect>
|
|
<x>0</x>
|
|
<y>0</y>
|
|
<width>400</width>
|
|
<height>500</height>
|
|
</rect>
|
|
</property>
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
|
<horstretch>0</horstretch>
|
|
<verstretch>1</verstretch>
|
|
</sizepolicy>
|
|
</property>
|
|
<property name="windowTitle">
|
|
<string>Form</string>
|
|
</property>
|
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
<item>
|
|
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,4">
|
|
<item>
|
|
<widget class="QListView" name="products">
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
|
<horstretch>0</horstretch>
|
|
<verstretch>1</verstretch>
|
|
</sizepolicy>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,30,1">
|
|
<item>
|
|
<widget class="QLabel" name="productName">
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
|
<horstretch>0</horstretch>
|
|
<verstretch>0</verstretch>
|
|
</sizepolicy>
|
|
</property>
|
|
<property name="text">
|
|
<string>Product Name</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="FixedAspectRatioLabel" name="productScreenshot">
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
|
<horstretch>1</horstretch>
|
|
<verstretch>1</verstretch>
|
|
</sizepolicy>
|
|
</property>
|
|
<property name="text">
|
|
<string>TextLabel</string>
|
|
</property>
|
|
<property name="alignment">
|
|
<set>Qt::AlignCenter</set>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QLabel" name="productDescription">
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
|
<horstretch>0</horstretch>
|
|
<verstretch>0</verstretch>
|
|
</sizepolicy>
|
|
</property>
|
|
<property name="text">
|
|
<string>Long Product Description</string>
|
|
</property>
|
|
<property name="wordWrap">
|
|
<bool>true</bool>
|
|
</property>
|
|
<property name="openExternalLinks">
|
|
<bool>true</bool>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
</layout>
|
|
</widget>
|
|
<customwidgets>
|
|
<customwidget>
|
|
<class>FixedAspectRatioLabel</class>
|
|
<extends>QLabel</extends>
|
|
<header>widgets/FixedAspectRatioLabel.h</header>
|
|
</customwidget>
|
|
</customwidgets>
|
|
<resources/>
|
|
<connections/>
|
|
</ui>
|