Compare commits

...

90 Commits

Author SHA1 Message Date
John Preston
e206f42e4e Beta version 3.7.4: Update tg_owt in snap. 2022-05-04 12:34:22 +04:00
John Preston
3f60410190 Beta version 3.7.4: Fix build with GCC in Release. 2022-05-04 11:49:11 +04:00
John Preston
3cdd8558db Beta version 3.7.4: Fix build with GCC. 2022-05-04 11:42:54 +04:00
John Preston
f2b89445ae Allow playing single lottie icon repeatedly or once. 2022-05-04 11:39:53 +04:00
23rd
3ff4bf77e7 Removed repeated animation from some settings lottie icons. 2022-05-04 07:32:52 +03:00
John Preston
d16ccf0d9e Beta version 3.7.4: Fix build with Xcode. 2022-05-03 23:33:41 +04:00
John Preston
fc7d9b264f Add webview-debug-enabled option. 2022-05-03 23:30:54 +04:00
John Preston
b28d5a63d1 Handle alert/confirm/prompt with custom dialog on Linux. 2022-05-03 23:30:42 +04:00
John Preston
043ba4ff04 Handle alert/confirm/prompt with custom dialog on macOS. 2022-05-03 23:30:21 +04:00
John Preston
d6c3bf4168 Use EdgeChromium by default on Windows. 2022-05-03 23:29:04 +04:00
John Preston
7bf7a8feff Beta version 3.7.4.
- Improve some more sections design.
- Update the OpenAL library to 1.22.0.
2022-05-03 23:09:26 +04:00
John Preston
3413ad1d22 Add some more icons for folders. 2022-05-03 23:09:26 +04:00
John Preston
84af084a3b Update tg_owt to WebRTC M101. 2022-05-03 23:09:26 +04:00
23rd
cd50008429 Moved plus icon to settings style file. 2022-05-03 21:59:38 +03:00
23rd
767459ab57 Slightly improved style of button in settings of blocked peers. 2022-05-03 21:59:38 +03:00
23rd
3b45a120e6 Slightly improved style of buttons and icons in Folders settings. 2022-05-03 21:59:38 +03:00
23rd
b04aaba8d0 Slightly improved style of box for edit folder. 2022-05-03 21:59:38 +03:00
23rd
bfa3655c7b Removed unused code of box for filters choosing. 2022-05-03 21:59:38 +03:00
CrisMystik
8642eb23a7 Removed unneeded part of code 2022-05-03 16:35:54 +04:00
CrisMystik
ef8ecc546b Use ::Settings::Main::Id() as fallback 2022-05-03 16:35:54 +04:00
CrisMystik
fafbbb4996 Suggested code improvements 2022-05-03 16:35:54 +04:00
CrisMystik
3a021f4e49 Make type variable const 2022-05-03 16:35:54 +04:00
CrisMystik
2788c19c85 Add some missing includes 2022-05-03 16:35:54 +04:00
CrisMystik
300cc3dbca Support all Settings links 2022-05-03 16:35:54 +04:00
GitHub Action
62516e264d Update User-Agent for DNS to Chrome 100.0.4896.127. 2022-05-03 16:24:54 +04:00
John Preston
8b89cfc4cb Fix custom notification sounds for all chats. 2022-05-03 16:23:39 +04:00
Ilya Fedin
e3f65d2346 Convet font point size to pixel size more like Qt does in the crash reporter 2022-05-03 15:16:20 +04:00
Andrew Krasavin
2b383a4236 Explicitly specify QVector element type to fix build with clang13+rangev3+qt6
More info:
https://github.com/telegramdesktop/tdesktop/issues/24385
https://github.com/telegramdesktop/tdesktop/issues/24014
https://github.com/ericniebler/range-v3/issues/1691
2022-05-03 15:15:20 +04:00
John Preston
a8426bd6da Update submodules. 2022-05-03 14:58:13 +04:00
John Preston
39a02e649d Fix crash on invalid data in local cache. 2022-05-03 14:52:08 +04:00
John Preston
276fe2169a Use SeparatePanel / ShowMultilineToast from lib_ui. 2022-05-03 14:52:08 +04:00
23rd
8fae56bee8 Improved style of Folders settings. 2022-05-03 04:25:36 +03:00
23rd
0e16a50bbc Completely removed common and platform code for tray from main window. 2022-05-03 04:25:36 +03:00
23rd
9de372d715 Replaced macOS Qt tray with native implementation. 2022-05-03 04:25:36 +03:00
23rd
fbae5bdbcf Removed macOS tray implementation from main window. 2022-05-03 04:25:36 +03:00
23rd
aee1ef78da Moved out static job for Linux tray icon to separated class. 2022-05-03 04:25:36 +03:00
23rd
27c5c4b8f2 Removed Linux tray implementation from main window. 2022-05-03 04:25:36 +03:00
23rd
94e06c6846 Removed Windows tray implementation from main window. 2022-05-03 04:25:36 +03:00
23rd
7948d971e8 Added initial implementation of Linux tray. 2022-05-03 04:25:36 +03:00
23rd
70acc7a0e3 Added initial implementation of Windows tray. 2022-05-03 04:25:36 +03:00
23rd
56fdc7d39a Added common and macOS tray implementations. 2022-05-03 04:25:36 +03:00
23rd
f67c3bbf65 Added placeholders for platform dependent implementations of tray. 2022-05-03 04:25:35 +03:00
23rd
de194c4aa2 Initialized empty files for tray implementations. 2022-05-03 04:25:35 +03:00
23rd
511805199f Added ability to check are windows active for tray menu. 2022-05-03 04:25:35 +03:00
23rd
aa241a1f62 Removed duplicated icons. 2022-05-03 04:25:35 +03:00
23rd
4125a45503 Slightly improved format of mute time in menu. 2022-05-03 04:25:35 +03:00
23rd
1349989494 Moved settings of blocked peers to section. 2022-05-03 04:25:35 +03:00
23rd
639ed8b973 Added ability to append pinned to top content to settings sections. 2022-05-02 22:31:05 +03:00
23rd
2f5db08c9b Fixed double scroll in reactions settings when height is small. 2022-05-02 22:31:05 +03:00
Ilya Fedin
4c6814def6 Replace style sheet in PreLaunchInput 2022-05-02 16:01:36 +04:00
Ilya Fedin
387914be31 Replace style sheet in Editor::Paint 2022-05-02 16:01:36 +04:00
Ilya Fedin
2f2003c89b Fix media viewer on Unity
This could be a regression for tiling WMs, though...
2022-05-02 16:00:56 +04:00
Ilya Fedin
48589b721d Update openal to 1.22.0 2022-05-02 15:33:56 +04:00
23rd
3bdf1634a9 Added ability to copy phone number from main menu. 2022-04-28 17:41:34 +03:00
23rd
1878061c9a Fixed color of attention menu items for account buttons. 2022-04-28 17:16:58 +03:00
23rd
774c3b5ba0 Fixed tab order in EditNameBox. 2022-04-28 17:10:13 +03:00
23rd
a64b8d4181 Slightly improved style of section for group stickers. 2022-04-28 16:27:39 +03:00
23rd
e3e380124d Removed ttl menu from inaccessible groups and channels. 2022-04-28 15:13:58 +03:00
John Preston
823fc25fa8 Fix layer height updating in poll results. 2022-04-27 15:20:19 +04:00
23rd
4062912a98 Added missed icon for join requests in manage of groups / channels. 2022-04-26 22:16:41 +04:00
23rd
62b5192f24 Added missed icon for channel type in manage of channels. 2022-04-26 22:16:39 +04:00
23rd
058717532a Replaced title static reaction icon in manage of groups / channels. 2022-04-26 22:16:38 +04:00
Sergey A. Osokin
d117a72e6e Fix -Wunused-const-variable warnings by removing unused variables
Fixes #24432
2022-04-26 21:25:05 +04:00
Sergey A. Osokin
3ba5b825e5 Fix -Wunused-const-variable warnings by removing unused variables
Fixes #24432
2022-04-26 21:25:05 +04:00
John Preston
075ab20e5b Version 3.7.3: Don't copy text from a restricted post. 2022-04-26 14:13:16 +04:00
John Preston
deeea0aaed Version 3.7.3: Update lib_webview. 2022-04-26 13:06:42 +04:00
John Preston
8113117cc4 Version 3.7.3.
- Fix a crash in the pinned bar bot button refresh.
2022-04-26 10:38:58 +04:00
John Preston
7bfe096f3b Fix possible crashes in pinned bar button. 2022-04-26 10:24:36 +04:00
John Preston
c37b08ac8b Version 3.7.2.
- Fix mute period selector values.
- Fix a crash in repeated context menu item selection.
- Fix context menu item selection of systems without a compositor.
2022-04-25 22:38:29 +04:00
Hugo Osvaldo Barrera
c52a5927e5 Avoid a second query for the current color-scheme
Telegram listens for a signal that indicates when the color-scheme
changes. The signal itself includes the new value, but Telegram
currently queries for the value immediately after getting the signal.
This second round-trip is unnecessary, since the signal itself contains
the same information.

This changeset avoids this follow-up query, and drops the now-unused
`Setter`.
2022-04-25 22:38:08 +04:00
23rd
edcfac8da3 Slightly improved display of media replacement in admin log. 2022-04-25 22:35:02 +04:00
23rd
a994c9f017 Moved EditPeerHistoryVisibilityBox to td_ui. 2022-04-25 22:35:02 +04:00
23rd
66e6bf8217 Replaced EditPeerHistoryVisibilityBox with generic box. 2022-04-25 22:35:02 +04:00
23rd
4a4cc766c2 Replaced icons in manage group / channel. 2022-04-25 22:35:02 +04:00
23rd
31cd841b75 Added bot button to bar of pinned messages. 2022-04-25 22:35:02 +04:00
23rd
1710890886 Added ability to change width between pinned bar animation entries. 2022-04-25 22:35:02 +04:00
23rd
16f616c5e0 Added ability to set content to bar of pinned messages later. 2022-04-25 22:35:02 +04:00
23rd
7600c9bb2f Added fade animation to right button in bar of pinned messages. 2022-04-25 22:35:02 +04:00
23rd
100a44daef Removed unused includes from MultiSelect. 2022-04-25 22:35:02 +04:00
23rd
54305fafde Removed forced context menu in profiles for muted peers. 2022-04-25 22:35:02 +04:00
23rd
d172d3d7db Fixed intervals of seconds in PickMuteBox. 2022-04-25 22:35:02 +04:00
Ilya Fedin
cee593c423 Check whether notification image has alpha channel 2022-04-25 22:33:22 +04:00
John Preston
43adbb1cb1 Revert some changes in Menu actions triggering. 2022-04-25 15:54:32 +04:00
John Preston
e96731be11 Fix popup menu callbacks on systems without compositing. 2022-04-25 15:42:42 +04:00
John Preston
6ea062462f Fix crash in Ui::Menu second action trigger event. 2022-04-25 14:03:57 +04:00
John Preston
1bc8d6fb18 Fix non-working Qt-on-Windows bug workaround. 2022-04-25 14:03:43 +04:00
John Preston
73d00a4caf Reload stale video chat on join. 2022-04-25 13:41:24 +04:00
John Preston
a23561c380 Reload stale video chats on group / channel open. 2022-04-25 12:50:58 +04:00
Ilya Fedin
bb75a6a31b Speed up submodule checkout in Dockerfile
Use --depth=1 for submodules, too.
This also replaces perl init-repository for Qt as the only thing it does is fetches submodules, but there's no way to specify --depth=1 with it.
2022-04-24 07:26:20 +04:00
John Preston
ce79c1f0c4 Handle "web_app_request_theme" event in WebView. 2022-04-21 10:47:21 +04:00
198 changed files with 3180 additions and 2517 deletions

View File

@@ -188,8 +188,6 @@ PRIVATE
boxes/peers/edit_peer_invite_link.h
boxes/peers/edit_peer_invite_links.cpp
boxes/peers/edit_peer_invite_links.h
boxes/peers/edit_peer_history_visibility_box.cpp
boxes/peers/edit_peer_history_visibility_box.h
boxes/peers/edit_peer_permissions_box.cpp
boxes/peers/edit_peer_permissions_box.h
boxes/peers/edit_peer_reactions.cpp
@@ -992,6 +990,8 @@ PRIVATE
platform/linux/notifications_manager_linux.h
platform/linux/specific_linux.cpp
platform/linux/specific_linux.h
platform/linux/tray_linux.cpp
platform/linux/tray_linux.h
platform/mac/file_utilities_mac.mm
platform/mac/file_utilities_mac.h
platform/mac/launcher_mac.mm
@@ -1007,6 +1007,8 @@ PRIVATE
platform/mac/specific_mac.h
platform/mac/specific_mac_p.mm
platform/mac/specific_mac_p.h
platform/mac/tray_mac.mm
platform/mac/tray_mac.h
platform/mac/window_title_mac.mm
platform/mac/touchbar/items/mac_formatter_item.h
platform/mac/touchbar/items/mac_formatter_item.mm
@@ -1040,6 +1042,8 @@ PRIVATE
platform/win/notifications_manager_win.h
platform/win/specific_win.cpp
platform/win/specific_win.h
platform/win/tray_win.cpp
platform/win/tray_win.h
platform/win/windows_app_user_model_id.cpp
platform/win/windows_app_user_model_id.h
platform/win/windows_dlls.cpp
@@ -1056,6 +1060,7 @@ PRIVATE
platform/platform_main_window.h
platform/platform_notifications_manager.h
platform/platform_specific.h
platform/platform_tray.h
platform/platform_window_title.h
profile/profile_back_button.cpp
profile/profile_back_button.h
@@ -1069,6 +1074,8 @@ PRIVATE
profile/profile_cover_drop_area.h
settings/settings_advanced.cpp
settings/settings_advanced.h
settings/settings_blocked_peers.cpp
settings/settings_blocked_peers.h
settings/settings_chat.cpp
settings/settings_chat.h
settings/settings_calls.cpp
@@ -1260,6 +1267,8 @@ PRIVATE
settings.cpp
settings.h
stdafx.h
tray.cpp
tray.h
)
if (NOT build_winstore)

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 797 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 768 B

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 957 B

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 B

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1023 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 B

After

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 891 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

View File

@@ -799,6 +799,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_blocked_list_confirm_text" = "Do you want to block {name} from messaging and calling you on Telegram?";
"lng_blocked_list_confirm_clear" = "Delete this chat";
"lng_blocked_list_confirm_ok" = "Block";
"lng_blocked_list_empty_title" = "No blocked users";
"lng_blocked_list_empty_description" = "You haven't blocked anyone yet.";
"lng_blocked_list_subtitle#one" = "{count} blocked user";
"lng_blocked_list_subtitle#other" = "{count} blocked users";
"lng_edit_privacy_everyone" = "Everybody";
"lng_edit_privacy_contacts" = "My contacts";
@@ -1976,7 +1980,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_try_other_contact" = "Try someone else";
"lng_create_group_link" = "Link";
"lng_create_group_invite_link" = "Invite link";
"lng_create_group_description" = "Description (optional)";
"lng_create_group_description" = "Add description...";
"lng_drag_images_here" = "Drop images here";
"lng_drag_photos_here" = "Drop photos here";
@@ -2661,7 +2665,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_admin_log_pinned_message" = "{from} pinned this message:";
"lng_admin_log_unpinned_message" = "{from} unpinned this message";
"lng_admin_log_edited_caption" = "{from} edited caption:";
"lng_admin_log_removed_caption" = "{from} removed caption";
"lng_admin_log_edited_media" = "{from} edited media:";
"lng_admin_log_edited_media_and_caption" = "{from} edited media and caption:";
"lng_admin_log_edited_media_and_removed_caption" = "{from} edited media and removed caption:";
"lng_admin_log_removed_caption" = "{from} removed caption:";
"lng_admin_log_previous_caption" = "Original caption";
"lng_admin_log_edited_message" = "{from} edited this message:";
"lng_admin_log_previous_message" = "Original message";

View File

@@ -2,4 +2,10 @@
<qresource prefix="/animations">
<file alias="change_number.tgs">../../animations/change_number.tgs</file>
</qresource>
<qresource prefix="/animations">
<file alias="blocked_peers_empty.tgs">../../animations/blocked_peers_empty.tgs</file>
</qresource>
<qresource prefix="/animations">
<file alias="filters.tgs">../../animations/filters.tgs</file>
</qresource>
</RCC>

View File

@@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="3.7.1.0" />
Version="3.7.4.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>

View File

@@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,7,1,0
PRODUCTVERSION 3,7,1,0
FILEVERSION 3,7,4,0
PRODUCTVERSION 3,7,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "3.7.1.0"
VALUE "FileVersion", "3.7.4.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2022"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "3.7.1.0"
VALUE "ProductVersion", "3.7.4.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,7,1,0
PRODUCTVERSION 3,7,1,0
FILEVERSION 3,7,4,0
PRODUCTVERSION 3,7,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "3.7.1.0"
VALUE "FileVersion", "3.7.4.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2022"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "3.7.1.0"
VALUE "ProductVersion", "3.7.4.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -83,7 +83,7 @@ MTPInputMedia PrepareUploadedPhoto(RemoteFileInfo info) {
MTP_flags(flags),
info.file,
MTP_vector<MTPInputDocument>(
ranges::to<QVector>(info.attachedStickers)),
ranges::to<QVector<MTPInputDocument>>(info.attachedStickers)),
MTP_int(0));
}
@@ -107,7 +107,7 @@ MTPInputMedia PrepareUploadedDocument(
MTP_string(document->mimeString()),
ComposeSendingDocumentAttributes(document),
MTP_vector<MTPInputDocument>(
ranges::to<QVector>(info.attachedStickers)),
ranges::to<QVector<MTPInputDocument>>(info.attachedStickers)),
MTP_int(0));
}

View File

@@ -1393,6 +1393,18 @@ void EditNameBox::prepare() {
connect(_first, &Ui::InputField::submitted, [=] { submit(); });
connect(_last, &Ui::InputField::submitted, [=] { submit(); });
_first->customTab(true);
_last->customTab(true);
QObject::connect(
_first,
&Ui::InputField::tabbed,
[=] { _last->setFocus(); });
QObject::connect(
_last,
&Ui::InputField::tabbed,
[=] { _first->setFocus(); });
}
void EditNameBox::setInnerFocus() {

View File

@@ -602,6 +602,9 @@ changePhoneError: FlatLabel(changePhoneLabel) {
textFg: boxTextFgError;
}
blockedUsersListSubtitleAddPadding: margins(0px, 1px, 0px, -14px);
blockedUsersListIconPadding: margins(0px, 34px, 0px, 5px);
adminLogFilterUserpicLeft: 15px;
adminLogFilterLittleSkip: 16px;
adminLogFilterCheckbox: Checkbox(defaultBoxCheckbox) {

View File

@@ -510,7 +510,7 @@ void ChangePhone::setupContent() {
}
void ChangePhone::showFinished() {
_animate();
_animate(anim::repeat::loop);
}
} // namespace Settings

View File

@@ -36,7 +36,7 @@ private:
void setupContent();
const not_null<Window::SessionController*> _controller;
Fn<void()> _animate;
Fn<void(anim::repeat)> _animate;
};

View File

@@ -15,7 +15,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h"
#include "main/main_session.h"
#include "ui/filter_icons.h"
#include "ui/layers/generic_box.h"
#include "ui/text/text_utilities.h" // Ui::Text::Bold
#include "ui/toast/toast.h"
#include "ui/widgets/buttons.h"
@@ -27,46 +26,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace {
class FolderButton : public Ui::SettingsButton {
public:
FolderButton(
not_null<Ui::RpWidget*> parent,
const Data::ChatFilter &filter);
protected:
void paintEvent(QPaintEvent *e) override;
private:
const Ui::FilterIcon _icon;
};
FolderButton::FolderButton(
not_null<Ui::RpWidget*> parent,
const Data::ChatFilter &filter)
: SettingsButton(
parent,
rpl::single(filter.title()),
st::paymentsSectionButton)
, _icon(Ui::ComputeFilterIcon(filter)) {
}
void FolderButton::paintEvent(QPaintEvent *e) {
SettingsButton::paintEvent(e);
Painter p(this);
const auto over = isOver() || isDown();
const auto icon = Ui::LookupFilterIcon(_icon).normal;
icon->paint(
p,
st::settingsFilterIconLeft,
(height() - icon->height()) / 2,
width(),
(over
? st::dialogsUnreadBgMutedOver
: st::dialogsUnreadBgMuted)->c);
}
Data::ChatFilter ChangedFilter(
const Data::ChatFilter &filter,
not_null<History*> history,
@@ -165,47 +124,6 @@ void ChooseFilterValidator::remove(FilterId filterId) const {
ChangeFilterById(filterId, _history, false);
}
void ChooseFilterBox(
not_null<Ui::GenericBox*> box,
not_null<History*> history) {
box->setTitle(tr::lng_filters_add_box_title());
const auto validator = ChooseFilterValidator(history);
const auto container = box->verticalLayout()->add(
object_ptr<Ui::VerticalLayout>(box->verticalLayout()));
const auto rebuild = [=] {
while (container->count()) {
delete container->widgetAt(0);
}
for (const auto &filter : history->owner().chatsFilters().list()) {
if (filter.contains(history)) {
continue;
}
container->add(
object_ptr<FolderButton>(box, filter),
style::margins()
)->setClickedCallback([=, id = filter.id()] {
validator.add(id);
box->closeBox();
});
}
container->resizeToWidth(box->verticalLayout()->width());
if (!container->count()) {
box->closeBox();
}
};
history->owner().chatsFilters().changed(
) | rpl::start_with_next([=] {
rebuild();
}, box->lifetime());
rebuild();
box->addButton(tr::lng_close(), [=] { box->closeBox(); });
}
void FillChooseFilterMenu(
not_null<Ui::PopupMenu*> menu,
not_null<History*> history) {

View File

@@ -8,7 +8,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#pragma once
namespace Ui {
class GenericBox;
class PopupMenu;
} // namespace Ui
@@ -29,10 +28,6 @@ private:
};
void ChooseFilterBox(
not_null<Ui::GenericBox*> box,
not_null<History*> history);
void FillChooseFilterMenu(
not_null<Ui::PopupMenu*> menu,
not_null<History*> history);

View File

@@ -500,6 +500,7 @@ void EditFilterBox(
const Data::ChatFilter &filter,
Fn<void(const Data::ChatFilter &)> doneCallback) {
const auto creating = filter.title().isEmpty();
box->setWidth(st::boxWideWidth);
box->setTitle(creating ? tr::lng_filters_new() : tr::lng_filters_edit());
box->setCloseByOutsideClick(false);
@@ -571,8 +572,9 @@ void EditFilterBox(
const auto includeAdd = AddButton(
content,
tr::lng_filters_add_chats() | Ui::Text::ToUpper(),
st::settingsUpdate);
tr::lng_filters_add_chats(),
st::settingsButtonActive,
{ &st::settingsIconAdd, 0, IconType::Round, &st::windowBgActive });
const auto include = SetupChatsPreview(
content,
@@ -582,21 +584,16 @@ void EditFilterBox(
&Data::ChatFilter::always);
AddSkip(content);
content->add(
object_ptr<Ui::FlatLabel>(
content,
tr::lng_filters_include_about(),
st::boxDividerLabel),
st::windowFilterAboutPadding);
AddDivider(content);
AddDividerText(content, tr::lng_filters_include_about());
AddSkip(content);
AddSubsectionTitle(content, tr::lng_filters_exclude());
const auto excludeAdd = AddButton(
content,
tr::lng_filters_remove_chats() | Ui::Text::ToUpper(),
st::settingsUpdate);
tr::lng_filters_remove_chats(),
st::settingsButtonActive,
{ &st::settingsIconRemove, 0, IconType::Round, &st::windowBgActive });
const auto exclude = SetupChatsPreview(
content,
@@ -606,12 +603,7 @@ void EditFilterBox(
&Data::ChatFilter::never);
AddSkip(content);
content->add(
object_ptr<Ui::FlatLabel>(
content,
tr::lng_filters_exclude_about(),
st::boxDividerLabel),
st::windowFilterAboutPadding);
AddDividerText(content, tr::lng_filters_exclude_about());
const auto refreshPreviews = [=] {
include->updateData(

View File

@@ -510,7 +510,8 @@ not_null<Ui::SlideWrap<Ui::RpWidget>*> EditAdminBox::setupTransferButton(
: tr::lng_rights_transfer_channel)(),
rpl::single(QString()),
[=] { transferOwnership(); },
st::peerPermissionsButton));
st::peerPermissionsButton,
{}));
return wrap;
}

View File

@@ -7,125 +7,56 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "boxes/peers/edit_peer_history_visibility_box.h"
#include "boxes/peers/edit_peer_permissions_box.h"
#include "boxes/peers/edit_participants_box.h"
#include "data/data_channel.h"
#include "data/data_chat.h"
#include "data/data_peer.h"
#include "lang/lang_keys.h"
#include "ui/layers/generic_box.h"
#include "ui/widgets/checkbox.h"
#include "ui/widgets/labels.h"
#include "ui/wrap/padding_wrap.h"
#include "ui/wrap/slide_wrap.h"
#include "ui/wrap/vertical_layout.h"
#include "styles/style_layers.h"
#include "styles/style_info.h"
namespace {
void EditPeerHistoryVisibilityBox(
not_null<Ui::GenericBox*> box,
bool isLegacy,
Fn<void(HistoryVisibility)> savedCallback,
HistoryVisibility historyVisibilitySavedValue) {
const auto historyVisibility = std::make_shared<
Ui::RadioenumGroup<HistoryVisibility>
>(historyVisibilitySavedValue);
void AddRadioButton(
not_null<Ui::VerticalLayout*> container,
HistoryVisibility value,
const QString &groupText,
rpl::producer<QString> groupAbout,
std::shared_ptr<Ui::RadioenumGroup<HistoryVisibility>> historyVisibility) {
container->add(object_ptr<Ui::FixedHeightWidget>(
container,
st::editPeerHistoryVisibilityTopSkip));
container->add(object_ptr<Ui::Radioenum<HistoryVisibility>>(
container,
box->setTitle(tr::lng_manage_history_visibility_title());
box->addButton(tr::lng_settings_save(), [=] {
savedCallback(historyVisibility->value());
box->closeBox();
});
box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
box->addSkip(st::editPeerHistoryVisibilityTopSkip);
box->addRow(object_ptr<Ui::Radioenum<HistoryVisibility>>(
box,
historyVisibility,
value,
groupText,
st::defaultBoxCheckbox));
container->add(object_ptr<Ui::PaddingWrap<Ui::FlatLabel>>(
container,
object_ptr<Ui::FlatLabel>(
container,
std::move(groupAbout),
st::editPeerPrivacyLabel),
st::editPeerPreHistoryLabelMargins));
}
void FillContent(
not_null<Ui::VerticalLayout*> parent,
not_null<PeerData*> peer,
std::shared_ptr<Ui::RadioenumGroup<HistoryVisibility>> historyVisibility,
HistoryVisibility savedValue) {
const auto canEdit = [&] {
if (const auto chat = peer->asChat()) {
return chat->canEditPreHistoryHidden();
} else if (const auto channel = peer->asChannel()) {
return channel->canEditPreHistoryHidden();
}
Unexpected("User in HistoryVisibilityEdit.");
}();
if (!canEdit) {
return;
}
historyVisibility->setValue(savedValue);
const auto result = parent->add(
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
parent,
object_ptr<Ui::VerticalLayout>(parent),
st::editPeerHistoryVisibilityMargins));
const auto container = result->entity();
Assert(historyVisibility != nullptr);
AddRadioButton(
container,
HistoryVisibility::Visible,
tr::lng_manage_history_visibility_shown(tr::now),
tr::lng_manage_history_visibility_shown_about(),
historyVisibility);
AddRadioButton(
container,
st::defaultBoxCheckbox));
box->addRow(
object_ptr<Ui::FlatLabel>(
box,
tr::lng_manage_history_visibility_shown_about(),
st::editPeerPrivacyLabel),
st::editPeerPreHistoryLabelMargins + st::boxRowPadding);
box->addSkip(st::editPeerHistoryVisibilityTopSkip);
box->addRow(object_ptr<Ui::Radioenum<HistoryVisibility>>(
box,
historyVisibility,
HistoryVisibility::Hidden,
tr::lng_manage_history_visibility_hidden(tr::now),
(peer->isChat()
? tr::lng_manage_history_visibility_hidden_legacy
: tr::lng_manage_history_visibility_hidden_about)(),
historyVisibility);
}
} // namespace
EditPeerHistoryVisibilityBox::EditPeerHistoryVisibilityBox(
QWidget*,
not_null<PeerData*> peer,
FnMut<void(HistoryVisibility)> savedCallback,
HistoryVisibility historyVisibilitySavedValue)
: _peer(peer)
, _savedCallback(std::move(savedCallback))
, _historyVisibilitySavedValue(historyVisibilitySavedValue)
, _historyVisibility(
std::make_shared<Ui::RadioenumGroup<HistoryVisibility>>(
_historyVisibilitySavedValue)) {
}
void EditPeerHistoryVisibilityBox::prepare() {
_peer->updateFull();
setTitle(tr::lng_manage_history_visibility_title());
addButton(tr::lng_settings_save(), [=] {
auto local = std::move(_savedCallback);
local(_historyVisibility->value());
closeBox();
});
addButton(tr::lng_cancel(), [=] { closeBox(); });
setupContent();
}
void EditPeerHistoryVisibilityBox::setupContent() {
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
FillContent(
content,
_peer,
_historyVisibility,
_historyVisibilitySavedValue);
setDimensionsToContent(st::boxWidth, content);
st::defaultBoxCheckbox));
box->addRow(
object_ptr<Ui::FlatLabel>(
box,
(isLegacy
? tr::lng_manage_history_visibility_hidden_legacy
: tr::lng_manage_history_visibility_hidden_about)(),
st::editPeerPrivacyLabel),
st::editPeerPreHistoryLabelMargins + st::boxRowPadding);
}

View File

@@ -7,32 +7,17 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "boxes/abstract_box.h"
#include "ui/widgets/checkbox.h"
namespace Ui {
class GenericBox;
} // namespace Ui
enum class HistoryVisibility {
Visible,
Hidden,
};
class EditPeerHistoryVisibilityBox : public Ui::BoxContent {
public:
EditPeerHistoryVisibilityBox(
QWidget*,
not_null<PeerData*> peer,
FnMut<void(HistoryVisibility)> savedCallback,
HistoryVisibility historyVisibilitySavedValue);
protected:
void prepare() override;
private:
void setupContent();
not_null<PeerData*> _peer;
FnMut<void(HistoryVisibility)> _savedCallback;
HistoryVisibility _historyVisibilitySavedValue;
std::shared_ptr<Ui::RadioenumGroup<HistoryVisibility>> _historyVisibility;
};
void EditPeerHistoryVisibilityBox(
not_null<Ui::GenericBox*> box,
bool isLegacy,
Fn<void(HistoryVisibility)> savedCallback,
HistoryVisibility historyVisibilitySavedValue);

View File

@@ -37,9 +37,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/admin_log/history_admin_log_section.h"
#include "info/profile/info_profile_values.h"
#include "lang/lang_keys.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "mtproto/sender.h"
#include "settings/settings_common.h"
#include "ui/rp_widget.h"
#include "ui/special_buttons.h"
#include "ui/toast/toast.h"
@@ -53,22 +52,22 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/wrap/vertical_layout.h"
#include "window/window_session_controller.h"
#include "info/profile/info_profile_icon.h"
#include "apiwrap.h"
#include "api/api_invite_links.h"
#include "facades.h"
#include "facades.h" // Ui::showChatsList
#include "styles/style_layers.h"
#include "styles/style_boxes.h"
#include "styles/style_info.h"
#include "styles/style_settings.h"
namespace {
auto ToPositiveNumberString() {
[[nodiscard]] auto ToPositiveNumberString() {
return rpl::map([](int count) {
return count ? QString::number(count) : QString();
});
}
auto ToPositiveNumberStringRestrictions() {
[[nodiscard]] auto ToPositiveNumberStringRestrictions() {
return rpl::map([](int count) {
return QString::number(count)
+ QString("/")
@@ -94,40 +93,29 @@ void AddButtonWithCount(
rpl::producer<QString> &&text,
rpl::producer<QString> &&count,
Fn<void()> callback,
const style::icon &icon) {
Settings::IconDescriptor &&descriptor) {
parent->add(EditPeerInfoBox::CreateButton(
parent,
std::move(text),
std::move(count),
std::move(callback),
st::manageGroupButton,
&icon));
std::move(descriptor)));
}
object_ptr<Ui::SettingsButton> CreateButtonWithText(
not_null<QWidget*> parent,
not_null<Ui::SettingsButton*> AddButtonWithText(
not_null<Ui::VerticalLayout*> parent,
rpl::producer<QString> &&text,
rpl::producer<QString> &&label,
Fn<void()> callback) {
return EditPeerInfoBox::CreateButton(
Fn<void()> callback,
Settings::IconDescriptor &&descriptor) {
return parent->add(EditPeerInfoBox::CreateButton(
parent,
std::move(text),
std::move(label),
std::move(callback),
st::manageGroupTopButtonWithText,
nullptr);
}
Ui::SettingsButton *AddButtonWithText(
not_null<Ui::VerticalLayout*> parent,
rpl::producer<QString> &&text,
rpl::producer<QString> &&label,
Fn<void()> callback) {
return parent->add(CreateButtonWithText(
parent,
std::move(text),
std::move(label),
std::move(callback)));
std::move(descriptor)));
}
void AddButtonDelete(
@@ -140,7 +128,7 @@ void AddButtonDelete(
rpl::single(QString()),
std::move(callback),
st::manageDeleteGroupButton,
nullptr));
{}));
}
void SaveDefaultRestrictions(
@@ -262,7 +250,7 @@ public:
not_null<Ui::BoxContent*> box,
not_null<PeerData*> peer);
object_ptr<Ui::VerticalLayout> createContent();
[[nodiscard]] object_ptr<Ui::VerticalLayout> createContent();
void setFocus();
private:
@@ -284,12 +272,12 @@ private:
std::optional<ChannelData*> linkedChat;
};
object_ptr<Ui::RpWidget> createPhotoAndTitleEdit();
object_ptr<Ui::RpWidget> createTitleEdit();
object_ptr<Ui::RpWidget> createPhotoEdit();
object_ptr<Ui::RpWidget> createDescriptionEdit();
object_ptr<Ui::RpWidget> createManageGroupButtons();
object_ptr<Ui::RpWidget> createStickersEdit();
[[nodiscard]] object_ptr<Ui::RpWidget> createPhotoAndTitleEdit();
[[nodiscard]] object_ptr<Ui::RpWidget> createTitleEdit();
[[nodiscard]] object_ptr<Ui::RpWidget> createPhotoEdit();
[[nodiscard]] object_ptr<Ui::RpWidget> createDescriptionEdit();
[[nodiscard]] object_ptr<Ui::RpWidget> createManageGroupButtons();
[[nodiscard]] object_ptr<Ui::RpWidget> createStickersEdit();
[[nodiscard]] bool canEditInformation() const;
[[nodiscard]] bool canEditReactions() const;
@@ -310,14 +298,14 @@ private:
void deleteWithConfirmation();
void deleteChannel();
std::optional<Saving> validate() const;
bool validateUsername(Saving &to) const;
bool validateLinkedChat(Saving &to) const;
bool validateTitle(Saving &to) const;
bool validateDescription(Saving &to) const;
bool validateHistoryVisibility(Saving &to) const;
bool validateSignatures(Saving &to) const;
bool validateForwards(Saving &to) const;
[[nodiscard]] std::optional<Saving> validate() const;
[[nodiscard]] bool validateUsername(Saving &to) const;
[[nodiscard]] bool validateLinkedChat(Saving &to) const;
[[nodiscard]] bool validateTitle(Saving &to) const;
[[nodiscard]] bool validateDescription(Saving &to) const;
[[nodiscard]] bool validateHistoryVisibility(Saving &to) const;
[[nodiscard]] bool validateSignatures(Saving &to) const;
[[nodiscard]] bool validateForwards(Saving &to) const;
void save();
void saveUsername();
@@ -522,7 +510,8 @@ object_ptr<Ui::RpWidget> Controller::createDescriptionEdit() {
result->entity()->setInstantReplaces(Ui::InstantReplaces::Default());
result->entity()->setInstantReplacesEnabled(
Core::App().settings().replaceEmojiValue());
result->entity()->setSubmitSettings(Core::App().settings().sendSubmitWay());
result->entity()->setSubmitSettings(
Core::App().settings().sendSubmitWay());
Ui::Emoji::SuggestionsController::Init(
_wrap->window(),
result->entity(),
@@ -555,38 +544,36 @@ object_ptr<Ui::RpWidget> Controller::createStickersEdit() {
Expects(_wrap != nullptr);
const auto channel = _peer->asChannel();
const auto bottomSkip = st::editPeerTopButtonsLayoutSkipCustomBottom;
auto result = object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
_wrap,
object_ptr<Ui::VerticalLayout>(_wrap),
st::editPeerInvitesMargins);
object_ptr<Ui::VerticalLayout>(_wrap));
const auto container = result->entity();
container->add(object_ptr<Ui::FlatLabel>(
Settings::AddSubsectionTitle(
container,
tr::lng_group_stickers(),
st::editPeerSectionLabel));
container->add(object_ptr<Ui::FixedHeightWidget>(
container,
st::editPeerInviteLinkSkip));
{ 0, st::settingsSubsectionTitlePadding.top() - bottomSkip, 0, 0 });
container->add(object_ptr<Ui::FlatLabel>(
AddButtonWithCount(
container,
tr::lng_group_stickers_description(),
st::editPeerPrivacyLabel));
container->add(object_ptr<Ui::FixedHeightWidget>(
container,
st::editPeerInviteLinkSkip));
tr::lng_group_stickers_add(),
rpl::single(QString()), //Empty count.
[=, controller = _navigation->parentController()] {
controller->show(
Box<StickersBox>(controller, channel),
Ui::LayerOption::KeepOther);
},
{ &st::settingsIconStickers, Settings::kIconLightOrange });
container->add(object_ptr<Ui::LinkButton>(
_wrap,
tr::lng_group_stickers_add(tr::now),
st::editPeerInviteLinkButton)
)->addClickHandler([=] {
_navigation->parentController()->show(
Box<StickersBox>(_navigation->parentController(), channel),
Ui::LayerOption::KeepOther);
});
Settings::AddSkip(container, bottomSkip);
Settings::AddDividerText(
container,
tr::lng_group_stickers_description());
Settings::AddSkip(container, bottomSkip);
return result;
}
@@ -718,6 +705,9 @@ void Controller::fillPrivacyTypeButton() {
_noForwardsSavedValue = !_peer->allowsForwarding();
const auto isGroup = (_peer->isChat() || _peer->isMegagroup());
const auto icon = isGroup
? &st::settingsIconGroup
: &st::settingsIconChannel;
AddButtonWithText(
_controls.buttonsLayout,
(hasLocation
@@ -739,7 +729,8 @@ void Controller::fillPrivacyTypeButton() {
? tr::lng_manage_private_group_title
: tr::lng_manage_private_peer_title)();
}) | rpl::flatten_latest(),
[=] { showEditPeerTypeBox(); });
[=] { showEditPeerTypeBox(); },
{ icon, Settings::kIconLightBlue });
_privacyTypeUpdates.fire_copy(*_privacySavedValue);
}
@@ -781,7 +772,8 @@ void Controller::fillLinkedChatButton() {
_controls.buttonsLayout,
std::move(text),
std::move(label),
[=] { showEditLinkedChatBox(); });
[=] { showEditLinkedChatBox(); },
{ &st::settingsIconChat, Settings::kIconGreen });
_linkedChatUpdates.fire_copy(*_linkedChatSavedValue);
}
//
@@ -803,13 +795,16 @@ void Controller::fillSignaturesButton() {
Expects(_controls.buttonsLayout != nullptr);
const auto channel = _peer->asChannel();
if (!channel) return;
if (!channel) {
return;
}
AddButtonWithText(
_controls.buttonsLayout,
tr::lng_edit_sign_messages(),
rpl::single(QString()),
[=] {}
[] {},
{ &st::infoIconSignature, Settings::kIconLightBlue }
)->toggleOn(rpl::single(channel->addsSignature())
)->toggledValue(
) | rpl::start_with_next([=](bool toggled) {
@@ -843,12 +838,23 @@ void Controller::fillHistoryVisibilityButton() {
_historyVisibilitySavedValue = checked;
});
const auto buttonCallback = [=] {
_navigation->parentController()->show(
Box<EditPeerHistoryVisibilityBox>(
_peer,
boxCallback,
*_historyVisibilitySavedValue),
Ui::LayerOption::KeepOther);
_peer->updateFull();
const auto canEdit = [&] {
if (const auto chat = _peer->asChat()) {
return chat->canEditPreHistoryHidden();
} else if (const auto channel = _peer->asChannel()) {
return channel->canEditPreHistoryHidden();
}
Unexpected("User in HistoryVisibilityEdit.");
}();
if (!canEdit) {
return;
}
_navigation->parentController()->show(Box(
EditPeerHistoryVisibilityBox,
_peer->isChat(),
boxCallback,
*_historyVisibilitySavedValue));
};
AddButtonWithText(
container,
@@ -859,7 +865,8 @@ void Controller::fillHistoryVisibilityButton() {
? tr::lng_manage_history_visibility_shown
: tr::lng_manage_history_visibility_hidden)();
}) | rpl::flatten_latest(),
buttonCallback);
buttonCallback,
{ &st::settingsIconChat, Settings::kIconGreen });
updateHistoryVisibility->fire_copy(*_historyVisibilitySavedValue);
@@ -970,6 +977,40 @@ void Controller::fillManageSection() {
st::editPeerTopButtonsLayoutSkipCustomBottom);
}
if (canEditReactions()) {
const auto session = &_peer->session();
auto reactionsCount = Info::Profile::MigratedOrMeValue(
_peer
) | rpl::map(
Info::Profile::AllowedReactionsCountValue
) | rpl::flatten_latest();
auto fullCount = Info::Profile::FullReactionsCountValue(session);
auto label = rpl::combine(
std::move(reactionsCount),
std::move(fullCount)
) | rpl::map([=](int allowed, int total) {
return allowed
? QString::number(allowed) + " / " + QString::number(total)
: tr::lng_manage_peer_reactions_off(tr::now);
});
const auto done = [=](const std::vector<QString> &chosen) {
SaveAllowedReactions(_peer, chosen);
};
AddButtonWithCount(
_controls.buttonsLayout,
tr::lng_manage_peer_reactions(),
std::move(label),
[=] {
_navigation->parentController()->show(Box(
EditAllowedReactionsBox,
!_peer->isBroadcast(),
session->data().reactions().list(
Data::Reactions::Type::Active),
*Data::PeerAllowedReactions(_peer),
done));
},
{ &st::infoIconReactions, Settings::kIconRed });
}
if (canEditPermissions) {
AddButtonWithCount(
_controls.buttonsLayout,
@@ -981,7 +1022,7 @@ void Controller::fillManageSection() {
) | rpl::flatten_latest(
) | ToPositiveNumberStringRestrictions(),
[=] { ShowEditPermissions(_navigation, _peer); },
st::infoIconPermissions);
{ &st::settingsIconKey, Settings::kIconGreen });
}
if (canEditInviteLinks) {
auto count = Info::Profile::MigratedOrMeValue(
@@ -1017,7 +1058,7 @@ void Controller::fillManageSection() {
0),
Ui::LayerOption::KeepOther);
},
st::infoIconInviteLinks);
{ &st::infoIconInviteLinks, Settings::kIconLightOrange });
if (_privacySavedValue) {
_privacyTypeUpdates.events_starting_with_copy(
@@ -1029,40 +1070,6 @@ void Controller::fillManageSection() {
}, wrap->lifetime());
}
}
if (canEditReactions()) {
const auto session = &_peer->session();
auto reactionsCount = Info::Profile::MigratedOrMeValue(
_peer
) | rpl::map(
Info::Profile::AllowedReactionsCountValue
) | rpl::flatten_latest();
auto fullCount = Info::Profile::FullReactionsCountValue(session);
auto label = rpl::combine(
std::move(reactionsCount),
std::move(fullCount)
) | rpl::map([=](int allowed, int total) {
return allowed
? QString::number(allowed) + " / " + QString::number(total)
: tr::lng_manage_peer_reactions_off(tr::now);
});
const auto done = [=](const std::vector<QString> &chosen) {
SaveAllowedReactions(_peer, chosen);
};
AddButtonWithCount(
_controls.buttonsLayout,
tr::lng_manage_peer_reactions(),
std::move(label),
[=] {
_navigation->parentController()->show(Box(
EditAllowedReactionsBox,
!_peer->isBroadcast(),
session->data().reactions().list(
Data::Reactions::Type::Active),
*Data::PeerAllowedReactions(_peer),
done));
},
st::infoIconReactions);
}
if (canViewAdmins) {
AddButtonWithCount(
_controls.buttonsLayout,
@@ -1079,12 +1086,14 @@ void Controller::fillManageSection() {
_peer,
ParticipantsBoxController::Role::Admins);
},
st::infoIconAdministrators);
{ &st::infoIconAdministrators, Settings::kIconLightBlue });
}
if (canViewMembers) {
AddButtonWithCount(
_controls.buttonsLayout,
(_isGroup ? tr::lng_manage_peer_members() : tr::lng_manage_peer_subscribers()),
(_isGroup
? tr::lng_manage_peer_members()
: tr::lng_manage_peer_subscribers()),
Info::Profile::MigratedOrMeValue(
_peer
) | rpl::map(
@@ -1097,7 +1106,7 @@ void Controller::fillManageSection() {
_peer,
ParticipantsBoxController::Role::Members);
},
st::infoIconMembers);
{ &st::settingsIconGroup, Settings::kIconDarkBlue });
}
fillPendingRequestsButton();
@@ -1114,7 +1123,7 @@ void Controller::fillManageSection() {
_peer,
ParticipantsBoxController::Role::Kicked);
},
st::infoIconBlacklist);
{ &st::settingsIconMinus, Settings::kIconRed });
}
if (hasRecentActions) {
auto callback = [=] {
@@ -1126,7 +1135,7 @@ void Controller::fillManageSection() {
tr::lng_manage_peer_recent_actions(),
rpl::single(QString()), //Empty count.
std::move(callback),
st::infoIconRecentActions);
{ &st::infoIconRecentActions, Settings::kIconPurple });
}
if (canEditStickers || canDeleteChannel) {
@@ -1168,7 +1177,7 @@ void Controller::fillPendingRequestsButton() {
: tr::lng_manage_peer_requests_channel()),
rpl::duplicate(pendingRequestsCount) | ToPositiveNumberString(),
[=] { RequestsBoxController::Start(_navigation, _peer); },
st::infoIconRequests);
{ &st::infoIconRequests, Settings::kIconRed });
std::move(
pendingRequestsCount
) | rpl::start_with_next([=](int count) {
@@ -1670,18 +1679,18 @@ object_ptr<Ui::SettingsButton> EditPeerInfoBox::CreateButton(
rpl::producer<QString> &&count,
Fn<void()> callback,
const style::SettingsCountButton &st,
const style::icon *icon) {
Settings::IconDescriptor &&descriptor) {
auto result = object_ptr<Ui::SettingsButton>(
parent,
rpl::duplicate(text),
st.button);
const auto button = result.data();
button->addClickHandler(callback);
if (icon) {
Ui::CreateChild<Info::Profile::FloatingIcon>(
if (descriptor) {
AddButtonIcon(
button,
*icon,
st.iconPosition);
st.button,
std::move(descriptor));
}
auto labelText = rpl::combine(

View File

@@ -7,8 +7,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include <rpl/event_stream.h>
#include "boxes/abstract_box.h"
#include "ui/layers/box_content.h"
namespace Settings {
struct IconDescriptor;
} // namespace Settings
namespace style {
struct SettingsCountButton;
@@ -42,7 +45,7 @@ public:
rpl::producer<QString> &&count,
Fn<void()> callback,
const style::SettingsCountButton &st,
const style::icon *icon = nullptr);
Settings::IconDescriptor &&descriptor);
protected:
void prepare() override;

View File

@@ -28,6 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "main/main_session.h"
#include "mainwindow.h"
#include "apiwrap.h"
#include "settings/settings_common.h"
#include "styles/style_layers.h"
#include "styles/style_boxes.h"
#include "styles/style_info.h"
@@ -612,7 +613,8 @@ void EditPeerPermissionsBox::addSuggestGigagroup(
AboutGigagroupCallback(
_peer->asChannel(),
_navigation->parentController()),
st::peerPermissionsButton));
st::peerPermissionsButton,
{}));
container->add(
object_ptr<Ui::DividerLabel>(
@@ -645,7 +647,8 @@ void EditPeerPermissionsBox::addBannedButtons(
_peer,
ParticipantsBoxController::Role::Restricted);
},
st::peerPermissionsButton));
st::peerPermissionsButton,
{}));
if (channel) {
container->add(EditPeerInfoBox::CreateButton(
container,
@@ -658,7 +661,8 @@ void EditPeerPermissionsBox::addBannedButtons(
_peer,
ParticipantsBoxController::Role::Kicked);
},
st::peerPermissionsButton));
st::peerPermissionsButton,
{}));
}
}

View File

@@ -18,7 +18,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h"
#include "ui/layers/generic_box.h"
#include "ui/widgets/buttons.h"
#include "info/profile/info_profile_icon.h"
#include "settings/settings_common.h"
#include "styles/style_settings.h"
#include "styles/style_info.h"
@@ -29,6 +28,7 @@ void EditAllowedReactionsBox(
const std::vector<Data::Reaction> &list,
const base::flat_set<QString> &selected,
Fn<void(const std::vector<QString> &)> callback) {
const auto iconHeight = st::editPeerReactionsPreview;
box->setTitle(tr::lng_manage_peer_reactions());
struct State {
@@ -57,10 +57,21 @@ void EditAllowedReactionsBox(
container,
tr::lng_manage_peer_reactions_enable(),
st::manageGroupButton.button);
Ui::CreateChild<Info::Profile::FloatingIcon>(
enabled.get(),
st::infoIconReactions,
st::manageGroupButton.iconPosition);
if (!list.empty()) {
AddReactionLottieIcon(
enabled,
enabled->sizeValue(
) | rpl::map([=](const QSize &size) {
return QPoint(
st::manageGroupButton.iconPosition.x(),
(size.height() - iconHeight) / 2);
}),
iconHeight,
list.front(),
rpl::never<>(),
rpl::never<>(),
&enabled->lifetime());
}
enabled->toggleOn(state->anyToggled.value());
enabled->toggledChanges(
) | rpl::filter([=](bool value) {
@@ -87,7 +98,6 @@ void EditAllowedReactionsBox(
container,
rpl::single(entry.title),
st::manageGroupButton.button);
const auto iconHeight = st::editPeerReactionsPreview;
AddReactionLottieIcon(
button,
button->sizeValue(
@@ -138,7 +148,7 @@ void SaveAllowedReactions(
const std::vector<QString> &allowed) {
auto ids = allowed | ranges::views::transform([=](QString value) {
return MTP_string(value);
}) | ranges::to<QVector>;
}) | ranges::to<QVector<MTPstring>>;
peer->session().api().request(MTPmessages_SetChatAvailableReactions(
peer->input,

View File

@@ -7,8 +7,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "boxes/peers/edit_peer_type_box.h"
#include "apiwrap.h"
#include "api/api_invite_links.h"
#include "main/main_session.h"
#include "boxes/add_contact_box.h"
#include "ui/boxes/confirm_box.h"
@@ -19,7 +17,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/peers/edit_peer_invite_link.h"
#include "boxes/peers/edit_peer_invite_links.h"
#include "chat_helpers/emoji_suggestions_widget.h"
#include "core/application.h"
#include "data/data_channel.h"
#include "data/data_chat.h"
#include "data/data_peer.h"
@@ -27,7 +24,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_changes.h"
#include "info/profile/info_profile_values.h"
#include "lang/lang_keys.h"
#include "mainwindow.h"
#include "mtproto/sender.h"
#include "ui/rp_widget.h"
#include "ui/special_buttons.h"
@@ -35,7 +31,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/checkbox.h"
#include "ui/widgets/input_fields.h"
#include "ui/widgets/labels.h"
#include "ui/widgets/popup_menu.h"
#include "ui/widgets/box_content_divider.h"
#include "ui/wrap/padding_wrap.h"
#include "ui/wrap/slide_wrap.h"
@@ -48,11 +43,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_info.h"
#include "styles/style_settings.h"
#include <QtGui/QGuiApplication>
#include <QtGui/QClipboard>
#include <rpl/flatten_latest.h>
namespace {
class Controller : public base::has_weak_ptr {
@@ -209,21 +199,22 @@ void Controller::createContent() {
Ui::LayerOption::KeepOther);
},
st::manageGroupButton,
&st::infoIconInviteLinks));
{ &st::infoIconInviteLinks, Settings::kIconLightOrange }));
AddSkip(_wrap.get());
AddDividerText(_wrap.get(), tr::lng_group_invite_manage_about());
if (!_linkOnly) {
AddSkip(_wrap.get());
AddSubsectionTitle(_wrap.get(), tr::lng_manage_peer_no_forwards_title());
AddSubsectionTitle(
_wrap.get(),
tr::lng_manage_peer_no_forwards_title());
_controls.noForwards = _wrap->add(EditPeerInfoBox::CreateButton(
_wrap.get(),
tr::lng_manage_peer_no_forwards(),
rpl::single(QString()),
[=] {},
st::manageGroupTopButtonWithText,
nullptr
));
[] {},
st::peerPermissionsButton,
{}));
_controls.noForwards->toggleOn(
rpl::single(_noForwardsSavedValue.value_or(false))
)->toggledValue(

View File

@@ -7,8 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "boxes/abstract_box.h"
#include "base/timer.h"
#include "ui/layers/box_content.h"
namespace style {
struct SettingsCountButton;

View File

@@ -89,12 +89,13 @@ AdminLog::OwnedItem GenerateItem(
}
void AddMessage(
not_null<Ui::GenericBox*> box,
not_null<Ui::VerticalLayout*> container,
not_null<Window::SessionController*> controller,
rpl::producer<QString> &&emojiValue) {
rpl::producer<QString> &&emojiValue,
int width) {
const auto widget = box->addRow(
object_ptr<Ui::RpWidget>(box),
const auto widget = container->add(
object_ptr<Ui::RpWidget>(container),
style::margins(
0,
st::settingsSectionSkip,
@@ -121,7 +122,7 @@ void AddMessage(
bool flag = false;
} icons;
};
const auto state = box->lifetime().make_state<State>();
const auto state = container->lifetime().make_state<State>();
state->delegate = std::make_unique<Delegate>(
controller,
crl::guard(widget, [=] { widget->update(); }));
@@ -150,16 +151,18 @@ void AddMessage(
const auto padding = st::settingsForwardPrivacyPadding;
widget->widthValue(
) | rpl::filter(
rpl::mappers::_1 >= (st::historyMinimalWidth / 2)
) | rpl::start_with_next([=](int width) {
const auto updateWidgetSize = [=](int width) {
const auto height = view->resizeGetHeight(width);
const auto top = view->marginTop();
const auto bottom = view->marginBottom();
const auto full = padding + top + height + bottom + padding;
widget->resize(width, full);
}, widget->lifetime());
};
widget->widthValue(
) | rpl::filter(
rpl::mappers::_1 >= (st::historyMinimalWidth / 2)
) | rpl::start_with_next(updateWidgetSize, widget->lifetime());
updateWidgetSize(width);
const auto rightSize = st::settingsReactionCornerSize;
const auto rightRect = [=] {
@@ -224,7 +227,7 @@ void AddMessage(
const auto index = state->icons.flag ? 1 : 0;
state->icons.lifetimes[index] = rpl::lifetime();
AddReactionLottieIcon(
box->verticalLayout(),
container,
widget->geometryValue(
) | rpl::map([=](const QRect &r) {
return widget->pos()
@@ -388,34 +391,19 @@ void ReactionsSettingsBox(
const auto state = box->lifetime().make_state<State>();
state->selectedEmoji = reactions.favorite();
AddMessage(box, controller, state->selectedEmoji.value());
const auto pinnedToTop = box->setPinnedToTopContent(
object_ptr<Ui::VerticalLayout>(box));
auto emojiValue = state->selectedEmoji.value();
AddMessage(pinnedToTop, controller, std::move(emojiValue), box->width());
const auto container = box->verticalLayout();
Settings::AddSubsectionTitle(
container,
pinnedToTop,
tr::lng_settings_chat_reactions_subtitle());
const auto &stButton = st::settingsButton;
const auto scrollContainer = box->addRow(
object_ptr<Ui::FixedHeightWidget>(
box,
kVisibleButtonsCount
* (stButton.height
+ stButton.padding.top()
+ stButton.padding.bottom())),
style::margins());
const auto scroll = Ui::CreateChild<Ui::ScrollArea>(
scrollContainer,
st::boxScroll);
const auto buttonsContainer = scroll->setOwnedWidget(
object_ptr<Ui::VerticalLayout>(scroll));
scrollContainer->sizeValue(
) | rpl::start_with_next([=](const QSize &s) {
scroll->resize(s.width(), s.height());
buttonsContainer->resizeToWidth(s.width());
}, scroll->lifetime());
const auto container = box->verticalLayout();
const auto check = Ui::CreateChild<Ui::RpWidget>(buttonsContainer.data());
const auto check = Ui::CreateChild<Ui::RpWidget>(container.get());
check->resize(st::settingsReactionCornerSize);
check->setAttribute(Qt::WA_TransparentForMouseEvents);
check->paintRequest(
@@ -432,9 +420,9 @@ void ReactionsSettingsBox(
auto firstCheckedButton = (Ui::RpWidget*)(nullptr);
for (const auto &r : reactions.list(Data::Reactions::Type::Active)) {
const auto button = Settings::AddButton(
buttonsContainer,
container,
rpl::single<QString>(base::duplicate(r.title)),
stButton);
st::settingsButton);
const auto iconSize = st::settingsReactionSize;
AddReactionLottieIcon(
@@ -472,11 +460,6 @@ void ReactionsSettingsBox(
}
check->raise();
Ui::SetupShadowsToScrollContent(
scrollContainer,
scroll,
buttonsContainer->heightValue());
box->setTitle(tr::lng_settings_chat_reactions_title());
box->setWidth(st::boxWideWidth);
box->addButton(tr::lng_settings_save(), [=] {

View File

@@ -39,7 +39,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_menu_icons.h"
#include "styles/style_boxes.h"
#include "styles/style_layers.h"
#include "styles/style_window.h"
#include "styles/style_settings.h"
namespace {
@@ -276,7 +276,7 @@ void RingtonesBox(
tr::lng_ringtones_box_upload_button(),
st::ringtonesBoxButton,
{
&st::mainMenuAddAccount,
&st::settingsIconAdd,
0,
Settings::IconType::Round,
&st::windowBgActive

View File

@@ -37,6 +37,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace tgcalls {
class InstanceImpl;
class InstanceV2Impl;
class InstanceV2ReferenceImpl;
class InstanceV2_4_0_0Impl;
class InstanceImplLegacy;
void SetLegacyGlobalServerConfig(const std::string &serverConfig);
@@ -53,6 +54,7 @@ const auto kDefaultVersion = "2.4.4"_q;
const auto Register = tgcalls::Register<tgcalls::InstanceImpl>();
const auto RegisterV2 = tgcalls::Register<tgcalls::InstanceV2Impl>();
const auto RegV2Ref = tgcalls::Register<tgcalls::InstanceV2ReferenceImpl>();
const auto RegisterV240 = tgcalls::Register<tgcalls::InstanceV2_4_0_0Impl>();
const auto RegisterLegacy = tgcalls::Register<tgcalls::InstanceImplLegacy>();

View File

@@ -1065,6 +1065,7 @@ void GroupCall::start(TimeId scheduleDate, bool rtmp) {
MTPstring(), // title
MTP_int(scheduleDate)
)).done([=](const MTPUpdates &result) {
_reloadedStaleCall = true;
_acceptFields = true;
_peer->session().api().applyUpdates(result);
_acceptFields = false;
@@ -1393,6 +1394,13 @@ void GroupCall::rejoin(not_null<PeerData*> as) {
sendSelfUpdate(SendUpdateType::CameraPaused);
}
sendPendingSelfUpdates();
if (!_reloadedStaleCall
&& _state.current() != State::Joining) {
if (const auto real = lookupReal()) {
_reloadedStaleCall = true;
real->reloadIfStale();
}
}
}).fail([=](const MTP::Error &error) {
_joinState.finish();

View File

@@ -674,6 +674,7 @@ private:
bool _hadJoinedState = false;
bool _listenersHidden = false;
bool _rtmp = false;
bool _reloadedStaleCall = false;
int _rtmpVolume = 0;
std::unique_ptr<Webrtc::MediaDevices> _mediaDevices;

View File

@@ -46,6 +46,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_instance.h"
#include "inline_bots/bot_attach_web_view.h"
#include "mainwidget.h"
#include "tray.h"
#include "core/file_utilities.h"
#include "core/click_handler_types.h" // ClickHandlerContext.
#include "core/crash_reports.h"
@@ -149,6 +150,7 @@ Application::Application(not_null<Launcher*> launcher)
, _langpack(std::make_unique<Lang::Instance>())
, _langCloudManager(std::make_unique<Lang::CloudManager>(langpack()))
, _emojiKeywords(std::make_unique<ChatHelpers::EmojiKeywords>())
, _tray(std::make_unique<Tray>())
, _autoLockTimer([=] { checkAutoLock(); }) {
Ui::Integration::Set(&_private->uiIntegration);
@@ -300,6 +302,8 @@ void Application::run() {
startShortcuts();
startDomain();
startTray();
_primaryWindow->widget()->show();
const auto currentGeometry = _primaryWindow->widget()->geometry();
@@ -409,6 +413,38 @@ void Application::startSystemDarkModeViewer() {
}, _lifetime);
}
void Application::startTray() {
using WindowRaw = not_null<Window::Controller*>;
const auto enumerate = [=](Fn<void(WindowRaw)> c) {
if (_primaryWindow) {
c(_primaryWindow.get());
}
for (const auto &window : ranges::views::values(_secondaryWindows)) {
c(window.get());
}
};
_tray->create();
_tray->aboutToShowRequests(
) | rpl::start_with_next([=] {
enumerate([&](WindowRaw w) { w->updateIsActive(); });
_tray->updateMenuText();
}, _primaryWindow->widget()->lifetime());
_tray->showFromTrayRequests(
) | rpl::start_with_next([=] {
const auto last = _lastActiveWindow;
enumerate([&](WindowRaw w) { w->widget()->showFromTray(); });
if (last) {
last->widget()->showFromTray();
}
}, _primaryWindow->widget()->lifetime());
_tray->hideToTrayRequests(
) | rpl::start_with_next([=] {
enumerate([&](WindowRaw w) { w->widget()->minimizeToTray(); });
}, _primaryWindow->widget()->lifetime());
}
auto Application::prepareEmojiSourceImages()
-> std::shared_ptr<Ui::Emoji::UniversalImages> {
const auto &images = Ui::Emoji::SourceImages();
@@ -427,6 +463,16 @@ void Application::clearEmojiSourceImages() {
});
}
bool Application::isActiveForTrayMenu() const {
if (_primaryWindow) {
return _primaryWindow->widget()->isActiveForTrayMenu();
}
return ranges::any_of(ranges::views::values(_secondaryWindows), [=](
const std::unique_ptr<Window::Controller> &controller) {
return controller->widget()->isActiveForTrayMenu();
});
}
bool Application::hideMediaView() {
if (_mediaView && !_mediaView->isHidden()) {
_mediaView->hide();

View File

@@ -103,6 +103,7 @@ namespace Core {
class Launcher;
struct LocalUrlHandler;
class Tray;
enum class LaunchState {
Running,
@@ -147,6 +148,9 @@ public:
[[nodiscard]] Data::DownloadManager &downloadManager() const {
return *_downloadManager;
}
[[nodiscard]] Tray &tray() const {
return *_tray;
}
// Windows interface.
bool hasActiveWindow(not_null<Main::Session*> session) const;
@@ -163,6 +167,7 @@ public:
[[nodiscard]] QWidget *getFileDialogParent();
void notifyFileDialogShown(bool shown);
void checkSystemDarkMode();
[[nodiscard]] bool isActiveForTrayMenu() const;
// Media view interface.
void checkMediaViewActivation();
@@ -316,6 +321,7 @@ private:
void startDomain();
void startEmojiImageLoader();
void startSystemDarkModeViewer();
void startTray();
friend void QuitAttempt();
void quitDelayed();
@@ -376,6 +382,8 @@ private:
std::unique_ptr<Lang::Translator> _translator;
QPointer<Ui::BoxContent> _badProxyDisableBox;
const std::unique_ptr<Tray> _tray;
std::unique_ptr<Media::Player::FloatController> _floatPlayers;
Media::Player::FloatDelegate *_defaultFloatPlayerDelegate = nullptr;
Media::Player::FloatDelegate *_replacementFloatPlayerDelegate = nullptr;

View File

@@ -121,6 +121,14 @@ std::map<int, const char*> BetaLogs() {
"- Fix group and channel photo upload.\n"
"- Test hardware video decoding.\n"
},
{
3007004,
"- More icons for chat folders.\n"
"- Improve some more sections design.\n"
"- Update the OpenAL library to 1.22.0.\n"
}
};
};

View File

@@ -44,17 +44,9 @@ PreLaunchWindow::PreLaunchWindow(QString title) {
p.setColor(QPalette::Window, QColor(255, 255, 255));
setPalette(p);
constexpr auto processDpi = [](const QDpi &dpi) {
return (dpi.first + dpi.second) * 0.5;
};
const auto screen = QGuiApplication::primaryScreen();
const auto scale = processDpi(screen->handle()->logicalDpi())
/ processDpi(screen->handle()->logicalBaseDpi());
auto font = QGuiApplication::font();
font.setPixelSize(base::SafeRound(font.pointSize() * scale));
const auto dpi = screen()->handle()->logicalDpi().second;
auto font = this->font();
font.setPixelSize(base::SafeRound(std::floor(font.pointSizeF() * dpi / 72. * 100. + 0.5) / 100.));
_size = QFontMetrics(font).height();
int paddingVertical = (_size / 2);
@@ -110,12 +102,12 @@ PreLaunchInput::PreLaunchInput(QWidget *parent, bool password) : QLineEdit(paren
setFont(logFont);
QPalette p(palette());
p.setColor(QPalette::Window, QColor(255, 255, 255));
p.setColor(QPalette::Base, QColor(255, 255, 255));
p.setColor(QPalette::WindowText, QColor(0, 0, 0));
p.setColor(QPalette::Text, QColor(0, 0, 0));
setPalette(p);
setStyleSheet("QLineEdit { background-color: white; }");
QLineEdit::setTextMargins(0, 0, 0, 0);
setContentsMargins(0, 0, 0, 0);
if (password) {

View File

@@ -25,6 +25,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/sticker_set_box.h"
#include "boxes/sessions_box.h"
#include "boxes/language_box.h"
#include "boxes/change_phone_box.h"
#include "passport/passport_form_controller.h"
#include "window/window_session_controller.h"
#include "ui/toast/toast.h"
@@ -40,6 +41,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "settings/settings_common.h"
#include "settings/settings_folders.h"
#include "settings/settings_main.h"
#include "settings/settings_privacy_security.h"
#include "settings/settings_chat.h"
#include "mainwidget.h"
#include "main/main_session.h"
#include "main/main_session_settings.h"
@@ -444,22 +447,30 @@ bool ResolveSettings(
}
controller->window().activate();
const auto section = match->captured(1).mid(1).toLower();
if (section.isEmpty()) {
controller->window().showSettings();
return true;
} else if (section == qstr("language")) {
ShowLanguagesBox();
return true;
} else if (section == qstr("devices")) {
controller->session().api().authorizations().reload();
const auto type = [&]() -> std::optional<::Settings::Type> {
if (section == qstr("language")) {
ShowLanguagesBox();
return {};
} else if (section == qstr("devices")) {
controller->session().api().authorizations().reload();
return ::Settings::Sessions::Id();
} else if (section == qstr("folders")) {
return ::Settings::Folders::Id();
} else if (section == qstr("privacy")) {
return ::Settings::PrivacySecurity::Id();
} else if (section == qstr("themes")) {
return ::Settings::Chat::Id();
} else if (section == qstr("change_number")) {
return ::Settings::ChangePhone::Id();
}
return ::Settings::Main::Id();
}();
if (type.has_value()) {
controller->showSettings(*type);
controller->window().activate();
}
const auto type = (section == qstr("folders"))
? ::Settings::Folders::Id()
: (section == qstr("devices"))
? ::Settings::Sessions::Id()
: ::Settings::Main::Id();
controller->showSettings(type);
controller->window().activate();
return true;
}
@@ -760,7 +771,7 @@ const std::vector<LocalUrlHandler> &LocalUrlHandlers() {
ResolvePrivatePost
},
{
qsl("^settings(/folders|/devices|/language)?$"),
qsl("^settings(/language|/devices|/folders|/privacy|/themes|/change_number)?$"),
ResolveSettings
},
{

View File

@@ -324,6 +324,14 @@ QString UiIntegration::phraseFormattingSpoiler() {
return tr::lng_menu_formatting_spoiler(tr::now);
}
QString UiIntegration::phraseButtonOk() {
return tr::lng_box_ok(tr::now);
}
QString UiIntegration::phraseButtonCancel() {
return tr::lng_cancel(tr::now);
}
bool OpenGLLastCheckFailed() {
return QFile::exists(OpenGLCheckFilePath());
}

View File

@@ -71,6 +71,8 @@ public:
QString phraseFormattingStrikeOut() override;
QString phraseFormattingMonospace() override;
QString phraseFormattingSpoiler() override;
QString phraseButtonOk() override;
QString phraseButtonCancel() override;
};

View File

@@ -22,7 +22,7 @@ constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"_cs;
constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs;
constexpr auto AppName = "Telegram Desktop"_cs;
constexpr auto AppFile = "Telegram"_cs;
constexpr auto AppVersion = 3007001;
constexpr auto AppVersionStr = "3.7.1";
constexpr auto AppBetaVersion = false;
constexpr auto AppVersion = 3007004;
constexpr auto AppVersionStr = "3.7.4";
constexpr auto AppBetaVersion = true;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;

View File

@@ -208,4 +208,8 @@ UpdatedFileReferences GetFileReferences(
return GetFileReferencesHelper(data);
}
UpdatedFileReferences GetFileReferences(const MTPMessageMedia &data) {
return GetFileReferencesHelper(data);
}
} // namespace Data

View File

@@ -179,4 +179,7 @@ UpdatedFileReferences GetFileReferences(const MTPTheme &data);
UpdatedFileReferences GetFileReferences(
const MTPaccount_SavedRingtones &data);
// Admin Log Event.
UpdatedFileReferences GetFileReferences(const MTPMessageMedia &data);
} // namespace Data

Some files were not shown because too many files have changed in this diff Show More