mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 07:37:11 +02:00
parent
8407b0cccf
commit
07f72c20eb
3 changed files with 14 additions and 6 deletions
|
@ -1180,7 +1180,9 @@ void Application::startShortcuts() {
|
|||
) | rpl::start_with_next([=](Main::Session *session) {
|
||||
const auto support = session && session->supportMode();
|
||||
Shortcuts::ToggleSupportShortcuts(support);
|
||||
Platform::SetApplicationIcon(Window::CreateIcon(session));
|
||||
Platform::SetApplicationIcon(Window::CreateIcon(
|
||||
session,
|
||||
Platform::IsMac()));
|
||||
}, _lifetime);
|
||||
|
||||
Shortcuts::Requests(
|
||||
|
|
|
@ -106,16 +106,20 @@ void ConvertIconToBlack(QImage &image) {
|
|||
}
|
||||
}
|
||||
|
||||
QIcon CreateOfficialIcon(Main::Session *session) {
|
||||
QIcon CreateOfficialIcon(Main::Session *session, bool returnNullIfDefault) {
|
||||
const auto support = (session && session->supportMode());
|
||||
if (!support && returnNullIfDefault) {
|
||||
return QIcon();
|
||||
}
|
||||
auto image = Logo();
|
||||
if (session && session->supportMode()) {
|
||||
if (support) {
|
||||
ConvertIconToBlack(image);
|
||||
}
|
||||
return QIcon(Ui::PixmapFromImage(std::move(image)));
|
||||
}
|
||||
|
||||
QIcon CreateIcon(Main::Session *session) {
|
||||
auto result = CreateOfficialIcon(session);
|
||||
QIcon CreateIcon(Main::Session *session, bool returnNullIfDefault) {
|
||||
auto result = CreateOfficialIcon(session, returnNullIfDefault);
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
const auto iconFromTheme = QIcon::fromTheme(
|
||||
Platform::GetIconName(),
|
||||
|
|
|
@ -38,7 +38,9 @@ struct TermsLock;
|
|||
|
||||
[[nodiscard]] const QImage &Logo();
|
||||
[[nodiscard]] const QImage &LogoNoMargin();
|
||||
[[nodiscard]] QIcon CreateIcon(Main::Session *session = nullptr);
|
||||
[[nodiscard]] QIcon CreateIcon(
|
||||
Main::Session *session = nullptr,
|
||||
bool returnNullIfDefault = false);
|
||||
void ConvertIconToBlack(QImage &image);
|
||||
|
||||
struct CounterLayerArgs {
|
||||
|
|
Loading…
Add table
Reference in a new issue