2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Refactor icon unread counter painting.

This commit is contained in:
John Preston
2021-11-02 17:10:40 +04:00
parent 87af865604
commit aef45b3a1d
15 changed files with 300 additions and 258 deletions

View File

@@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/timer.h"
#include "base/object_ptr.h"
#include "core/core_settings.h"
#include "base/required.h"
#include <QtWidgets/QSystemTrayIcon>
@@ -35,11 +36,21 @@ class SessionController;
class TitleWidget;
struct TermsLock;
QImage LoadLogo();
QImage LoadLogoNoMargin();
QIcon CreateIcon(Main::Session *session = nullptr);
[[nodiscard]] const QImage &Logo();
[[nodiscard]] const QImage &LogoNoMargin();
[[nodiscard]] QIcon CreateIcon(Main::Session *session = nullptr);
void ConvertIconToBlack(QImage &image);
struct CounterLayerArgs {
base::required<int> size = 16;
base::required<int> count = 1;
base::required<style::color> bg;
base::required<style::color> fg;
};
[[nodiscard]] QImage GenerateCounterLayer(CounterLayerArgs &&args);
[[nodiscard]] QImage WithSmallCounter(QImage image, CounterLayerArgs &&args);
class MainWindow : public Ui::RpWindow {
public:
explicit MainWindow(not_null<Controller*> controller);