From 2ec642aadb8a40e848e00e6a1f5d9b6591e42666 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 11 Apr 2016 15:38:25 +0200 Subject: [PATCH 1/2] ActivityWidget: Properly set widget for the Scrollview. Also fixed some SizePolicy settings. --- src/gui/activitywidget.cpp | 6 ++++-- src/gui/activitywidget.ui | 21 +++++++++++++++++++++ src/gui/notificationwidget.ui | 10 ++++++++-- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/gui/activitywidget.cpp b/src/gui/activitywidget.cpp index a15c2f7895f..e0459d6ea76 100644 --- a/src/gui/activitywidget.cpp +++ b/src/gui/activitywidget.cpp @@ -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(); diff --git a/src/gui/activitywidget.ui b/src/gui/activitywidget.ui index fefd7b3ae6b..79d9a963bc2 100644 --- a/src/gui/activitywidget.ui +++ b/src/gui/activitywidget.ui @@ -16,6 +16,12 @@ + + + 0 + 0 + + TextLabel @@ -32,6 +38,9 @@ true + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + @@ -46,6 +55,12 @@ + + + 0 + 0 + + TextLabel @@ -63,6 +78,12 @@ + + + 0 + 0 + + TextLabel diff --git a/src/gui/notificationwidget.ui b/src/gui/notificationwidget.ui index 099d11cac09..7f34baab5ec 100644 --- a/src/gui/notificationwidget.ui +++ b/src/gui/notificationwidget.ui @@ -11,7 +11,7 @@ - + 0 0 @@ -47,7 +47,7 @@ - + 0 0 @@ -59,6 +59,12 @@ + + + 0 + 0 + + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod temporm From e896d16f324c369e0e769f98c06a014be54ed787 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 11 Apr 2016 15:39:25 +0200 Subject: [PATCH 2/2] ActivityWidget: Make sure Notification are visible if Activity disabled This is the fix for #4651 --- src/gui/activitywidget.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/activitywidget.cpp b/src/gui/activitywidget.cpp index e0459d6ea76..ac1225686c6 100644 --- a/src/gui/activitywidget.cpp +++ b/src/gui/activitywidget.cpp @@ -159,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(); } @@ -323,6 +330,8 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList& list) scheduleWidgetToRemove(widgetToGo, 0); } + emit hideAcitivityTab(false); + _ui->_notifyLabel->setHidden( _widgetForNotifId.isEmpty() ); _ui->_notifyScroll->setHidden( _widgetForNotifId.isEmpty() );