mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +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 }};
|
||||
menuIconSpoiler: icon {{ "menu/spoiler", 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 }};
|
||||
menuIconTTLAnyTextPosition: point(11px, 22px);
|
||||
|
|
|
@ -46,6 +46,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "api/api_peer_photo.h"
|
||||
#include "styles/style_boxes.h"
|
||||
#include "styles/style_chat.h"
|
||||
#include "styles/style_menu_icons.h"
|
||||
|
||||
namespace Ui {
|
||||
namespace {
|
||||
|
@ -305,7 +306,9 @@ void UserpicButton::choosePhotoLocally() {
|
|||
if (!IsCameraAvailable()) {
|
||||
chooseFile();
|
||||
} 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;
|
||||
if (user && !user->isSelf()) {
|
||||
const auto name = user->firstName.isEmpty()
|
||||
|
@ -313,27 +316,30 @@ void UserpicButton::choosePhotoLocally() {
|
|||
: user->firstName;
|
||||
_menu->addAction(
|
||||
tr::lng_profile_set_photo_for(tr::now, lt_user, name),
|
||||
[=] { chooseFile(); });
|
||||
[=] { chooseFile(); },
|
||||
&st::menuIconPhotoSet);
|
||||
_menu->addAction(
|
||||
tr::lng_profile_suggest_photo(tr::now, lt_user, name),
|
||||
[=] { chooseFile(ChosenType::Suggest); });
|
||||
[=] { chooseFile(ChosenType::Suggest); },
|
||||
&st::menuIconPhotoSuggest);
|
||||
if (user->hasPersonalPhoto()) {
|
||||
_menu->addAction(
|
||||
tr::lng_profile_photo_reset(tr::now),
|
||||
[=] { user->session().api().peerPhoto().clearPersonal(
|
||||
user); _userpicCustom = false; });
|
||||
user); _userpicCustom = false; },
|
||||
&st::menuIconRemove);
|
||||
}
|
||||
} else {
|
||||
_menu->addAction(tr::lng_attach_file(tr::now), [=] {
|
||||
chooseFile();
|
||||
});
|
||||
}, &st::menuIconPhoto);
|
||||
_menu->addAction(tr::lng_attach_camera(tr::now), [=] {
|
||||
_window->show(Box(
|
||||
CameraBox,
|
||||
_window,
|
||||
_peer,
|
||||
callback(ChosenType::Set)));
|
||||
});
|
||||
}, &st::menuIconPhotoSet);
|
||||
}
|
||||
_menu->popup(QCursor::pos());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue