Skip to content

Commit

Permalink
Merge pull request #4659 from owncloud/fix_client_4651
Browse files Browse the repository at this point in the history
Fix client #4651
  • Loading branch information
Klaas Freitag committed Apr 13, 2016
2 parents a4f606c + e896d16 commit ed3203d
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
17 changes: 14 additions & 3 deletions src/gui/activitywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ ActivityWidget::ActivityWidget(QWidget *parent) :

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

showLabels();
Expand Down Expand Up @@ -157,7 +159,14 @@ void ActivityWidget::slotAccountActivityStatus(AccountState *ast, int statusCode
}

int accountCount = AccountManager::instance()->accounts().count();
emit hideAcitivityTab(_accountsWithoutActivities.count() == accountCount);

// hide the activity pane in case there are no accounts enabled.
if( _accountsWithoutActivities.count() == accountCount ) {
_ui->_headerLabel->hide();
_ui->_activityList->hide();
}
emit hideAcitivityTab(_accountsWithoutActivities.count() == accountCount
&& _widgetForNotifId.count() == 0 ); // do not hide if there are notifications

showLabels();
}
Expand Down Expand Up @@ -323,6 +332,8 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList& list)
scheduleWidgetToRemove(widgetToGo, 0);
}

emit hideAcitivityTab(false);

_ui->_notifyLabel->setHidden( _widgetForNotifId.isEmpty() );
_ui->_notifyScroll->setHidden( _widgetForNotifId.isEmpty() );

Expand Down
21 changes: 21 additions & 0 deletions src/gui/activitywidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="_notifyLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
Expand All @@ -32,6 +38,9 @@
<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>
Expand All @@ -46,6 +55,12 @@
</item>
<item row="2" column="0">
<widget class="QLabel" name="_headerLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
Expand All @@ -63,6 +78,12 @@
</item>
<item row="4" column="0">
<widget class="QLabel" name="_bottomLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TextLabel</string>
</property>
Expand Down
10 changes: 8 additions & 2 deletions src/gui/notificationwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
Expand Down Expand Up @@ -47,7 +47,7 @@
<item>
<widget class="QLabel" name="_subjectLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
Expand All @@ -59,6 +59,12 @@
</item>
<item>
<widget class="QLabel" name="_messageLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod temporm </string>
</property>
Expand Down

0 comments on commit ed3203d

Please sign in to comment.