From 5836e35732b1caa81f254188ca045da418dc9cfc Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Tue, 12 Jan 2016 14:43:06 +0000 Subject: [PATCH 1/4] SVN_SILENT made messages (.desktop file) --- runners/baloo/plasma-runner-baloosearch.desktop | 2 +- xembed-sni-proxy/xembedsniproxy.desktop | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/runners/baloo/plasma-runner-baloosearch.desktop b/runners/baloo/plasma-runner-baloosearch.desktop index b5378241f..ff985788e 100644 --- a/runners/baloo/plasma-runner-baloosearch.desktop +++ b/runners/baloo/plasma-runner-baloosearch.desktop @@ -48,7 +48,7 @@ Comment[ca]=Executor que cerca per fitxers, correus electrònics i contactes Comment[ca@valencia]=Executor que cerca per fitxers, correus electrònics i contactes Comment[cs]=Spouštěč, který prohledává v souborech, emailech a kontaktech Comment[da]=Runner som gennemsøger filer, e-mails og kontakter -Comment[de]=Runner, der Dateiene, E-Mails und Kontakte durchsucht +Comment[de]=Runner, der Dateien, E-Mails und Kontakte durchsucht Comment[el]=Εκτελεστής που εκτελεί αναζήτηση σε αρχεία, μηνύματα ηλ. ταχυδρομείου και επαφές Comment[en_GB]=Runner which searches through files, emails and contacts Comment[es]=Lanzador que busca en archivos, correo electrónico y contactos diff --git a/xembed-sni-proxy/xembedsniproxy.desktop b/xembed-sni-proxy/xembedsniproxy.desktop index a824df586..d468ae719 100644 --- a/xembed-sni-proxy/xembedsniproxy.desktop +++ b/xembed-sni-proxy/xembedsniproxy.desktop @@ -5,6 +5,7 @@ Name[ast]=XembedSniProxy Name[ca]=XembedSniProxy Name[ca@valencia]=XembedSniProxy Name[da]=XembedSniProxy +Name[de]=XembedSniProxy Name[en_GB]=XembedSniProxy Name[es]=XembedSniProxy Name[et]=XembedSniProxy From c1a7d61fbab7620f9f92f25ae82e96b9bf3a589c Mon Sep 17 00:00:00 2001 From: Martin Klapetek Date: Wed, 13 Jan 2016 14:27:50 -0500 Subject: [PATCH 2/4] [notifications] Place the popup directly when it is displayed Now with the geometry being correct right after the popup is being displayed, it can be placed directly to its exact intended position (compared to sliding from default position because the geometry was not known). This should fix any issues left with the popups flying across the screen and removes tons of code as a bonus. REVIEW: 126668 --- .../plugin/notificationshelper.cpp | 72 +++---------------- .../plugin/notificationshelper.h | 2 - 2 files changed, 10 insertions(+), 64 deletions(-) diff --git a/applets/notifications/plugin/notificationshelper.cpp b/applets/notifications/plugin/notificationshelper.cpp index dbc30d60d..a6c0efc53 100644 --- a/applets/notifications/plugin/notificationshelper.cpp +++ b/applets/notifications/plugin/notificationshelper.cpp @@ -55,13 +55,6 @@ void NotificationsHelper::setPopupLocation(PositionOnScreen popupLocation) emit popupLocationChanged(); repositionPopups(); - - // The visible popups are corrected in repositionPopups - // but those that are not on screen need to be corrected - // as well, otherwise they will fly from the old popup location - Q_FOREACH (QQuickWindow *popup, m_availablePopups) { - setDefaultPopupPosition(popup); - } } } @@ -69,9 +62,6 @@ void NotificationsHelper::setPlasmoidScreenGeometry(const QRect &plasmoidScreenG { m_plasmoidScreen = plasmoidScreenGeometry; repositionPopups(); - Q_FOREACH (QQuickWindow *popup, m_availablePopups) { - setDefaultPopupPosition(popup); - } } void NotificationsHelper::addNotificationPopup(QObject *win) @@ -85,50 +75,10 @@ void NotificationsHelper::addNotificationPopup(QObject *win) connect(win, SIGNAL(notificationTimeout()), this, SLOT(onPopupClosed())); - // The popup actual height will get changed after it has been filled - // with data, but we set it initially to small value so it's not too - // big for eg. one line notifications - popup->setHeight(1); - setDefaultPopupPosition(popup); - connect(popup, &QWindow::heightChanged, this, &NotificationsHelper::repositionPopups, Qt::UniqueConnection); - connect(popup, &QWindow::widthChanged, this, &NotificationsHelper::repositionPopups, Qt::UniqueConnection); connect(popup, &QWindow::visibleChanged, this, &NotificationsHelper::onPopupShown, Qt::UniqueConnection); -} - -void NotificationsHelper::setDefaultPopupPosition(QQuickWindow *popup) -{ - m_mutex->lockForWrite(); - if (m_popupLocation == NotificationsHelper::TopLeft - || m_popupLocation == NotificationsHelper::TopCenter - || m_popupLocation == NotificationsHelper::TopRight) { - popup->setY(m_plasmoidScreen.y() + m_offset); - } else { - popup->setY(m_plasmoidScreen.y() + m_plasmoidScreen.height()); - } - - switch (m_popupLocation) { - case TopRight: - case BottomRight: - popup->setX(m_plasmoidScreen.right() - popup->contentItem()->width() - m_offset); - break; - case TopCenter: - case BottomCenter: - popup->setX(m_plasmoidScreen.x() + (m_plasmoidScreen.width() / 2) - (popup->contentItem()->width() / 2)); - break; - case TopLeft: - case BottomLeft: - popup->setX(m_plasmoidScreen.left() + m_offset); - break; - case Left: - case Center: - case Right: - // Fall-through to make the compiler happy - break; - } - - m_mutex->unlock(); + popup->setProperty("initialPositionSet", false); } void NotificationsHelper::onPopupShown() @@ -195,14 +145,11 @@ void NotificationsHelper::processShow() // Set the source name directly on the popup object too // to avoid looking up the notificationProperties map as above popup->setProperty("sourceName", sourceName); - - // Set the height to random small number so that we actually receive - // the signal connected below - popup->setHeight(1); } // Populate the popup with data, this is the component's own QML method QMetaObject::invokeMethod(popup, "populatePopup", Qt::DirectConnection, Q_ARG(QVariant, notificationData)); + QTimer::singleShot(300, popup, &QWindow::show); if (!m_dispatchTimer->isActive()) { @@ -228,11 +175,10 @@ void NotificationsHelper::processHide() m_mutex->unlock(); popup->hide(); - // Shrink the popup again as notifications with lots of text make the popup - // huge but setting short text won't make it smaller - popup->setHeight(1); - // Make sure it flies in from where it's supposed to - setDefaultPopupPosition(popup); + + // Make sure the popup gets placed correctly + // next time it's put on screen + popup->setProperty("initialPositionSet", false); } m_mutex->lockForRead(); @@ -354,18 +300,20 @@ void NotificationsHelper::repositionPopups() || m_popupLocation == NotificationsHelper::TopCenter || m_popupLocation == NotificationsHelper::TopRight) { - if (m_popupsOnScreen[i]->isVisible()) { + if (m_popupsOnScreen[i]->isVisible() && m_popupsOnScreen[i]->property("initialPositionSet").toBool() == true) { //if it's visible, go through setProperty which animates it m_popupsOnScreen[i]->setProperty("y", m_plasmoidScreen.top() + cumulativeHeight); } else { // ...otherwise just set it directly m_popupsOnScreen[i]->setY(m_plasmoidScreen.top() + cumulativeHeight); + m_popupsOnScreen[i]->setProperty("initialPositionSet", true); } } else { - if (m_popupsOnScreen[i]->isVisible()) { + if (m_popupsOnScreen[i]->isVisible() && m_popupsOnScreen[i]->property("initialPositionSet").toBool() == true) { m_popupsOnScreen[i]->setProperty("y", m_plasmoidScreen.bottom() - cumulativeHeight - m_popupsOnScreen[i]->contentItem()->height()); } else { m_popupsOnScreen[i]->setY(m_plasmoidScreen.bottom() - cumulativeHeight - m_popupsOnScreen[i]->contentItem()->height()); + m_popupsOnScreen[i]->setProperty("initialPositionSet", true); } } diff --git a/applets/notifications/plugin/notificationshelper.h b/applets/notifications/plugin/notificationshelper.h index d5c15cccf..49649c403 100644 --- a/applets/notifications/plugin/notificationshelper.h +++ b/applets/notifications/plugin/notificationshelper.h @@ -78,8 +78,6 @@ private Q_SLOTS: private: void repositionPopups(); - int popupYPosition(); - void setDefaultPopupPosition(QQuickWindow *popup); QList m_popupsOnScreen; QList m_availablePopups; From 7079e8c20ac127290b25961b420f634f98a9f5b1 Mon Sep 17 00:00:00 2001 From: Martin Klapetek Date: Wed, 13 Jan 2016 14:31:53 -0500 Subject: [PATCH 3/4] [notifications] Also place the popup directly without animation if y == 0 For some reason I have not yet fully identified, the notification popup can get its y coord reset to 0 on resizing. This is a workaround but fixes an annoying problem. --- .../notifications/plugin/notificationshelper.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/applets/notifications/plugin/notificationshelper.cpp b/applets/notifications/plugin/notificationshelper.cpp index a6c0efc53..d1434b0a6 100644 --- a/applets/notifications/plugin/notificationshelper.cpp +++ b/applets/notifications/plugin/notificationshelper.cpp @@ -300,19 +300,23 @@ void NotificationsHelper::repositionPopups() || m_popupLocation == NotificationsHelper::TopCenter || m_popupLocation == NotificationsHelper::TopRight) { - if (m_popupsOnScreen[i]->isVisible() && m_popupsOnScreen[i]->property("initialPositionSet").toBool() == true) { + int posY = m_plasmoidScreen.top() + cumulativeHeight; + + if (m_popupsOnScreen[i]->isVisible() && m_popupsOnScreen[i]->property("initialPositionSet").toBool() == true && m_popupsOnScreen[i]->y() != 0) { //if it's visible, go through setProperty which animates it - m_popupsOnScreen[i]->setProperty("y", m_plasmoidScreen.top() + cumulativeHeight); + m_popupsOnScreen[i]->setProperty("y", posY); } else { // ...otherwise just set it directly - m_popupsOnScreen[i]->setY(m_plasmoidScreen.top() + cumulativeHeight); + m_popupsOnScreen[i]->setY(posY); m_popupsOnScreen[i]->setProperty("initialPositionSet", true); } } else { - if (m_popupsOnScreen[i]->isVisible() && m_popupsOnScreen[i]->property("initialPositionSet").toBool() == true) { - m_popupsOnScreen[i]->setProperty("y", m_plasmoidScreen.bottom() - cumulativeHeight - m_popupsOnScreen[i]->contentItem()->height()); + int posY = m_plasmoidScreen.bottom() - cumulativeHeight - m_popupsOnScreen[i]->contentItem()->height(); + + if (m_popupsOnScreen[i]->isVisible() && m_popupsOnScreen[i]->property("initialPositionSet").toBool() == true && m_popupsOnScreen[i]->y() != 0) { + m_popupsOnScreen[i]->setProperty("y", posY); } else { - m_popupsOnScreen[i]->setY(m_plasmoidScreen.bottom() - cumulativeHeight - m_popupsOnScreen[i]->contentItem()->height()); + m_popupsOnScreen[i]->setY(posY); m_popupsOnScreen[i]->setProperty("initialPositionSet", true); } } From 4f05c553f07eee25cda8d92ee6a7c298bb5f9860 Mon Sep 17 00:00:00 2001 From: Martin Klapetek Date: Wed, 13 Jan 2016 14:33:42 -0500 Subject: [PATCH 4/4] [notifications] Force the max height of the text item to be 0 when no text Force the whole thing to collapse if the children are invisible. If there is a big notification followed by a small one, the height of the popup does not always shrink back, so this forces it to height = 0 when those are invisible. -1 means "default to implicitHeight" --- .../notifications/package/contents/ui/NotificationItem.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/applets/notifications/package/contents/ui/NotificationItem.qml b/applets/notifications/package/contents/ui/NotificationItem.qml index 34d611c88..f03fd9339 100644 --- a/applets/notifications/package/contents/ui/NotificationItem.qml +++ b/applets/notifications/package/contents/ui/NotificationItem.qml @@ -184,6 +184,12 @@ Item { id: bottomPart Layout.alignment: Qt.AlignTop + // Force the whole thing to collapse if the children are invisible + // If there is a big notification followed by a small one, the height + // of the popup does not always shrink back, so this forces it to + // height=0 when those are invisible. -1 means "default to implicitHeight" + Layout.maximumHeight: textItemLoader.visible || actionsColumn.visible ? -1 : 0 + Loader { id: textItemLoader Layout.fillWidth: true