mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-03 07:56:03 +00:00
Allow arbitrary QImage as outgoing bubbles background.
This commit is contained in:
@@ -26,6 +26,10 @@ namespace Adaptive {
|
||||
enum class WindowLayout;
|
||||
} // namespace Adaptive
|
||||
|
||||
namespace HistoryView {
|
||||
struct PaintContext;
|
||||
} // namespace HistoryView
|
||||
|
||||
namespace ChatHelpers {
|
||||
class TabbedSelector;
|
||||
} // namespace ChatHelpers
|
||||
@@ -46,6 +50,7 @@ class FormController;
|
||||
namespace Ui {
|
||||
class LayerWidget;
|
||||
enum class ReportReason;
|
||||
struct BubblePattern;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Window {
|
||||
@@ -439,6 +444,20 @@ public:
|
||||
void toggleFiltersMenu(bool enabled);
|
||||
[[nodiscard]] rpl::producer<> filtersMenuChanged() const;
|
||||
|
||||
void setBubblesBackground(QImage image);
|
||||
const Ui::BubblePattern *bubblesBackgroundPattern() const {
|
||||
return _bubblesBackgroundPattern.get();
|
||||
}
|
||||
|
||||
struct BubblesContextArgs {
|
||||
int visibleAreaTop = 0;
|
||||
int visibleAreaTopGlobal = 0;
|
||||
int visibleAreaWidth = 0;
|
||||
QRect clip;
|
||||
int initialShift = 0;
|
||||
};
|
||||
[[nodiscard]] HistoryView::PaintContext bubblesContext(
|
||||
BubblesContextArgs &&args);
|
||||
[[nodiscard]] const BackgroundState &backgroundState(QSize area);
|
||||
[[nodiscard]] rpl::producer<> repaintBackgroundRequests() const;
|
||||
void rotateComplexGradientBackground();
|
||||
@@ -520,6 +539,10 @@ private:
|
||||
QSize _willCacheForArea;
|
||||
crl::time _lastAreaChangeTime = 0;
|
||||
base::Timer _cacheBackgroundTimer;
|
||||
CachedBackground _bubblesBackground;
|
||||
QImage _bubblesBackgroundPrepared;
|
||||
std::unique_ptr<Ui::BubblePattern> _bubblesBackgroundPattern;
|
||||
|
||||
rpl::event_stream<> _repaintBackgroundRequests;
|
||||
|
||||
rpl::lifetime _lifetime;
|
||||
|
Reference in New Issue
Block a user