Skip to content

Commit 2ec642a

Browse files
author
Klaas Freitag
committedApr 11, 2016
ActivityWidget: Properly set widget for the Scrollview.
Also fixed some SizePolicy settings.
1 parent 74a75f6 commit 2ec642a

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed
 

‎src/gui/activitywidget.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ ActivityWidget::ActivityWidget(QWidget *parent) :
7575

7676
// Create a widget container for the notifications. The ui file defines
7777
// a scroll area that get a widget with a layout as children
78-
QWidget *w = new QWidget(this);
79-
_notificationsLayout = new QVBoxLayout(this);
78+
QWidget *w = new QWidget;
79+
_notificationsLayout = new QVBoxLayout;
8080
w->setLayout(_notificationsLayout);
81+
_notificationsLayout->setAlignment(Qt::AlignTop);
82+
_ui->_notifyScroll->setAlignment(Qt::AlignTop);
8183
_ui->_notifyScroll->setWidget(w);
8284

8385
showLabels();

‎src/gui/activitywidget.ui

+21
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
<layout class="QGridLayout" name="gridLayout">
1717
<item row="0" column="0">
1818
<widget class="QLabel" name="_notifyLabel">
19+
<property name="sizePolicy">
20+
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
21+
<horstretch>0</horstretch>
22+
<verstretch>0</verstretch>
23+
</sizepolicy>
24+
</property>
1925
<property name="text">
2026
<string>TextLabel</string>
2127
</property>
@@ -32,6 +38,9 @@
3238
<property name="widgetResizable">
3339
<bool>true</bool>
3440
</property>
41+
<property name="alignment">
42+
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
43+
</property>
3544
<widget class="QWidget" name="_scrollAreaWidgetContents">
3645
<property name="geometry">
3746
<rect>
@@ -46,6 +55,12 @@
4655
</item>
4756
<item row="2" column="0">
4857
<widget class="QLabel" name="_headerLabel">
58+
<property name="sizePolicy">
59+
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
60+
<horstretch>0</horstretch>
61+
<verstretch>0</verstretch>
62+
</sizepolicy>
63+
</property>
4964
<property name="text">
5065
<string>TextLabel</string>
5166
</property>
@@ -63,6 +78,12 @@
6378
</item>
6479
<item row="4" column="0">
6580
<widget class="QLabel" name="_bottomLabel">
81+
<property name="sizePolicy">
82+
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
83+
<horstretch>0</horstretch>
84+
<verstretch>0</verstretch>
85+
</sizepolicy>
86+
</property>
6687
<property name="text">
6788
<string>TextLabel</string>
6889
</property>

‎src/gui/notificationwidget.ui

+8-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
14-
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
14+
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
1515
<horstretch>0</horstretch>
1616
<verstretch>0</verstretch>
1717
</sizepolicy>
@@ -47,7 +47,7 @@
4747
<item>
4848
<widget class="QLabel" name="_subjectLabel">
4949
<property name="sizePolicy">
50-
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
50+
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
5151
<horstretch>0</horstretch>
5252
<verstretch>0</verstretch>
5353
</sizepolicy>
@@ -59,6 +59,12 @@
5959
</item>
6060
<item>
6161
<widget class="QLabel" name="_messageLabel">
62+
<property name="sizePolicy">
63+
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
64+
<horstretch>0</horstretch>
65+
<verstretch>0</verstretch>
66+
</sizepolicy>
67+
</property>
6268
<property name="text">
6369
<string>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod temporm </string>
6470
</property>

0 commit comments

Comments
 (0)
Please sign in to comment.