mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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) {
|
) | rpl::start_with_next([=](Main::Session *session) {
|
||||||
const auto support = session && session->supportMode();
|
const auto support = session && session->supportMode();
|
||||||
Shortcuts::ToggleSupportShortcuts(support);
|
Shortcuts::ToggleSupportShortcuts(support);
|
||||||
Platform::SetApplicationIcon(Window::CreateIcon(session));
|
Platform::SetApplicationIcon(Window::CreateIcon(
|
||||||
|
session,
|
||||||
|
Platform::IsMac()));
|
||||||
}, _lifetime);
|
}, _lifetime);
|
||||||
|
|
||||||
Shortcuts::Requests(
|
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();
|
auto image = Logo();
|
||||||
if (session && session->supportMode()) {
|
if (support) {
|
||||||
ConvertIconToBlack(image);
|
ConvertIconToBlack(image);
|
||||||
}
|
}
|
||||||
return QIcon(Ui::PixmapFromImage(std::move(image)));
|
return QIcon(Ui::PixmapFromImage(std::move(image)));
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon CreateIcon(Main::Session *session) {
|
QIcon CreateIcon(Main::Session *session, bool returnNullIfDefault) {
|
||||||
auto result = CreateOfficialIcon(session);
|
auto result = CreateOfficialIcon(session, returnNullIfDefault);
|
||||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||||
const auto iconFromTheme = QIcon::fromTheme(
|
const auto iconFromTheme = QIcon::fromTheme(
|
||||||
Platform::GetIconName(),
|
Platform::GetIconName(),
|
||||||
|
|
|
@ -38,7 +38,9 @@ struct TermsLock;
|
||||||
|
|
||||||
[[nodiscard]] const QImage &Logo();
|
[[nodiscard]] const QImage &Logo();
|
||||||
[[nodiscard]] const QImage &LogoNoMargin();
|
[[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);
|
void ConvertIconToBlack(QImage &image);
|
||||||
|
|
||||||
struct CounterLayerArgs {
|
struct CounterLayerArgs {
|
||||||
|
|
Loading…
Add table
Reference in a new issue