summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtProfileWindow.cpp2
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp6
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardWidget.ui178
3 files changed, 96 insertions, 90 deletions
diff --git a/Swift/QtUI/QtProfileWindow.cpp b/Swift/QtUI/QtProfileWindow.cpp
index 71d4281..06d602a 100644
--- a/Swift/QtUI/QtProfileWindow.cpp
+++ b/Swift/QtUI/QtProfileWindow.cpp
@@ -116,7 +116,7 @@ void QtProfileWindow::hide() {
}
QSize QtProfileWindow::sizeHint() const {
- return QWidget::sizeHint() + QSize(0, 15);
+ return QWidget::sizeHint();
}
void QtProfileWindow::updateTitle() {
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp b/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp
index e202de5..79360d8 100644
--- a/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp
+++ b/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp
@@ -84,6 +84,12 @@ QSize QtVCardWidget::sizeHint() const {
newSizeHint = QSize(std::max(newSizeHint.width(), fieldsWidgetSize.width()), newSizeHint.height() + fieldsWidgetSize.height());
+ // add layout margin
+ newSizeHint += QSize(layout()->contentsMargins().left() + layout()->contentsMargins().right(), layout()->contentsMargins().top() + layout()->contentsMargins().bottom());
+
+ // the spaceing before and after the line between the profile header and its fields
+ newSizeHint += QSize(0, layout()->spacing() * 2);
+
return newSizeHint;
}
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardWidget.ui b/Swift/QtUI/QtVCardWidget/QtVCardWidget.ui
index 4fc8605..3a2997b 100644
--- a/Swift/QtUI/QtVCardWidget/QtVCardWidget.ui
+++ b/Swift/QtUI/QtVCardWidget/QtVCardWidget.ui
@@ -6,14 +6,17 @@
<rect>
<x>0</x>
<y>0</y>
- <width>535</width>
- <height>126</height>
+ <width>239</width>
+ <height>102</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
- <layout class="QGridLayout" name="gridLayout" rowstretch="1" columnstretch="1,0">
+ <layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,0,1">
+ <property name="spacing">
+ <number>2</number>
+ </property>
<property name="leftMargin">
<number>5</number>
</property>
@@ -26,102 +29,99 @@
<property name="bottomMargin">
<number>5</number>
</property>
- <item row="0" column="0" colspan="2">
- <layout class="QVBoxLayout" name="card" stretch="0,0,1">
- <property name="spacing">
- <number>2</number>
+ <item>
+ <widget class="Swift::QtVCardPhotoAndNameFields" name="photoAndName" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
- <property name="sizeConstraint">
- <enum>QLayout::SetDefaultConstraint</enum>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
- <item>
- <widget class="Swift::QtVCardPhotoAndNameFields" name="photoAndName" native="true"/>
- </item>
- <item>
- <widget class="Line" name="line">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QScrollArea" name="scrollArea">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
+ </widget>
+ </item>
+ <item>
+ <widget class="QScrollArea" name="scrollArea">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="horizontalScrollBarPolicy">
+ <enum>Qt::ScrollBarAlwaysOff</enum>
+ </property>
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ <widget class="QWidget" name="scrollAreaWidgetContents">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>229</width>
+ <height>77</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" stretch="0,1">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMinAndMaxSize</enum>
</property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
+ <property name="leftMargin">
+ <number>0</number>
</property>
- <property name="horizontalScrollBarPolicy">
- <enum>Qt::ScrollBarAlwaysOff</enum>
+ <property name="topMargin">
+ <number>0</number>
</property>
- <property name="widgetResizable">
- <bool>true</bool>
+ <property name="rightMargin">
+ <number>0</number>
</property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ <property name="bottomMargin">
+ <number>0</number>
</property>
- <widget class="QWidget" name="scrollAreaWidgetContents">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>523</width>
- <height>110</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <property name="sizeConstraint">
- <enum>QLayout::SetMinAndMaxSize</enum>
- </property>
- <property name="leftMargin">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>0</number>
+ <item>
+ <layout class="QGridLayout" name="cardFields"/>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
</property>
- <property name="rightMargin">
- <number>0</number>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
</property>
- <property name="bottomMargin">
- <number>0</number>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
</property>
- <item>
- <layout class="QGridLayout" name="cardFields"/>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Preferred</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>1000</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- </layout>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
</item>
</layout>
</widget>