mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Add icons to the media viewer menus.
This commit is contained in:
@@ -37,6 +37,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "styles/style_dialogs.h"
|
||||
#include "styles/style_layers.h"
|
||||
#include "styles/style_boxes.h"
|
||||
#include "styles/style_menu_icons.h"
|
||||
|
||||
namespace Window {
|
||||
namespace Theme {
|
||||
@@ -703,7 +704,9 @@ void Editor::showMenu() {
|
||||
if (_menu) {
|
||||
return;
|
||||
}
|
||||
_menu = base::make_unique_q<Ui::DropdownMenu>(this);
|
||||
_menu = base::make_unique_q<Ui::DropdownMenu>(
|
||||
this,
|
||||
st::dropdownMenuWithIcons);
|
||||
_menu->setHiddenCallback([weak = Ui::MakeWeak(this), menu = _menu.get()]{
|
||||
menu->deleteLater();
|
||||
if (weak && weak->_menu == menu) {
|
||||
@@ -727,15 +730,15 @@ void Editor::showMenu() {
|
||||
base::call_delayed(st::defaultRippleAnimation.hideDuration, this, [=] {
|
||||
exportTheme();
|
||||
});
|
||||
});
|
||||
}, &st::menuIconExportTheme);
|
||||
_menu->addAction(tr::lng_theme_editor_menu_import(tr::now), [=] {
|
||||
base::call_delayed(st::defaultRippleAnimation.hideDuration, this, [=] {
|
||||
importTheme();
|
||||
});
|
||||
});
|
||||
}, &st::menuIconImportTheme);
|
||||
_menu->addAction(tr::lng_theme_editor_menu_show(tr::now), [=] {
|
||||
File::ShowInFolder(EditingPalettePath());
|
||||
});
|
||||
}, &st::menuIconPalette);
|
||||
_menu->moveToRight(st::themesMenuPosition.x(), st::themesMenuPosition.y());
|
||||
_menu->showAnimated(Ui::PanelAnimation::Origin::TopRight);
|
||||
}
|
||||
|
@@ -113,7 +113,9 @@ void ShowCallsBox(not_null<Window::SessionController*> window) {
|
||||
const auto menu = std::make_shared<MenuPointer>();
|
||||
const auto menuButton = box->addTopButton(st::infoTopBarMenu);
|
||||
menuButton->setClickedCallback([=] {
|
||||
*menu = base::make_unique_q<Ui::PopupMenu>(menuButton);
|
||||
*menu = base::make_unique_q<Ui::PopupMenu>(
|
||||
menuButton,
|
||||
st::popupMenuWithIcons);
|
||||
const auto showSettings = [=] {
|
||||
window->showSettings(
|
||||
Settings::Type::Calls,
|
||||
@@ -124,11 +126,13 @@ void ShowCallsBox(not_null<Window::SessionController*> window) {
|
||||
});
|
||||
(*menu)->addAction(
|
||||
tr::lng_settings_section_call_settings(tr::now),
|
||||
showSettings);
|
||||
showSettings,
|
||||
&st::menuIconSettings);
|
||||
if (controller->delegate()->peerListFullRowsCount() > 0) {
|
||||
(*menu)->addAction(
|
||||
tr::lng_call_box_clear_all(tr::now),
|
||||
clearAll);
|
||||
clearAll,
|
||||
&st::menuIconDelete);
|
||||
}
|
||||
(*menu)->popup(QCursor::pos());
|
||||
return true;
|
||||
|
@@ -346,7 +346,7 @@ void Filler::addTogglePin() {
|
||||
pinToggle,
|
||||
(history->isPinnedDialog(filterId)
|
||||
? &st::menuIconUnpin
|
||||
: &st::menuIconPin)); // #TODO icons dynamic
|
||||
: &st::menuIconPin));
|
||||
|
||||
auto actionText = history->session().changes().historyUpdates(
|
||||
history,
|
||||
@@ -395,7 +395,7 @@ void Filler::addToggleUnreadMark() {
|
||||
}
|
||||
}, (IsUnreadHistory(history)
|
||||
? &st::menuIconMarkRead
|
||||
: &st::menuIconMarkUnread)); // #TODO icons dynamic
|
||||
: &st::menuIconMarkUnread));
|
||||
|
||||
auto actionText = history->session().changes().historyUpdates(
|
||||
history,
|
||||
@@ -420,7 +420,7 @@ void Filler::addToggleArchive() {
|
||||
};
|
||||
const auto archiveAction = _addAction(
|
||||
label(),
|
||||
toggle, // #TODO icons dynamic
|
||||
toggle,
|
||||
isArchived() ? &st::menuIconUnarchive : &st::menuIconArchive);
|
||||
|
||||
auto actionText = history->session().changes().historyUpdates(
|
||||
@@ -453,7 +453,7 @@ void Filler::addBlockUser(not_null<UserData*> user) {
|
||||
user,
|
||||
v::null,
|
||||
v::null));
|
||||
} // #TODO icons dynamic
|
||||
}
|
||||
}, (!user->isBlocked()
|
||||
? &st::menuIconBlock
|
||||
: user->isBot()
|
||||
@@ -1255,7 +1255,7 @@ void PeerMenuAddMuteAction(
|
||||
}
|
||||
}, (peer->owner().notifyIsMuted(peer)
|
||||
? &st::menuIconUnmute
|
||||
: &st::menuIconMute)); // #TODO icons dynamic
|
||||
: &st::menuIconMute));
|
||||
|
||||
auto actionText = Info::Profile::NotificationsEnabledValue(
|
||||
peer
|
||||
|
Reference in New Issue
Block a user