mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Add icons to the photo set/suggest menu.
This commit is contained in:
parent
2ce8094932
commit
b0a24238e8
8 changed files with 14 additions and 6 deletions
BIN
Telegram/Resources/icons/menu/photo_set.png
Normal file
BIN
Telegram/Resources/icons/menu/photo_set.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 722 B |
BIN
Telegram/Resources/icons/menu/photo_set@2x.png
Normal file
BIN
Telegram/Resources/icons/menu/photo_set@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
Telegram/Resources/icons/menu/photo_set@3x.png
Normal file
BIN
Telegram/Resources/icons/menu/photo_set@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
BIN
Telegram/Resources/icons/menu/photo_suggest.png
Normal file
BIN
Telegram/Resources/icons/menu/photo_suggest.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 768 B |
BIN
Telegram/Resources/icons/menu/photo_suggest@2x.png
Normal file
BIN
Telegram/Resources/icons/menu/photo_suggest@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
Telegram/Resources/icons/menu/photo_suggest@3x.png
Normal file
BIN
Telegram/Resources/icons/menu/photo_suggest@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
|
@ -96,6 +96,8 @@ menuIconTranslate: icon {{ "menu/translate", menuIconColor }};
|
||||||
menuIconReportAntiSpam: icon {{ "menu/false_positive", menuIconColor }};
|
menuIconReportAntiSpam: icon {{ "menu/false_positive", menuIconColor }};
|
||||||
menuIconSpoiler: icon {{ "menu/spoiler", menuIconColor }};
|
menuIconSpoiler: icon {{ "menu/spoiler", menuIconColor }};
|
||||||
menuIconDisable: icon {{ "menu/disable", menuIconColor }};
|
menuIconDisable: icon {{ "menu/disable", menuIconColor }};
|
||||||
|
menuIconPhotoSet: icon {{ "menu/photo_set", menuIconColor }};
|
||||||
|
menuIconPhotoSuggest: icon {{ "menu/photo_suggest", menuIconColor }};
|
||||||
|
|
||||||
menuIconTTLAny: icon {{ "menu/auto_delete_plain", menuIconColor }};
|
menuIconTTLAny: icon {{ "menu/auto_delete_plain", menuIconColor }};
|
||||||
menuIconTTLAnyTextPosition: point(11px, 22px);
|
menuIconTTLAnyTextPosition: point(11px, 22px);
|
||||||
|
|
|
@ -46,6 +46,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "api/api_peer_photo.h"
|
#include "api/api_peer_photo.h"
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
|
#include "styles/style_menu_icons.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -305,7 +306,9 @@ void UserpicButton::choosePhotoLocally() {
|
||||||
if (!IsCameraAvailable()) {
|
if (!IsCameraAvailable()) {
|
||||||
chooseFile();
|
chooseFile();
|
||||||
} else {
|
} else {
|
||||||
_menu = base::make_unique_q<Ui::PopupMenu>(this);
|
_menu = base::make_unique_q<Ui::PopupMenu>(
|
||||||
|
this,
|
||||||
|
st::popupMenuWithIcons);
|
||||||
const auto user = _peer ? _peer->asUser() : nullptr;
|
const auto user = _peer ? _peer->asUser() : nullptr;
|
||||||
if (user && !user->isSelf()) {
|
if (user && !user->isSelf()) {
|
||||||
const auto name = user->firstName.isEmpty()
|
const auto name = user->firstName.isEmpty()
|
||||||
|
@ -313,27 +316,30 @@ void UserpicButton::choosePhotoLocally() {
|
||||||
: user->firstName;
|
: user->firstName;
|
||||||
_menu->addAction(
|
_menu->addAction(
|
||||||
tr::lng_profile_set_photo_for(tr::now, lt_user, name),
|
tr::lng_profile_set_photo_for(tr::now, lt_user, name),
|
||||||
[=] { chooseFile(); });
|
[=] { chooseFile(); },
|
||||||
|
&st::menuIconPhotoSet);
|
||||||
_menu->addAction(
|
_menu->addAction(
|
||||||
tr::lng_profile_suggest_photo(tr::now, lt_user, name),
|
tr::lng_profile_suggest_photo(tr::now, lt_user, name),
|
||||||
[=] { chooseFile(ChosenType::Suggest); });
|
[=] { chooseFile(ChosenType::Suggest); },
|
||||||
|
&st::menuIconPhotoSuggest);
|
||||||
if (user->hasPersonalPhoto()) {
|
if (user->hasPersonalPhoto()) {
|
||||||
_menu->addAction(
|
_menu->addAction(
|
||||||
tr::lng_profile_photo_reset(tr::now),
|
tr::lng_profile_photo_reset(tr::now),
|
||||||
[=] { user->session().api().peerPhoto().clearPersonal(
|
[=] { user->session().api().peerPhoto().clearPersonal(
|
||||||
user); _userpicCustom = false; });
|
user); _userpicCustom = false; },
|
||||||
|
&st::menuIconRemove);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_menu->addAction(tr::lng_attach_file(tr::now), [=] {
|
_menu->addAction(tr::lng_attach_file(tr::now), [=] {
|
||||||
chooseFile();
|
chooseFile();
|
||||||
});
|
}, &st::menuIconPhoto);
|
||||||
_menu->addAction(tr::lng_attach_camera(tr::now), [=] {
|
_menu->addAction(tr::lng_attach_camera(tr::now), [=] {
|
||||||
_window->show(Box(
|
_window->show(Box(
|
||||||
CameraBox,
|
CameraBox,
|
||||||
_window,
|
_window,
|
||||||
_peer,
|
_peer,
|
||||||
callback(ChosenType::Set)));
|
callback(ChosenType::Set)));
|
||||||
});
|
}, &st::menuIconPhotoSet);
|
||||||
}
|
}
|
||||||
_menu->popup(QCursor::pos());
|
_menu->popup(QCursor::pos());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue