This fixes two minor inconveniences: - When closing the chat window and re-showing it from the systray icon, the geometry was not properly restored. The window was always shown in the middle of the screen. Now, one gets the window back with it's actual last position and size. - It is now possible to not only show the window from the systray icon, but also to close it. This is the way other chat programs do it (Kopete back in the day, Konversation, Quassel IRC etc.)
37 lines
693 B
C++
37 lines
693 B
C++
// SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleixpol@kde.org>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <KStatusNotifierItem>
|
|
|
|
/**
|
|
* @class TrayIcon
|
|
*
|
|
* A class inheriting KStatusNotifierItem to provide a tray icon.
|
|
*
|
|
* @sa KStatusNotifierItem
|
|
*/
|
|
class TrayIcon : public KStatusNotifierItem
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit TrayIcon(QObject *parent = nullptr);
|
|
|
|
/**
|
|
* @brief Show the tray icon.
|
|
*/
|
|
void show();
|
|
|
|
/**
|
|
* @brief Hide the tray icon.
|
|
*/
|
|
void hide();
|
|
|
|
Q_SIGNALS:
|
|
/**
|
|
* @brief Triggered when the system tray icon is clicked to request NeoChat be shown or hidden.
|
|
*/
|
|
void toggleWindow();
|
|
};
|