mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added ability to customize shortcut for full screen in media viewer.
This commit is contained in:
parent
bee0534052
commit
6cae088d1f
3 changed files with 20 additions and 3 deletions
|
@ -94,9 +94,10 @@ const auto CommandByName = base::flat_map<QString, Command>{
|
||||||
{ u"read_chat"_q , Command::ReadChat },
|
{ u"read_chat"_q , Command::ReadChat },
|
||||||
|
|
||||||
// Shortcuts that have no default values.
|
// Shortcuts that have no default values.
|
||||||
{ u"message"_q , Command::JustSendMessage },
|
{ u"message"_q , Command::JustSendMessage },
|
||||||
{ u"message_silently"_q , Command::SendSilentMessage },
|
{ u"message_silently"_q , Command::SendSilentMessage },
|
||||||
{ u"message_scheduled"_q , Command::ScheduleMessage },
|
{ u"message_scheduled"_q , Command::ScheduleMessage },
|
||||||
|
{ u"mevia_viewer_video_fullscreen"_q , Command::MediaViewerFullscreen },
|
||||||
//
|
//
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,8 @@ enum class Command {
|
||||||
|
|
||||||
ReadChat,
|
ReadChat,
|
||||||
|
|
||||||
|
MediaViewerFullscreen,
|
||||||
|
|
||||||
SupportReloadTemplates,
|
SupportReloadTemplates,
|
||||||
SupportToggleMuted,
|
SupportToggleMuted,
|
||||||
SupportScrollToCurrent,
|
SupportScrollToCurrent,
|
||||||
|
|
|
@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "core/ui_integration.h"
|
#include "core/ui_integration.h"
|
||||||
#include "core/crash_reports.h"
|
#include "core/crash_reports.h"
|
||||||
#include "core/sandbox.h"
|
#include "core/sandbox.h"
|
||||||
|
#include "core/shortcuts.h"
|
||||||
#include "ui/widgets/popup_menu.h"
|
#include "ui/widgets/popup_menu.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
#include "ui/image/image.h"
|
#include "ui/image/image.h"
|
||||||
|
@ -458,6 +459,19 @@ OverlayWidget::OverlayWidget()
|
||||||
QImage::Format_ARGB32_Premultiplied);
|
QImage::Format_ARGB32_Premultiplied);
|
||||||
_docRectImage.setDevicePixelRatio(cIntRetinaFactor());
|
_docRectImage.setDevicePixelRatio(cIntRetinaFactor());
|
||||||
|
|
||||||
|
Shortcuts::Requests(
|
||||||
|
) | rpl::start_with_next([=](not_null<Shortcuts::Request*> request) {
|
||||||
|
request->check(
|
||||||
|
Shortcuts::Command::MediaViewerFullscreen
|
||||||
|
) && request->handle([=] {
|
||||||
|
if (_streamed) {
|
||||||
|
playbackToggleFullScreen();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}, lifetime());
|
||||||
|
|
||||||
setupWindow();
|
setupWindow();
|
||||||
|
|
||||||
const auto mousePosition = [](not_null<QEvent*> e) {
|
const auto mousePosition = [](not_null<QEvent*> e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue