mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-03 18:49:30 +00:00
32 lines
758 B
C++
32 lines
758 B
C++
// This is the source code of AyuGram for Desktop.
|
|
//
|
|
// We do not and cannot prevent the use of our code,
|
|
// but be respectful and credit the original author.
|
|
//
|
|
// Copyright @Radolyn, 2026
|
|
#pragma once
|
|
|
|
#include "ui/rp_widget.h"
|
|
#include "ui/effects/animations.h"
|
|
|
|
class IconPicker : public Ui::RpWidget
|
|
{
|
|
public:
|
|
IconPicker(QWidget *parent);
|
|
~IconPicker() = default;
|
|
|
|
static constexpr int kColumns = 4;
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *e) override;
|
|
void mousePressEvent(QMouseEvent *e) override;
|
|
|
|
private:
|
|
void drawIcon(QPainter &p, const QImage &icon, int x, int y, float strokeOpacity);
|
|
[[nodiscard]] int cellWidth() const;
|
|
|
|
Ui::Animations::Simple _animation;
|
|
QString _wasSelected;
|
|
std::unordered_map<QString, QImage> _cachedIcons;
|
|
};
|