fix: notification popup window flags

pull/39/head
kate 5 years ago
parent ecd35df91a
commit 704f0e3e1b

@ -5,6 +5,7 @@ set(SRCS main.cpp
notificationsmodel.cpp
notificationserver.cpp
notification.cpp
notificationpopup.cpp
notificationwindow.cpp
historymodel.cpp
settings.cpp

@ -22,6 +22,7 @@
#include "screenhelper.h"
#include "notificationadaptor.h"
#include "historymodel.h"
#include "notificationpopup.h"
#include <QCommandLineParser>
#include <QQmlApplicationEngine>
@ -67,6 +68,7 @@ Application::Application(int& argc, char** argv)
qmlRegisterType<NotificationsModel>("Cutefish.Notification", 1, 0, "NotificationsModel");
qmlRegisterType<HistoryModel>("Cutefish.Notification", 1, 0, "HistoryModel");
qmlRegisterType<ScreenHelper>("Cutefish.Notification", 1, 0, "ScreenHelper");
qmlRegisterType<NotificationPopup>("Cutefish.Notification", 1, 0, "NotificationPopup");
m_instance = true;
}

@ -0,0 +1,43 @@
/*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Kate Leet <kate@cutefishos.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "notificationpopup.h"
#include <QQmlContext>
#include <KWindowSystem>
#include <KWindowEffects>
NotificationPopup::NotificationPopup(QQuickView *parent)
: QQuickView(parent)
{
installEventFilter(this);
setResizeMode(QQuickView::SizeRootObjectToView);
setColor(Qt::transparent);
}
bool NotificationPopup::eventFilter(QObject *object, QEvent *event)
{
if (event->type() == QEvent::Show) {
KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher);
}
return QObject::eventFilter(object, event);
}

@ -0,0 +1,35 @@
/*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Kate Leet <kate@cutefishos.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef NOTIFICATIONPOPUP_H
#define NOTIFICATIONPOPUP_H
#include <QQuickView>
class NotificationPopup : public QQuickView
{
Q_OBJECT
public:
explicit NotificationPopup(QQuickView *parent = nullptr);
bool eventFilter(QObject *object, QEvent *event) override;
};
#endif // NOTIFICATIONPOPUP_H

@ -1,3 +1,22 @@
/*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Kate Leet <kate@cutefishos.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "notificationwindow.h"
#include "notificationsmodel.h"
#include "historymodel.h"

@ -1,3 +1,22 @@
/*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Kate Leet <kate@cutefishos.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef NOTIFICATIONWINDOW_H
#define NOTIFICATIONWINDOW_H

@ -25,9 +25,9 @@ import QtGraphicalEffects 1.0
import FishUI 1.0 as FishUI
import Cutefish.Notification 1.0
Window {
NotificationPopup {
id: control
flags: Qt.WindowDoesNotAcceptFocus | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint | Qt.Popup
flags: Qt.WindowDoesNotAcceptFocus | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint
width: 400
height: 70
color: "transparent"

@ -36,7 +36,7 @@ Item {
property Instantiator popupInstantiator: Instantiator {
model: notificationsModel
delegate: NotificationPopup {}
delegate: QmlNotificationPopup {}
onObjectAdded: {
positionPopups()

@ -1,7 +1,7 @@
<RCC>
<qresource prefix="/">
<file>qml/main.qml</file>
<file>qml/NotificationPopup.qml</file>
<file>qml/QmlNotificationPopup.qml</file>
<file>images/dark/close.svg</file>
<file>images/light/close.svg</file>
<file>qml/NotificationWindow.qml</file>

Loading…
Cancel
Save