ZaStoGram_desktop/Telegram/SourceFiles/tgw/tgw_theme.h
John Preston d44f7624a9 Give widgets their bubble's palette, button and text style
Task: 2026/10/21/give-widgets-the-chat-palette-and-button-style
2026-11-05 17:12:54 +04:00

40 lines
938 B
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
namespace twidget {
struct WidgetTheme;
} // namespace twidget
namespace Ui {
class ChatStyle;
struct ChatPaintContext;
} // namespace Ui
namespace Tgw {
struct ThemeKey {
const Ui::ChatStyle *style = nullptr;
QRgb bubble = 0;
QRgb under = 0;
int paletteVersion = 0;
bool outbg = false;
friend inline bool operator==(
const ThemeKey &,
const ThemeKey &) = default;
};
[[nodiscard]] ThemeKey BubbleThemeKey(const Ui::ChatPaintContext &context);
[[nodiscard]] std::shared_ptr<const twidget::WidgetTheme> BubbleTheme(
const Ui::ChatPaintContext &context);
[[nodiscard]] bool SameTheme(
const twidget::WidgetTheme &a,
const twidget::WidgetTheme &b);
} // namespace Tgw