void NotificationAreaView::updateLayout() { // Remove all banners from the banner layout (do not destroy them) while (bannerPolicy->count() > 0) { bannerPolicy->removeAt(0); } // Add up to the maximum amount of banners to the layout bool removableBannersExist = false; for (int i = 0; (style()->maxBanners() < 0 || i < style()->maxBanners()) && i < model()->banners().count(); i++) { MBanner *banner = model()->banners().at(i); removableBannersExist |= banner->property(WidgetNotificationSink::USER_REMOVABLE_PROPERTY).toBool(); bannerPolicy->addItem(banner); } // If there are more than maximum number of banners to be added show "and more" bool andMoreVisible = style()->maxBanners() >= 0 && model()->banners().count() > style()->maxBanners(); andMore->setStyleName(andMoreVisible ? "AndMoreVisible" : "AndMore"); andMore->setVisible(andMoreVisible); // If removable banners exist make the clear button visible clearButton->setStyleName((removableBannersExist && style()->clearButton()) ? "NotificationAreaClearButtonVisible" : "NotificationAreaClearButton"); }