Compare commits
99 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c3e1568da | ||
|
|
fb2a26fb35 | ||
|
|
6c2f16e9a0 | ||
|
|
4838d1bfc9 | ||
|
|
e8b03248e1 | ||
|
|
dcd6028e91 | ||
|
|
5195b4d3ef | ||
|
|
692d115313 | ||
|
|
c207743338 | ||
|
|
f82989c9c3 | ||
|
|
c48ed2e62b | ||
|
|
d1e37864ac | ||
|
|
bcec2f6b84 | ||
|
|
6b70cc342a | ||
|
|
7d89b54d1c | ||
|
|
dd933cf61c | ||
|
|
c3b3819d9f | ||
|
|
63c61637f8 | ||
|
|
a35947141c | ||
|
|
90b3b5c3e5 | ||
|
|
21efb44e81 | ||
|
|
e6672432bb | ||
|
|
8c63feb11e | ||
|
|
68e35a6cad | ||
|
|
dbd4eaed48 | ||
|
|
9e4b752830 | ||
|
|
958d3b7c15 | ||
|
|
30ae322cf0 | ||
|
|
755325fef3 | ||
|
|
ffc557a0f9 | ||
|
|
27f015561a | ||
|
|
228e2f7031 | ||
|
|
afc98f03fa | ||
|
|
7fa1986b27 | ||
|
|
f7448bbc7f | ||
|
|
5939c54d33 | ||
|
|
d408fca96f | ||
|
|
2a1219679f | ||
|
|
120e21c126 | ||
|
|
d1d9e29ca5 | ||
|
|
bcf01cf718 | ||
|
|
daa934014c | ||
|
|
ef535ca026 | ||
|
|
843089733b | ||
|
|
6e1b6e6e53 | ||
|
|
4232fa2f6e | ||
|
|
746d58e453 | ||
|
|
f2e69d2621 | ||
|
|
8ffdfa7923 | ||
|
|
89f3b45888 | ||
|
|
a2774848ba | ||
|
|
36fc7d1991 | ||
|
|
8060c7e141 | ||
|
|
b7c4e867e8 | ||
|
|
d259656e89 | ||
|
|
540ba9bfaf | ||
|
|
0411f05c39 | ||
|
|
54c409d967 | ||
|
|
b76e5853a8 | ||
|
|
e071e2cf6f | ||
|
|
bff74452b7 | ||
|
|
c0c7b39375 | ||
|
|
695733f520 | ||
|
|
7adfe93a8d | ||
|
|
8d354382a4 | ||
|
|
5ac51efb3e | ||
|
|
e2cdb8a9ed | ||
|
|
9757489645 | ||
|
|
902dee0c2a | ||
|
|
25f90b5159 | ||
|
|
232ed0a7c0 | ||
|
|
25583fa813 | ||
|
|
61b55706ae | ||
|
|
d3420b6a92 | ||
|
|
e922e5be39 | ||
|
|
296c800b39 | ||
|
|
c39bf239ea | ||
|
|
2ab3cda743 | ||
|
|
a627ed0929 | ||
|
|
8b503d4930 | ||
|
|
6e833baf91 | ||
|
|
3dbe187f56 | ||
|
|
e569b8c5f9 | ||
|
|
2becd307df | ||
|
|
3c18532612 | ||
|
|
2f85997c9f | ||
|
|
e8ead2974b | ||
|
|
bb7730eee1 | ||
|
|
0518a456f8 | ||
|
|
8e3274cd8f | ||
|
|
cce99a96ac | ||
|
|
b84abbec08 | ||
|
|
be87118778 | ||
|
|
27a4d0f029 | ||
|
|
b842761ea3 | ||
|
|
60f45ab9b3 | ||
|
|
5f0741a0a5 | ||
|
|
ed4b9bc40b | ||
|
|
51a6ec0952 |
77
.appveyor/install.bat
Normal file
@@ -0,0 +1,77 @@
|
||||
@echo off
|
||||
|
||||
SET BUILD_DIR=C:\TBuild
|
||||
set LIB_DIR=%BUILD_DIR%\Libraries
|
||||
set SRC_DIR=%BUILD_DIR%\tdesktop
|
||||
SET QT_VERSION=5_6_2
|
||||
|
||||
cd %BUILD_DIR%
|
||||
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
|
||||
|
||||
call:configureBuild
|
||||
call:getDependencies
|
||||
call:setupGYP
|
||||
cd %SRC_DIR%
|
||||
|
||||
echo Finished!
|
||||
|
||||
GOTO:EOF
|
||||
|
||||
:: FUNCTIONS
|
||||
:logInfo
|
||||
echo [INFO] %~1
|
||||
GOTO:EOF
|
||||
|
||||
:getDependencies
|
||||
call:logInfo "Clone dependencies repository"
|
||||
git clone -q --branch=master https://github.com/telegramdesktop/dependencies_windows.git %LIB_DIR%
|
||||
cd %LIB_DIR%
|
||||
|
||||
call prepare.bat
|
||||
GOTO:EOF
|
||||
|
||||
:setupGYP
|
||||
call:logInfo "Setup GYP/Ninja and generate VS solution"
|
||||
cd %LIB_DIR%
|
||||
git clone https://chromium.googlesource.com/external/gyp
|
||||
SET PATH=%PATH%;C:\TBuild\Libraries\gyp;C:\TBuild\Libraries\ninja;
|
||||
cd %SRC_DIR%\Telegram
|
||||
call gyp\refresh.bat
|
||||
GOTO:EOF
|
||||
|
||||
:configureBuild
|
||||
call:logInfo "Configuring build"
|
||||
call:logInfo "Build version: %BUILD_VERSION%"
|
||||
set TDESKTOP_BUILD_DEFINES=
|
||||
|
||||
echo %BUILD_VERSION% | findstr /C:"disable_autoupdate">nul && (
|
||||
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_AUTOUPDATE
|
||||
)
|
||||
|
||||
echo %BUILD_VERSION% | findstr /C:"disable_register_custom_scheme">nul && (
|
||||
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
|
||||
)
|
||||
|
||||
echo %BUILD_VERSION% | findstr /C:"disable_crash_reports">nul && (
|
||||
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_CRASH_REPORTS
|
||||
)
|
||||
|
||||
echo %BUILD_VERSION% | findstr /C:"disable_network_proxy">nul && (
|
||||
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_NETWORK_PROXY
|
||||
)
|
||||
|
||||
echo %BUILD_VERSION% | findstr /C:"disable_desktop_file_generation">nul && (
|
||||
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION
|
||||
)
|
||||
|
||||
echo %BUILD_VERSION% | findstr /C:"disable_unity_integration">nul && (
|
||||
set TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES%,TDESKTOP_DISABLE_UNITY_INTEGRATION
|
||||
)
|
||||
|
||||
if not "%TDESKTOP_BUILD_DEFINES%" == "" (
|
||||
set "TDESKTOP_BUILD_DEFINES=%TDESKTOP_BUILD_DEFINES:~1%"
|
||||
)
|
||||
|
||||
call:logInfo "Build Defines: %TDESKTOP_BUILD_DEFINES%"
|
||||
GOTO:EOF
|
||||
1
.gitattributes
vendored
@@ -3,3 +3,4 @@
|
||||
|
||||
# Ensure diffs have LF endings
|
||||
*.diff text eol=lf
|
||||
*.bat text eol=crlf
|
||||
|
||||
4
.github/CONTRIBUTING.md
vendored
@@ -118,7 +118,7 @@ If you already have multiple commits, you can add the commits together (squash t
|
||||
1. Open `Git Bash` (or `Git Shell`)
|
||||
2. Enter following command to squash the recent {N} commits: `git reset --soft HEAD~{N} && git commit` (replace `{N}` with the number of commits you want to squash)
|
||||
3. Press <kbd>i</kbd> to get into Insert-mode
|
||||
4. Enter the commit message of the new commit (and add the [signature](#sign-your-work) at the and)
|
||||
4. Enter the commit message of the new commit (and add the [signature](#sign-your-work) at the end)
|
||||
5. After adding the message, press <kbd>ESC</kbd> to get out of the Insert-mode
|
||||
6. Write `:wq` and press <kbd>Enter</kbd> to save the new message or write `:q!` to discard your changes
|
||||
7. Enter `git push --force` to push the new commit to the remote repository
|
||||
@@ -154,4 +154,4 @@ Don't forget to [sign your patch](#sign-your-work) to put it in the public domai
|
||||
[help_change_commit_message]: https://help.github.com/articles/changing-a-commit-message/
|
||||
[commit_message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
||||
[pr]: https://github.com/telegramdesktop/tdesktop/compare
|
||||
[build_instructions]: https://github.com/telegramdesktop/tdesktop/blob/master/README.md#build-instructions
|
||||
[build_instructions]: https://github.com/telegramdesktop/tdesktop/blob/master/README.md#build-instructions
|
||||
|
||||
9
.github/ISSUE_TEMPLATE.md
vendored
@@ -19,8 +19,11 @@ Tell us what happens instead
|
||||
|
||||
**Version of Telegram Desktop:**
|
||||
|
||||
### Logs
|
||||
**Used theme**:
|
||||
|
||||
<details><summary>**Logs**:</summary>
|
||||
Insert logs here (if necessary)
|
||||
|
||||
You can type `debugmode` in settings and then see ~/.TelegramDesktop/DebugLogs/log_...txt for log files.
|
||||
Type `debugmode` in settings again to disable logs.
|
||||
<!-- You can type `debugmode` in settings and then see ~/.TelegramDesktop/DebugLogs/log_...txt for log files.
|
||||
Type `debugmode` in settings again to disable logs. -->
|
||||
</details>
|
||||
|
||||
@@ -35,8 +35,8 @@ addons:
|
||||
- dpatch
|
||||
- equivs
|
||||
- fakeroot
|
||||
- g++-4.9
|
||||
- gcc-4.9
|
||||
- g++-6
|
||||
- gcc-6
|
||||
- git
|
||||
- gnome-common
|
||||
- gobject-introspection
|
||||
@@ -62,8 +62,8 @@ addons:
|
||||
before_install:
|
||||
- "export TRAVIS_COMMIT_MSG=\"$(git log --format=%B --no-merges -n 1)\""
|
||||
- .travis/check.sh
|
||||
- export CXX="g++-4.9" CC="gcc-4.9"
|
||||
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
|
||||
- export CXX="g++-6" CC="gcc-6"
|
||||
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
|
||||
- sudo update-alternatives --config gcc
|
||||
- g++ --version
|
||||
|
||||
|
||||
@@ -593,7 +593,7 @@ buildTelegram() {
|
||||
|
||||
cd "$UPSTREAM/Telegram/gyp"
|
||||
"$GYP_PATH/gyp" \
|
||||
-Dtravis_defines=${GYP_DEFINES:1} \
|
||||
-Dbuild_defines=${GYP_DEFINES:1} \
|
||||
-Dlinux_path_xkbcommon=$XKB_PATH \
|
||||
-Dlinux_path_va=$VA_PATH \
|
||||
-Dlinux_path_vdpau=$VDPAU_PATH \
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# set colors
|
||||
RCol='\e[0m' # Text Reset
|
||||
|
||||
|
||||
38
README.md
@@ -2,8 +2,9 @@
|
||||
|
||||
This is the complete source code and the build instructions for the alpha version of the official desktop client for the [Telegram][telegram] messenger, based on the [Telegram API][telegram_api] and the [MTProto][telegram_proto] secure protocol.
|
||||
|
||||
[](https://badge.fury.io/gh/telegramdesktop%2Ftdesktop)
|
||||
[](https://github.com/telegramdesktop/tdesktop/releases)
|
||||
[](https://travis-ci.org/telegramdesktop/tdesktop)
|
||||
[](https://ci.appveyor.com/project/telegramdesktop/tdesktop)
|
||||
|
||||
The source code is published under GPLv3 with OpenSSL exception, the license is available [here][license].
|
||||
|
||||
@@ -38,41 +39,6 @@ The source code is published under GPLv3 with OpenSSL exception, the license is
|
||||
* [Xcode 8][xcode]
|
||||
* [GYP/CMake on GNU/Linux][cmake]
|
||||
|
||||
## Projects in Telegram solution
|
||||
|
||||
* ### Telegram
|
||||
|
||||
[Telegram Desktop][telegram_desktop] messenger
|
||||
|
||||
* ### Updater
|
||||
|
||||
A little app, that is launched by Telegram when update is ready, replaces all files and launches it back.
|
||||
|
||||
* ### Packer
|
||||
|
||||
Compiles given files to single update file, compresses it with lzma and signs with a private key. It is not built in **Debug** and **Release** configurations of Telegram solution, because private key is inaccessible.
|
||||
|
||||
* ### MetaEmoji
|
||||
|
||||
Creates four sprites and text2emoji replace code
|
||||
* SourceFiles/art/emoji.png
|
||||
* SourceFiles/art/emoji_125x.png
|
||||
* SourceFiles/art/emoji_150x.png
|
||||
* SourceFiles/art/emoji_200x.png
|
||||
* SourceFiles/art/emoji_250x.png
|
||||
* SourceFiles/ui/emoji_config.cpp
|
||||
|
||||
* ### codegen_style
|
||||
* ### codegen_numbers
|
||||
|
||||
Helper code generating console utilities.
|
||||
|
||||
* ### MetaLang
|
||||
|
||||
Creates from languagepack file `Resources/lang.strings` language constants code and language file parse code:
|
||||
* GeneratedFiles/lang.h
|
||||
* GeneratedFiles/lang.cpp
|
||||
|
||||
[//]: # (LINKS)
|
||||
[telegram]: https://telegram.org
|
||||
[telegram_desktop]: https://desktop.telegram.org
|
||||
|
||||
20
Telegram/Patches/macold/crashpad.diff
Normal file
@@ -0,0 +1,20 @@
|
||||
diff --git a/build/crashpad.gypi b/build/crashpad.gypi
|
||||
index 027c7b6..4bfdfb5 100644
|
||||
--- a/build/crashpad.gypi
|
||||
+++ b/build/crashpad.gypi
|
||||
@@ -25,5 +25,15 @@
|
||||
4201, # nonstandard extension used : nameless struct/union.
|
||||
4324, # structure was padded due to __declspec(align()).
|
||||
],
|
||||
+ 'xcode_settings': {
|
||||
+ 'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ],
|
||||
+ 'OTHER_LDFLAGS': [
|
||||
+ '/usr/local/macold/lib/libc++.a',
|
||||
+ '/usr/local/macold/lib/libc++abi.a',
|
||||
+ ],
|
||||
+ },
|
||||
+ 'include_dirs': [
|
||||
+ '/usr/local/macold/include/c++/v1',
|
||||
+ ],
|
||||
},
|
||||
}
|
||||
26
Telegram/Patches/macold/mini_chromium.diff
Normal file
@@ -0,0 +1,26 @@
|
||||
diff --git a/build/common.gypi b/build/common.gypi
|
||||
index 1affc70..c0d2f6a 100644
|
||||
--- a/build/common.gypi
|
||||
+++ b/build/common.gypi
|
||||
@@ -66,6 +66,11 @@
|
||||
'conditions': [
|
||||
['clang!=0', {
|
||||
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11
|
||||
+ 'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ],
|
||||
+ 'OTHER_LDFLAGS': [
|
||||
+ '/usr/local/macold/lib/libc++.a',
|
||||
+ '/usr/local/macold/lib/libc++abi.a',
|
||||
+ ],
|
||||
|
||||
# Don't link in libarclite_macosx.a, see http://crbug.com/156530.
|
||||
'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime
|
||||
@@ -116,6 +121,9 @@
|
||||
],
|
||||
|
||||
},
|
||||
+ 'include_dirs': [
|
||||
+ '/usr/local/macold/include/c++/v1',
|
||||
+ ],
|
||||
}],
|
||||
|
||||
['OS=="linux"', {
|
||||
@@ -13,16 +13,21 @@ index cb8d78f..cadb3f0 100755
|
||||
echo " Xcode not set up properly. You may need to confirm the license" >&2
|
||||
echo " agreement by running /usr/bin/xcodebuild without arguments." >&2
|
||||
diff --git a/mkspecs/common/g++-macx.conf b/mkspecs/common/g++-macx.conf
|
||||
index 086510d..ae4f81a 100644
|
||||
index 086510d..c485967 100644
|
||||
--- a/mkspecs/common/g++-macx.conf
|
||||
+++ b/mkspecs/common/g++-macx.conf
|
||||
@@ -14,7 +14,8 @@ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -gdwarf-2
|
||||
@@ -14,7 +14,13 @@ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -gdwarf-2
|
||||
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -gdwarf-2
|
||||
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += -g -gdwarf-2
|
||||
|
||||
-QMAKE_LFLAGS_STATIC_LIB += -all_load
|
||||
+# Patch: Don't remember :(
|
||||
+#QMAKE_LFLAGS_STATIC_LIB += -all_load
|
||||
+
|
||||
+# Patch: Use C++14 with custom libc++ build.
|
||||
+QMAKE_CXXFLAGS_CXX11 = -std=c++1y
|
||||
+QMAKE_CXXFLAGS += -nostdinc++ -I/usr/local/macold/include/c++/v1
|
||||
+QMAKE_LFLAGS += /usr/local/macold/lib/libc++.a /usr/local/macold/lib/libc++abi.a
|
||||
|
||||
QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvmgcc42
|
||||
|
||||
@@ -238,6 +243,19 @@ index 92358ec..694fee7 100644
|
||||
}
|
||||
|
||||
- (void)appleEventQuit:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
|
||||
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm
|
||||
index b81b9a0..4e59e83 100644
|
||||
--- a/src/plugins/platforms/cocoa/qcocoacursor.mm
|
||||
+++ b/src/plugins/platforms/cocoa/qcocoacursor.mm
|
||||
@@ -81,7 +81,7 @@ void QCocoaCursor::setPos(const QPoint &position)
|
||||
pos.x = position.x();
|
||||
pos.y = position.y();
|
||||
|
||||
- CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0);
|
||||
+ CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft);
|
||||
CGEventPost(kCGHIDEventTap, e);
|
||||
CFRelease(e);
|
||||
}
|
||||
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
|
||||
index 9fd05a6..dea6072 100644
|
||||
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
|
||||
@@ -297,7 +315,7 @@ index e46eaff..c62db53 100644
|
||||
}
|
||||
return ret;
|
||||
diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
|
||||
index 83c960d..3b9f8d4 100755
|
||||
index 83c960d..03ae969 100755
|
||||
--- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
|
||||
+++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
|
||||
@@ -102,7 +102,10 @@ QT_USE_NAMESPACE
|
||||
@@ -343,7 +361,7 @@ index 83c960d..3b9f8d4 100755
|
||||
void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon)
|
||||
{
|
||||
if (!m_sys)
|
||||
@@ -194,13 +214,17 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon)
|
||||
@@ -194,13 +214,18 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon)
|
||||
|
||||
m_sys->item->icon = icon;
|
||||
|
||||
@@ -351,11 +369,13 @@ index 83c960d..3b9f8d4 100755
|
||||
+ // Patch: Nice macOS tray icon support.
|
||||
+ //const bool menuVisible = m_sys->item->menu && m_sys->item->menuVisible;
|
||||
|
||||
CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
|
||||
- CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
|
||||
- const short scale = hgt - 4;
|
||||
+ const int padding = 0;
|
||||
+ const int menuHeight = [[NSStatusBar systemStatusBar] thickness];
|
||||
+ const int maxImageHeight = menuHeight - padding;
|
||||
+
|
||||
+ // Patch: Nice macOS tray icon support.
|
||||
+ const short scale = hgt * getDevicePixelRatio();
|
||||
+ const short scale = maxImageHeight * getDevicePixelRatio();
|
||||
|
||||
QPixmap pm = m_sys->item->icon.pixmap(QSize(scale, scale),
|
||||
- menuVisible ? QIcon::Selected : QIcon::Normal);
|
||||
@@ -364,7 +384,7 @@ index 83c960d..3b9f8d4 100755
|
||||
if (pm.isNull()) {
|
||||
pm = QPixmap(scale, scale);
|
||||
pm.fill(Qt::transparent);
|
||||
@@ -322,15 +346,13 @@ QT_END_NAMESPACE
|
||||
@@ -322,15 +347,16 @@ QT_END_NAMESPACE
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -374,18 +394,21 @@ index 83c960d..3b9f8d4 100755
|
||||
{
|
||||
- Q_UNUSED(notification);
|
||||
- down = NO;
|
||||
-
|
||||
CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
|
||||
+ const int padding = 0;
|
||||
+ const int menuHeight = [[NSStatusBar systemStatusBar] thickness];
|
||||
+ const int maxImageHeight = menuHeight - padding;
|
||||
|
||||
- CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
|
||||
- const short scale = hgt - 4;
|
||||
-
|
||||
- QPixmap pm = parent->icon.pixmap(QSize(scale, scale), QIcon::Normal);
|
||||
+ const short scale = hgt * getDevicePixelRatio();
|
||||
+ const short scale = maxImageHeight * getDevicePixelRatio();
|
||||
+ QPixmap pm = parent->icon.pixmap(QSize(scale, scale),
|
||||
+ parent->iconSelected ? QIcon::Selected : QIcon::Normal);
|
||||
if (pm.isNull()) {
|
||||
pm = QPixmap(scale, scale);
|
||||
pm.fill(Qt::transparent);
|
||||
@@ -338,9 +360,19 @@ QT_END_NAMESPACE
|
||||
@@ -338,9 +364,19 @@ QT_END_NAMESPACE
|
||||
NSImage *nsaltimage = static_cast<NSImage *>(qt_mac_create_nsimage(pm));
|
||||
[self setImage: nsaltimage];
|
||||
[nsaltimage release];
|
||||
@@ -405,7 +428,7 @@ index 83c960d..3b9f8d4 100755
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
@@ -350,18 +382,9 @@ QT_END_NAMESPACE
|
||||
@@ -350,18 +386,9 @@ QT_END_NAMESPACE
|
||||
int clickCount = [mouseEvent clickCount];
|
||||
[self setNeedsDisplay:YES];
|
||||
|
||||
@@ -427,7 +450,7 @@ index 83c960d..3b9f8d4 100755
|
||||
|
||||
if (clickCount == 2) {
|
||||
[self menuTrackingDone:nil];
|
||||
@@ -380,6 +403,10 @@ QT_END_NAMESPACE
|
||||
@@ -380,6 +407,10 @@ QT_END_NAMESPACE
|
||||
{
|
||||
Q_UNUSED(mouseEvent);
|
||||
[self menuTrackingDone:nil];
|
||||
@@ -438,7 +461,7 @@ index 83c960d..3b9f8d4 100755
|
||||
}
|
||||
|
||||
- (void)rightMouseDown:(NSEvent *)mouseEvent
|
||||
@@ -391,6 +418,10 @@ QT_END_NAMESPACE
|
||||
@@ -391,6 +422,10 @@ QT_END_NAMESPACE
|
||||
{
|
||||
Q_UNUSED(mouseEvent);
|
||||
[self menuTrackingDone:nil];
|
||||
@@ -449,7 +472,7 @@ index 83c960d..3b9f8d4 100755
|
||||
}
|
||||
|
||||
- (void)otherMouseDown:(NSEvent *)mouseEvent
|
||||
@@ -405,7 +436,8 @@ QT_END_NAMESPACE
|
||||
@@ -405,7 +440,8 @@ QT_END_NAMESPACE
|
||||
}
|
||||
|
||||
-(void)drawRect:(NSRect)rect {
|
||||
|
Before Width: | Height: | Size: 762 KiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 2.4 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 2.3 MiB |
|
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 3.2 MiB |
|
Before Width: | Height: | Size: 20 KiB |
@@ -24,6 +24,9 @@ TextPalette {
|
||||
linkFg: color;
|
||||
monoFg: color;
|
||||
selectBg: color;
|
||||
selectFg: color;
|
||||
selectLinkFg: color;
|
||||
selectMonoFg: color;
|
||||
selectOverlay: color;
|
||||
}
|
||||
|
||||
@@ -52,6 +55,9 @@ defaultTextPalette: TextPalette {
|
||||
linkFg: windowActiveTextFg;
|
||||
monoFg: windowSubTextFg;
|
||||
selectBg: msgInBgSelected;
|
||||
selectFg: transparent; // use painter current pen instead
|
||||
selectLinkFg: historyLinkInFgSelected;
|
||||
selectMonoFg: msgInMonoFgSelected;
|
||||
selectOverlay: msgSelectOverlay;
|
||||
}
|
||||
defaultTextStyle: TextStyle {
|
||||
@@ -125,6 +131,9 @@ serviceTextPalette: TextPalette(defaultTextPalette) {
|
||||
linkFg: msgServiceFg;
|
||||
monoFg: msgServiceFg;
|
||||
selectBg: msgServiceBgSelected;
|
||||
selectFg: msgServiceFg;
|
||||
selectLinkFg: msgServiceFg;
|
||||
selectMonoFg: msgServiceFg;
|
||||
selectOverlay: msgServiceBgSelected;
|
||||
}
|
||||
serviceTextStyle: TextStyle(defaultTextStyle) {
|
||||
@@ -133,15 +142,31 @@ serviceTextStyle: TextStyle(defaultTextStyle) {
|
||||
linkFontOver: font(fsize semibold underline);
|
||||
}
|
||||
inTextPalette: TextPalette(defaultTextPalette) {
|
||||
linkFg: historyLinkInFg;
|
||||
monoFg: msgInMonoFg;
|
||||
selectBg: msgInBgSelected;
|
||||
selectFg: historyTextInFgSelected;
|
||||
selectLinkFg: historyLinkInFgSelected;
|
||||
selectMonoFg: msgInMonoFgSelected;
|
||||
selectOverlay: msgSelectOverlay;
|
||||
}
|
||||
inTextPaletteSelected: TextPalette(inTextPalette) {
|
||||
linkFg: historyLinkInFgSelected;
|
||||
monoFg: msgInMonoFgSelected;
|
||||
}
|
||||
outTextPalette: TextPalette(defaultTextPalette) {
|
||||
linkFg: historyLinkOutFg;
|
||||
monoFg: msgOutMonoFg;
|
||||
selectBg: msgOutBgSelected;
|
||||
selectFg: historyTextOutFgSelected;
|
||||
selectLinkFg: historyLinkOutFgSelected;
|
||||
selectMonoFg: msgOutMonoFgSelected;
|
||||
selectOverlay: msgSelectOverlay;
|
||||
}
|
||||
outTextPaletteSelected: TextPalette(outTextPalette) {
|
||||
linkFg: historyLinkOutFgSelected;
|
||||
monoFg: msgOutMonoFgSelected;
|
||||
}
|
||||
fwdTextStyle: TextStyle(semiboldTextStyle) {
|
||||
linkFontOver: semiboldFont;
|
||||
}
|
||||
@@ -268,8 +293,6 @@ toastFadeOutDuration: 1000;
|
||||
|
||||
historyReplyCancelIcon: icon {{ "box_button_close", historyReplyCancelFg }};
|
||||
historyReplyCancelIconOver: icon {{ "box_button_close", historyReplyCancelFgOver }};
|
||||
boxSearchCancelIcon: icon {{ "box_button_close", boxSearchCancelIconFg }};
|
||||
boxSearchCancelIconOver: icon {{ "box_button_close", boxSearchCancelIconFgOver }};
|
||||
boxTitleCloseIcon: icon {{ "box_button_close", boxTitleCloseFg }};
|
||||
boxTitleCloseIconOver: icon {{ "box_button_close", boxTitleCloseFgOver }};
|
||||
|
||||
@@ -277,3 +300,5 @@ notifyFadeRight: icon {{ "fade_horizontal", notificationBg }};
|
||||
|
||||
stickerIconLeft: icon {{ "fade_horizontal-flip_horizontal", emojiPanCategories }};
|
||||
stickerIconRight: icon {{ "fade_horizontal", emojiPanCategories }};
|
||||
|
||||
transparentPlaceholderSize: 4px;
|
||||
|
||||
@@ -21,468 +21,484 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
|
||||
// basic
|
||||
windowBg: #ffffff; // white: fallback for background
|
||||
windowFg: #000000; // black: fallback for text color
|
||||
windowBgOver: #f1f1f1; // light gray: fallback for over background
|
||||
windowFg: #000000; // black: fallback for text
|
||||
windowBgOver: #f1f1f1; // light gray: fallback for background with mouse over
|
||||
windowBgRipple: #e5e5e5; // darker gray: fallback for ripple effect
|
||||
windowFgOver: windowFg; // black: fallback for over text color
|
||||
windowSubTextFg: #999999; // gray: fallback for subtext color
|
||||
windowSubTextFgOver: #919191; // gray over light blue: fallback for subtext over color
|
||||
windowBoldFg: #222222; // dark gray: fallback for bold text color
|
||||
windowBoldFgOver: #222222; // dark gray: fallback for over bold text color
|
||||
windowFgOver: windowFg; // black: fallback for text with mouse over
|
||||
windowSubTextFg: #999999; // gray: fallback for additional text
|
||||
windowSubTextFgOver: #919191; // darker gray: fallback for additional text with mouse over
|
||||
windowBoldFg: #222222; // dark gray: fallback for bold text
|
||||
windowBoldFgOver: #222222; // dark gray: fallback for bold text with mouse over
|
||||
windowBgActive: #40a7e3; // bright blue: fallback for blue filled active areas
|
||||
windowFgActive: #ffffff; // text on bright blue: fallback for text on active areas
|
||||
windowActiveTextFg: #168acd; // online blue: fallback for active color
|
||||
windowShadowFg: #000000; // black: fallback for shadow color
|
||||
windowFgActive: #ffffff; // white: fallback for text on active areas
|
||||
windowActiveTextFg: #168acd; // online blue: fallback for active text like online status
|
||||
windowShadowFg: #000000; // black: fallback for shadow
|
||||
windowShadowFgFallback: #f1f1f1; // gray: fallback for shadow without opacity
|
||||
|
||||
shadowFg: #00000018;
|
||||
slideFadeOutBg: #0000003c;
|
||||
slideFadeOutShadowFg: windowShadowFg;
|
||||
shadowFg: #00000018; // most shadows (including opacity)
|
||||
slideFadeOutBg: #0000003c; // slide animation (chat to profile) fade out filling
|
||||
slideFadeOutShadowFg: windowShadowFg; // slide animation (chat to profile) fade out right section shadow
|
||||
|
||||
imageBg: #000000;
|
||||
imageBgTransparent: #ffffff;
|
||||
imageBg: #000000; // image background fallback (when photo size is less than minimum allowed)
|
||||
imageBgTransparent: #ffffff; // image background when displaying an image with opacity where no opacity is needed
|
||||
|
||||
// widgets
|
||||
activeButtonBg: windowBgActive;
|
||||
activeButtonBgOver: #39a5db;
|
||||
activeButtonBgRipple: #2095d0;
|
||||
activeButtonFg: windowFgActive;
|
||||
activeButtonFgOver: activeButtonFg;
|
||||
activeButtonSecondaryFg: #cceeff;
|
||||
activeButtonSecondaryFgOver: activeButtonSecondaryFg;
|
||||
activeLineFg: #37a1de;
|
||||
activeLineFgError: #e48383;
|
||||
activeButtonBg: windowBgActive; // default active button background
|
||||
activeButtonBgOver: #39a5db; // default active button background with mouse over
|
||||
activeButtonBgRipple: #2095d0; // default active button ripple effect
|
||||
activeButtonFg: windowFgActive; // default active button text
|
||||
activeButtonFgOver: activeButtonFg; // default active button text with mouse over
|
||||
activeButtonSecondaryFg: #cceeff; // default active button additional text (selected messages counter in forward / delete buttons)
|
||||
activeButtonSecondaryFgOver: activeButtonSecondaryFg; // default active button additional text with mouse over
|
||||
activeLineFg: #37a1de; // default active line (like code input field bottom border when you log in and field is focused)
|
||||
activeLineFgError: #e48383; // default active line for error state (like code input field bottom border when you log in and you've entered incorrect code)
|
||||
|
||||
lightButtonBg: windowBg;
|
||||
lightButtonBgOver: #e3f1fa;
|
||||
lightButtonBgRipple: #c9e4f6;
|
||||
lightButtonFg: windowActiveTextFg;
|
||||
lightButtonFgOver: lightButtonFg;
|
||||
lightButtonBg: windowBg; // default light button background (like buttons in boxes)
|
||||
lightButtonBgOver: #e3f1fa; // default light button background with mouse over
|
||||
lightButtonBgRipple: #c9e4f6; // default light button ripple effect
|
||||
lightButtonFg: windowActiveTextFg; // default light button text
|
||||
lightButtonFgOver: lightButtonFg; // default light button text with mouse over
|
||||
|
||||
attentionButtonFg: #d14e4e;
|
||||
attentionButtonFgOver: #d14e4e;
|
||||
attentionButtonBgOver: #fcdfde;
|
||||
attentionButtonBgRipple: #f4c3c2;
|
||||
attentionButtonFg: #d14e4e; // default attention button text (like confirm button on log out)
|
||||
attentionButtonFgOver: #d14e4e; // default attention button text with mouse over
|
||||
attentionButtonBgOver: #fcdfde; // default attention button background with mouse over
|
||||
attentionButtonBgRipple: #f4c3c2; // default attention button ripple effect
|
||||
|
||||
outlineButtonBg: windowBg;
|
||||
outlineButtonBgOver: lightButtonBgOver;
|
||||
outlineButtonOutlineFg: windowBgActive;
|
||||
outlineButtonBgRipple: lightButtonBgRipple;
|
||||
outlineButtonBg: windowBg; // default left outlined button background (like shared media links in profiles)
|
||||
outlineButtonBgOver: lightButtonBgOver; // default left outlined button background with mouse over
|
||||
outlineButtonOutlineFg: windowBgActive; // default left outlined button left outline border
|
||||
outlineButtonBgRipple: lightButtonBgRipple; // default left outlined button ripple effect
|
||||
|
||||
menuBg: windowBg;
|
||||
menuBgOver: windowBgOver;
|
||||
menuBgRipple: windowBgRipple;
|
||||
menuIconFg: #a8a8a8;
|
||||
menuIconFgOver: #999999;
|
||||
menuSubmenuArrowFg: #373737;
|
||||
menuFgDisabled: #cccccc;
|
||||
menuSeparatorFg: #f1f1f1;
|
||||
menuBg: windowBg; // default popup menu background
|
||||
menuBgOver: windowBgOver; // default popup menu item background with mouse over
|
||||
menuBgRipple: windowBgRipple; // default popup menu item ripple effect
|
||||
menuIconFg: #a8a8a8; // default popup menu item icon (like main menu)
|
||||
menuIconFgOver: #999999; // default popup menu item icon with mouse over
|
||||
menuSubmenuArrowFg: #373737; // default popup menu submenu arrow icon (like in message field context menu in case of RTL system language)
|
||||
menuFgDisabled: #cccccc; // default popup menu item disabled text (like unavailable items in message field context menu)
|
||||
menuSeparatorFg: #f1f1f1; // default popup menu separator (like in message field context menu)
|
||||
|
||||
scrollBarBg: #00000053;
|
||||
scrollBarBgOver: #0000007a;
|
||||
scrollBg: #0000001a;
|
||||
scrollBgOver: #0000002c;
|
||||
scrollBarBg: #00000053; // default scroll bar current rectangle, the bar itself (like in chats list)
|
||||
scrollBarBgOver: #0000007a; // default scroll bar current rectangle with mouse over it
|
||||
scrollBg: #0000001a; // default scroll bar background
|
||||
scrollBgOver: #0000002c; // default scroll bar background with mouse over the scroll bar
|
||||
|
||||
smallCloseIconFg: #c7c7c7;
|
||||
smallCloseIconFgOver: #a3a3a3;
|
||||
smallCloseIconFg: #c7c7c7; // small X icon (like in Show all sessions box to the right for sessions termination)
|
||||
smallCloseIconFgOver: #a3a3a3; // small X icon with mouse over
|
||||
|
||||
radialFg: windowFgActive;
|
||||
radialBg: #00000056;
|
||||
radialFg: windowFgActive; // default radial loader line (like in Media Viewer when loading a photo)
|
||||
radialBg: #00000056; // default radial loader background (like in Media Viewer when loading a photo)
|
||||
|
||||
placeholderFg: windowSubTextFg;
|
||||
placeholderFgActive: #aaaaaa;
|
||||
inputBorderFg: #e0e0e0;
|
||||
filterInputBorderFg: #54c3f3;
|
||||
filterInputInactiveBg: windowBgOver;
|
||||
checkboxFg: #b3b3b3;
|
||||
placeholderFg: windowSubTextFg; // default input field placeholder when field is not focused (like in phone input field when you log in)
|
||||
placeholderFgActive: #aaaaaa; // default input field placeholder when field is focused
|
||||
inputBorderFg: #e0e0e0; // default input field bottom border (like in code input field when you log in and field is not focused)
|
||||
filterInputBorderFg: #54c3f3; // default rounded input field border (like in chats list search field when field is focused)
|
||||
filterInputInactiveBg: windowBgOver; // default rounded input field background (like in chats list search field when field is inactive)
|
||||
checkboxFg: #b3b3b3; // default unchecked checkbox rounded rectangle (and also emoji category icons)
|
||||
|
||||
sliderBgInactive: #e1eaef;
|
||||
sliderBgActive: windowBgActive;
|
||||
sliderBgInactive: #e1eaef; // default slider not active bar (like in Settings when you choose interface scale or custom notifications count)
|
||||
sliderBgActive: windowBgActive; // default slider active bar (like in Settings when you choose interface scale or custom notifications count)
|
||||
|
||||
tooltipBg: #eef2f5;
|
||||
tooltipFg: #5d6c80;
|
||||
tooltipBorderFg: #c9d1db;
|
||||
tooltipBg: #eef2f5; // tooltip background (like when you put mouse over the message timestamp and wait)
|
||||
tooltipFg: #5d6c80; // tooltip text
|
||||
tooltipBorderFg: #c9d1db; // tooltip border
|
||||
|
||||
// custom title bar for Windows and macOS
|
||||
titleShadow: #00000003;
|
||||
titleBg: windowBgOver;
|
||||
titleBgActive: titleBg;
|
||||
titleButtonBg: titleBg;
|
||||
titleButtonFg: #ababab;
|
||||
titleButtonBgOver: #e5e5e5;
|
||||
titleButtonFgOver: #9a9a9a;
|
||||
titleButtonBgActive: titleButtonBg;
|
||||
titleButtonFgActive: titleButtonFg;
|
||||
titleButtonBgActiveOver: titleButtonBgOver;
|
||||
titleButtonFgActiveOver: titleButtonFgOver;
|
||||
titleButtonCloseBg: titleButtonBg;
|
||||
titleButtonCloseFg: titleButtonFg;
|
||||
titleButtonCloseBgOver: #e81123;
|
||||
titleButtonCloseFgOver: windowFgActive;
|
||||
titleButtonCloseBgActive: titleButtonCloseBg;
|
||||
titleButtonCloseFgActive: titleButtonCloseFg;
|
||||
titleButtonCloseBgActiveOver: titleButtonCloseBgOver;
|
||||
titleButtonCloseFgActiveOver: titleButtonCloseFgOver;
|
||||
titleFg: #acacac;
|
||||
titleFgActive: #3e3c3e;
|
||||
titleShadow: #00000003; // one pixel line shadow at the bottom of custom window title
|
||||
titleBg: windowBgOver; // custom window title background when window is inactive
|
||||
titleBgActive: titleBg; // custom window title background when window is active
|
||||
titleButtonBg: titleBg; // custom window title minimize/maximize/restore button background when window is inactive (Windows only)
|
||||
titleButtonFg: #ababab; // custom window title minimize/maximize/restore button icon when window is inactive (Windows only)
|
||||
titleButtonBgOver: #e5e5e5; // custom window title minimize/maximize/restore button background with mouse over when window is inactive (Windows only)
|
||||
titleButtonFgOver: #9a9a9a; // custom window title minimize/maximize/restore button icon with mouse over when window is inactive (Windows only)
|
||||
titleButtonBgActive: titleButtonBg; // custom window title minimize/maximize/restore button background when window is active (Windows only)
|
||||
titleButtonFgActive: titleButtonFg; // custom window title minimize/maximize/restore button icon when window is active (Windows only)
|
||||
titleButtonBgActiveOver: titleButtonBgOver; // custom window title minimize/maximize/restore button background with mouse over when window is active (Windows only)
|
||||
titleButtonFgActiveOver: titleButtonFgOver; // custom window title minimize/maximize/restore button icon with mouse over when window is active (Windows only)
|
||||
titleButtonCloseBg: titleButtonBg; // custom window title close button background when window is inactive (Windows only)
|
||||
titleButtonCloseFg: titleButtonFg; // custom window title close button icon when window is inactive (Windows only)
|
||||
titleButtonCloseBgOver: #e81123; // custom window title close button background with mouse over when window is inactive (Windows only)
|
||||
titleButtonCloseFgOver: windowFgActive; // custom window title close button icon with mouse over when window is inactive (Windows only)
|
||||
titleButtonCloseBgActive: titleButtonCloseBg; // custom window title close button background when window is active (Windows only)
|
||||
titleButtonCloseFgActive: titleButtonCloseFg; // custom window title close button icon when window is active (Windows only)
|
||||
titleButtonCloseBgActiveOver: titleButtonCloseBgOver; // custom window title close button background with mouse over when window is active (Windows only)
|
||||
titleButtonCloseFgActiveOver: titleButtonCloseFgOver; // custom window title close button icon with mouse over when window is active (Windows only)
|
||||
titleFg: #acacac; // custom window title text when window is inactive (macOS only)
|
||||
titleFgActive: #3e3c3e; // custom window title text when window is active (macOS only)
|
||||
|
||||
// tray icon
|
||||
trayCounterBg: #f23c34;
|
||||
trayCounterBgMute: #888888;
|
||||
trayCounterFg: #ffffff;
|
||||
trayCounterBgMacInvert: #ffffff;
|
||||
trayCounterFgMacInvert: #ffffff01;
|
||||
trayCounterBg: #f23c34; // tray icon counter background
|
||||
trayCounterBgMute: #888888; // tray icon counter background if all unread messages are muted
|
||||
trayCounterFg: #ffffff; // tray icon counter text
|
||||
trayCounterBgMacInvert: #ffffff; // tray icon counter background when tray icon is pressed or when dark theme of macOS is used (macOS only)
|
||||
trayCounterFgMacInvert: #ffffff01; // tray icon counter text when tray icon is pressed or when dark theme of macOS is used (macOS only)
|
||||
|
||||
// layers
|
||||
layerBg: #0000007f;
|
||||
layerBg: #0000007f; // box and main menu background layer fade
|
||||
|
||||
cancelIconFg: menuIconFg;
|
||||
cancelIconFgOver: menuIconFgOver;
|
||||
cancelIconFg: menuIconFg; // default for settings close icon and box search cancel icon
|
||||
cancelIconFgOver: menuIconFgOver; // default for settings close icon and box search cancel icon with mouse over
|
||||
|
||||
// boxes
|
||||
boxBg: windowBg;
|
||||
boxTextFg: windowFg;
|
||||
boxTextFgGood: #4ab44a;
|
||||
boxTextFgError: #d84d4d;
|
||||
boxTitleFg: #404040;
|
||||
boxSearchBg: boxBg;
|
||||
boxSearchCancelIconFg: cancelIconFg;
|
||||
boxSearchCancelIconFgOver: cancelIconFgOver;
|
||||
boxBg: windowBg; // box background
|
||||
boxTextFg: windowFg; // box text
|
||||
boxTextFgGood: #4ab44a; // accepted box text (like when choosing username that is not occupied)
|
||||
boxTextFgError: #d84d4d; // rejecting box text (like when choosing username that is occupied)
|
||||
boxTitleFg: #404040; // box title text
|
||||
boxSearchBg: boxBg; // box search field background (like in contacts box)
|
||||
|
||||
boxTitleAdditionalFg: #808080;
|
||||
boxTitleCloseFg: cancelIconFg;
|
||||
boxTitleCloseFgOver: cancelIconFgOver;
|
||||
boxTitleAdditionalFg: #808080; // box title additional text (like in create group box when you see chosen members count)
|
||||
boxTitleCloseFg: cancelIconFg; // settings close icon and box search cancel icon (like in contacts box)
|
||||
boxTitleCloseFgOver: cancelIconFgOver; // settings close icon and box search cancel icon (like in contacts box) with mouse over
|
||||
|
||||
membersAboutLimitFg: windowSubTextFgOver;
|
||||
//boxSearchCancelIconFg: cancelIconFg; // search cancel X button icon (like in contacts box) (not implemented yet)
|
||||
//boxSearchCancelIconFgOver: cancelIconFgOver; // search cancel X button icon with mouse over (not implemented yet)
|
||||
|
||||
contactsBg: windowBg;
|
||||
contactsBgOver: windowBgOver;
|
||||
contactsNameFg: boxTextFg;
|
||||
contactsStatusFg: windowSubTextFg;
|
||||
contactsStatusFgOver: windowSubTextFgOver;
|
||||
contactsStatusFgOnline: windowActiveTextFg;
|
||||
membersAboutLimitFg: windowSubTextFgOver; // text in channel members box about the limit (max 200 last members are shown)
|
||||
|
||||
photoCropFadeBg: layerBg;
|
||||
photoCropPointFg: #ffffff7f;
|
||||
contactsBg: windowBg; // contacts (and some other) box row background
|
||||
contactsBgOver: windowBgOver; // contacts (and some other) box row background with mouse over
|
||||
contactsNameFg: boxTextFg; // contacts (and some other) box row name text
|
||||
contactsStatusFg: windowSubTextFg; // contacts (and some other) box row additional text (like last seen stamp)
|
||||
contactsStatusFgOver: windowSubTextFgOver; // contacts (and some other) box row additional text (like last seen stamp) with mouse over
|
||||
contactsStatusFgOnline: windowActiveTextFg; // contacts (and some other) box row active additional text (like online status)
|
||||
|
||||
photoCropFadeBg: layerBg; // avatar crop box fade background (when choosing a new photo in Settings or for a group)
|
||||
photoCropPointFg: #ffffff7f; // avatar crop box corner rectangles (when choosing a new photo in Settings or for a group)
|
||||
|
||||
// intro
|
||||
introBg: windowBg;
|
||||
introTitleFg: windowBoldFg;
|
||||
introDescriptionFg: windowSubTextFg;
|
||||
introErrorFg: windowSubTextFg;
|
||||
introBg: windowBg; // login background
|
||||
introTitleFg: windowBoldFg; // login title text
|
||||
introDescriptionFg: windowSubTextFg; // login description text
|
||||
introErrorFg: windowSubTextFg; // login error text (like when providing a wrong log in code)
|
||||
|
||||
introCoverTopBg: #0f89d0;
|
||||
introCoverBottomBg: #39b0f0;
|
||||
introCoverIconsFg: #5ec6ff;
|
||||
introCoverPlaneTrace: #5ec6ff69;
|
||||
introCoverPlaneInner: #c6d8e8;
|
||||
introCoverPlaneOuter: #a1bed4;
|
||||
introCoverPlaneTop: #ffffff;
|
||||
introCoverTopBg: #0f89d0; // intro gradient top (from)
|
||||
introCoverBottomBg: #39b0f0; // intro gradient bottom (to)
|
||||
introCoverIconsFg: #5ec6ff; // intro cloud graphics
|
||||
introCoverPlaneTrace: #5ec6ff69; // intro plane traces
|
||||
introCoverPlaneInner: #c6d8e8; // intro plane part
|
||||
introCoverPlaneOuter: #a1bed4; // intro plane part
|
||||
introCoverPlaneTop: #ffffff; // intro plane part
|
||||
|
||||
// dialogs
|
||||
dialogsMenuIconFg: menuIconFg;
|
||||
dialogsMenuIconFgOver: menuIconFgOver;
|
||||
dialogsMenuIconFg: menuIconFg; // main menu and lock telegram icon
|
||||
dialogsMenuIconFgOver: menuIconFgOver; // main menu and lock telegram icon with mouse over
|
||||
|
||||
dialogsBg: windowBg;
|
||||
dialogsNameFg: windowBoldFg;
|
||||
dialogsChatIconFg: dialogsNameFg;
|
||||
dialogsDateFg: windowSubTextFg;
|
||||
dialogsTextFg: windowSubTextFg;
|
||||
dialogsTextFgService: windowActiveTextFg;
|
||||
dialogsDraftFg: #dd4b39;
|
||||
dialogsVerifiedIconBg: windowBgActive;
|
||||
dialogsVerifiedIconFg: windowFgActive;
|
||||
dialogsSendingIconFg: #c1c1c1;
|
||||
dialogsSentIconFg: #5dc452;
|
||||
dialogsUnreadBg: windowBgActive;
|
||||
dialogsUnreadBgMuted: #bbbbbb;
|
||||
dialogsUnreadFg: windowFgActive;
|
||||
dialogsBg: windowBg; // chat list background
|
||||
dialogsNameFg: windowBoldFg; // chat list name text
|
||||
dialogsChatIconFg: dialogsNameFg; // chat list group or channel icon
|
||||
dialogsDateFg: windowSubTextFg; // chat list date text
|
||||
dialogsTextFg: windowSubTextFg; // chat list message text
|
||||
dialogsTextFgService: windowActiveTextFg; // chat list group sender name text (or media message type text)
|
||||
dialogsDraftFg: #dd4b39; // chat list draft label
|
||||
dialogsVerifiedIconBg: windowBgActive; // chat list verified icon background
|
||||
dialogsVerifiedIconFg: windowFgActive; // chat list verified icon check
|
||||
dialogsSendingIconFg: #c1c1c1; // chat list sending message icon (clock)
|
||||
dialogsSentIconFg: #5dc452; // chat list sent message tick / double tick icon
|
||||
dialogsUnreadBg: windowBgActive; // chat list unread badge background for not muted chat
|
||||
dialogsUnreadBgMuted: #bbbbbb; // chat list unread badge background for muted chat
|
||||
dialogsUnreadFg: windowFgActive; // chat list unread badge text
|
||||
|
||||
dialogsBgOver: windowBgOver;
|
||||
dialogsNameFgOver: windowBoldFgOver;
|
||||
dialogsChatIconFgOver: dialogsNameFgOver;
|
||||
dialogsDateFgOver: windowSubTextFgOver;
|
||||
dialogsTextFgOver: windowSubTextFgOver;
|
||||
dialogsTextFgServiceOver: dialogsTextFgService;
|
||||
dialogsDraftFgOver: dialogsDraftFg;
|
||||
dialogsVerifiedIconBgOver: dialogsVerifiedIconBg;
|
||||
dialogsVerifiedIconFgOver: dialogsVerifiedIconFg;
|
||||
dialogsSendingIconFgOver: dialogsSendingIconFg;
|
||||
dialogsSentIconFgOver: dialogsSentIconFg;
|
||||
dialogsUnreadBgOver: dialogsUnreadBg;
|
||||
dialogsUnreadBgMutedOver: dialogsUnreadBgMuted;
|
||||
dialogsUnreadFgOver: dialogsUnreadFg;
|
||||
dialogsBgOver: windowBgOver; // chat list background with mouse over
|
||||
dialogsNameFgOver: windowBoldFgOver; // chat list name text with mouse over
|
||||
dialogsChatIconFgOver: dialogsNameFgOver; // chat list group or channel icon with mouse over
|
||||
dialogsDateFgOver: windowSubTextFgOver; // chat list date text with mouse over
|
||||
dialogsTextFgOver: windowSubTextFgOver; // chat list message text with mouse over
|
||||
dialogsTextFgServiceOver: dialogsTextFgService; // chat list group sender name text with mouse over
|
||||
dialogsDraftFgOver: dialogsDraftFg; // chat list draft label with mouse over
|
||||
dialogsVerifiedIconBgOver: dialogsVerifiedIconBg; // chat list verified icon background with mouse over
|
||||
dialogsVerifiedIconFgOver: dialogsVerifiedIconFg; // chat list verified icon check with mouse over
|
||||
dialogsSendingIconFgOver: dialogsSendingIconFg; // chat list sending message icon (clock) with mouse over
|
||||
dialogsSentIconFgOver: dialogsSentIconFg; // chat list sent message tick / double tick icon with mouse over
|
||||
dialogsUnreadBgOver: dialogsUnreadBg; // chat list unread badge background for not muted chat with mouse over
|
||||
dialogsUnreadBgMutedOver: dialogsUnreadBgMuted; // chat list unread badge background for muted chat with mouse over
|
||||
dialogsUnreadFgOver: dialogsUnreadFg; // chat list unread badge text with mouse over
|
||||
|
||||
dialogsBgActive: #419fd9;
|
||||
dialogsNameFgActive: windowFgActive;
|
||||
dialogsChatIconFgActive: dialogsNameFgActive;
|
||||
dialogsDateFgActive: windowFgActive;
|
||||
dialogsTextFgActive: windowFgActive;
|
||||
dialogsTextFgServiceActive: dialogsTextFgActive;
|
||||
dialogsDraftFgActive: #c6e1f7;
|
||||
dialogsVerifiedIconBgActive: dialogsTextFgActive;
|
||||
dialogsVerifiedIconFgActive: dialogsBgActive;
|
||||
dialogsSendingIconFgActive: #ffffff99;
|
||||
dialogsSentIconFgActive: dialogsTextFgActive;
|
||||
dialogsUnreadBgActive: dialogsTextFgActive;
|
||||
dialogsUnreadBgMutedActive: dialogsDraftFgActive;
|
||||
dialogsUnreadFgActive: dialogsBgActive;
|
||||
dialogsBgActive: #419fd9; // chat list background for current (active) chat
|
||||
dialogsNameFgActive: windowFgActive; // chat list name text for current (active) chat
|
||||
dialogsChatIconFgActive: dialogsNameFgActive; // chat list group or channel icon for current (active) chat
|
||||
dialogsDateFgActive: windowFgActive; // chat list date text for current (active) chat
|
||||
dialogsTextFgActive: windowFgActive; // chat list message text for current (active) chat
|
||||
dialogsTextFgServiceActive: dialogsTextFgActive; // chat list group sender name text for current (active) chat
|
||||
dialogsDraftFgActive: #c6e1f7; // chat list draft label for current (active) chat
|
||||
dialogsVerifiedIconBgActive: dialogsTextFgActive; // chat list verified icon background for current (active) chat
|
||||
dialogsVerifiedIconFgActive: dialogsBgActive; // chat list verified icon check for current (active) chat
|
||||
dialogsSendingIconFgActive: #ffffff99; // chat list sending message icon (clock) for current (active) chat
|
||||
dialogsSentIconFgActive: dialogsTextFgActive; // chat list sent message tick / double tick icon for current (active) chat
|
||||
dialogsUnreadBgActive: dialogsTextFgActive; // chat list unread badge background for not muted chat for current (active) chat
|
||||
dialogsUnreadBgMutedActive: dialogsDraftFgActive; // chat list unread badge background for muted chat for current (active) chat
|
||||
dialogsUnreadFgActive: dialogsBgActive; // chat list unread badge text for current (active) chat
|
||||
|
||||
dialogsForwardBg: dialogsBgActive;
|
||||
dialogsForwardFg: dialogsNameFgActive;
|
||||
dialogsForwardBg: dialogsBgActive; // forwarding panel background (when forwarding messages in the smallest window size)
|
||||
dialogsForwardFg: dialogsNameFgActive; // forwarding panel text (when forwarding messages in the smallest window size)
|
||||
|
||||
searchedBarBg: windowBgOver;
|
||||
searchedBarBorder: shadowFg;
|
||||
searchedBarFg: windowSubTextFgOver;
|
||||
searchedBarBg: windowBgOver; // search results bar background (in chats list, contacts box..)
|
||||
searchedBarFg: windowSubTextFgOver; // search results bar text (in chats list, contacts box..)
|
||||
|
||||
// history
|
||||
topBarBg: windowBg;
|
||||
topBarBg: windowBg; // top bar background (in chat view, media overview..)
|
||||
|
||||
emojiPanBg: windowBg;
|
||||
emojiPanCategories: #f7f7f7 | windowBg;
|
||||
emojiPanHeaderFg: windowSubTextFg;
|
||||
emojiPanHeaderBg: #fffffff2 | emojiPanBg;
|
||||
stickerPanDeleteBg: #000000cc;
|
||||
stickerPanDeleteFg: windowFgActive;
|
||||
stickerPreviewBg: #ffffffb0;
|
||||
emojiPanBg: windowBg; // emoji panel background
|
||||
emojiPanCategories: #f7f7f7 | windowBg; // emoji panel categories background
|
||||
emojiPanHeaderFg: windowSubTextFg; // emoji panel section header text
|
||||
emojiPanHeaderBg: #fffffff2 | emojiPanBg; // emoji panel section header background
|
||||
stickerPanDeleteBg: #000000cc; // delete X button background for custom sent stickers in stickers panel (legacy)
|
||||
stickerPanDeleteFg: windowFgActive; // delete X button icon for custom sent stickers in stickers panel (legacy)
|
||||
stickerPreviewBg: #ffffffb0; // sticker and GIF preview background (when you press and hold on a sticker)
|
||||
|
||||
historyTextInFg: windowFg;
|
||||
historyTextOutFg: windowFg;
|
||||
historyCaptionInFg: historyTextInFg;
|
||||
historyCaptionOutFg: historyTextOutFg;
|
||||
historyFileNameInFg: historyTextInFg;
|
||||
historyFileNameOutFg: historyTextOutFg;
|
||||
historyOutIconFg: dialogsSentIconFg;
|
||||
historyOutIconFgSelected: #4da79f;
|
||||
historyIconFgInverted: windowFgActive;
|
||||
historySendingOutIconFg: #98d292;
|
||||
historySendingInIconFg: #a0adb5;
|
||||
historySendingInvertedIconFg: #ffffffc8;
|
||||
historyTextInFg: windowFg; // inbox message text
|
||||
historyTextInFgSelected: historyTextInFg; // inbox message selected text or text in a selected message
|
||||
historyTextOutFg: windowFg; // outbox message text
|
||||
historyTextOutFgSelected: historyTextOutFg; // outbox message selected text or text in a selected message
|
||||
historyLinkInFg: windowActiveTextFg; // inbox message link
|
||||
historyLinkInFgSelected: historyLinkInFg; // inbox message link in a selected text or message
|
||||
historyLinkOutFg: windowActiveTextFg; // outbox message link
|
||||
historyLinkOutFgSelected: historyLinkOutFg; // outbox message link in a selected text or message
|
||||
historyFileNameInFg: historyTextInFg; // inbox media filename text
|
||||
historyFileNameInFgSelected: historyFileNameInFg; // inbox media filename text in a selected message
|
||||
historyFileNameOutFg: historyTextOutFg; // outbox media filename text
|
||||
historyFileNameOutFgSelected: historyFileNameOutFg; // outbox media filename text in a selected message
|
||||
historyOutIconFg: dialogsSentIconFg; // outbox message tick / double tick icon
|
||||
historyOutIconFgSelected: #4da79f; // outbox message tick / double tick icon in a selected message
|
||||
historyIconFgInverted: windowFgActive; // media message tick / double tick icon (like in sent photo)
|
||||
historySendingOutIconFg: #98d292; // outbox sending message icon (clock)
|
||||
historySendingInIconFg: #a0adb5; // inbox sending message icon (clock) (like in sent messages to yourself or in sent messages to a channel)
|
||||
historySendingInvertedIconFg: #ffffffc8; // media sending message icon (clock) (like in sent photo)
|
||||
|
||||
historySystemBg: #89a0b47f;
|
||||
historySystemBgSelected: #bbc8d4a2;
|
||||
historySystemFg: windowFgActive;
|
||||
historyUnreadBarBg: #fcfbfa; // new unread messages bar background
|
||||
historyUnreadBarBorder: shadowFg; // new unread messages bar shadow
|
||||
historyUnreadBarFg: #538bb4; // new unread messages bar text
|
||||
|
||||
historyUnreadBarBg: #fcfbfa;
|
||||
historyUnreadBarBorder: shadowFg;
|
||||
historyUnreadBarFg: #538bb4;
|
||||
historyForwardChooseBg: #0000004c; // forwarding messages in a large window size "choose recipient" background
|
||||
historyForwardChooseFg: windowFgActive; // forwarding messages in a large window size "choose recipient" text
|
||||
|
||||
historyForwardChooseBg: #0000004c;
|
||||
historyForwardChooseFg: windowFgActive;
|
||||
historyPeer1NameFg: #c03d33; // red group member name
|
||||
historyPeer1NameFgSelected: historyPeer1NameFg; // red group member name in a selected message
|
||||
historyPeer1UserpicBg: #e17076; // red userpic background
|
||||
historyPeer2NameFg: #4fad2d; // green group member name
|
||||
historyPeer2NameFgSelected: historyPeer2NameFg; // green group member name in a selected message
|
||||
historyPeer2UserpicBg: #7bc862; // green userpic background
|
||||
historyPeer3NameFg: #d09306; // yellow group member name
|
||||
historyPeer3NameFgSelected: historyPeer3NameFg; // yellow group member name in a selected message
|
||||
historyPeer3UserpicBg: #e5ca77; // yellow userpic background
|
||||
historyPeer4NameFg: windowActiveTextFg; // blue group member name
|
||||
historyPeer4NameFgSelected: historyPeer4NameFg; // blue group member name in a selected message
|
||||
historyPeer4UserpicBg: #65aadd; // blue userpic background
|
||||
historyPeer5NameFg: #8544d6; // purple group member name
|
||||
historyPeer5NameFgSelected: historyPeer5NameFg; // purple group member name in a selected message
|
||||
historyPeer5UserpicBg: #a695e7; // purple userpic background
|
||||
historyPeer6NameFg: #cd4073; // pink group member name
|
||||
historyPeer6NameFgSelected: historyPeer6NameFg; // pink group member name in a selected message
|
||||
historyPeer6UserpicBg: #ee7aae; // pink userpic background
|
||||
historyPeer7NameFg: #2996ad; // sea group member name
|
||||
historyPeer7NameFgSelected: historyPeer7NameFg; // sea group member name in a selected message
|
||||
historyPeer7UserpicBg: #6ec9cb; // sea userpic background
|
||||
historyPeer8NameFg: #ce671b; // orange group member name
|
||||
historyPeer8NameFgSelected: historyPeer8NameFg; // orange group member name in a selected message
|
||||
historyPeer8UserpicBg: #faa774; // orange userpic background
|
||||
historyPeerUserpicFg: windowFgActive; // default userpic initials
|
||||
|
||||
historyPeer1NameFg: #c03d33; // red
|
||||
historyPeer1UserpicBg: #e17076;
|
||||
historyPeer2NameFg: #4fad2d; // green
|
||||
historyPeer2UserpicBg: #7bc862;
|
||||
historyPeer3NameFg: #d09306; // yellow
|
||||
historyPeer3UserpicBg: #e5ca77;
|
||||
historyPeer4NameFg: windowActiveTextFg; // blue
|
||||
historyPeer4UserpicBg: #65aadd;
|
||||
historyPeer5NameFg: #8544d6; // purple
|
||||
historyPeer5UserpicBg: #a695e7;
|
||||
historyPeer6NameFg: #cd4073; // pink
|
||||
historyPeer6UserpicBg: #ee7aae;
|
||||
historyPeer7NameFg: #2996ad; // sea
|
||||
historyPeer7UserpicBg: #6ec9cb;
|
||||
historyPeer8NameFg: #ce671b; // orange
|
||||
historyPeer8UserpicBg: #faa774;
|
||||
historyPeerUserpicFg: windowFgActive;
|
||||
// Some values are marked as (adjusted), it means they're adjusted by
|
||||
// hue and saturation of the average background color if user chooses
|
||||
// some other (not bundled to this color theme) background. If the
|
||||
// bundled background is used those colors are not adjusted in any way.
|
||||
historyScrollBarBg: #517c417a; // scroll bar current rectangle, the bar itself in the chat view (adjusted)
|
||||
historyScrollBarBgOver: #517c41bc; // scroll bar current rectangle with mouse over it in the chat view (adjusted)
|
||||
historyScrollBg: #517c414c; // scroll bar background (adjusted)
|
||||
historyScrollBgOver: #517c416b; // scroll bar background with mouse over the scroll bar (adjusted)
|
||||
|
||||
historyScrollBarBg: #517c417a;
|
||||
historyScrollBarBgOver: #517c41bc;
|
||||
historyScrollBg: #517c414c;
|
||||
historyScrollBgOver: #517c416b;
|
||||
msgInBg: windowBg; // inbox message background
|
||||
msgInBgSelected: #c2dcf2; // inbox selected message background (and background of selected text in those messages)
|
||||
msgOutBg: #effdde; // outbox message background
|
||||
msgOutBgSelected: #b7dbdb; // outbox selected message background (and background of selected text in those messages)
|
||||
msgSelectOverlay: #358cd44c; // overlay which is filling the media parts of selected messages (like in selected photo message)
|
||||
msgStickerOverlay: #358cd47f; // overlay which is filling the selected sticker message
|
||||
msgInServiceFg: windowActiveTextFg; // inbox message information text (like information about a forwarded message original sender)
|
||||
msgInServiceFgSelected: windowActiveTextFg; // inbox selected message information text (like information about a forwarded message original sender)
|
||||
msgOutServiceFg: #3a8e26; // outbox message information text (like information about a forwarded message original sender)
|
||||
msgOutServiceFgSelected: #367570; // outbox message information text (like information about a forwarded message original sender)
|
||||
msgInShadow: #748ea229; // inbox message shadow (below the bubble)
|
||||
msgInShadowSelected: #548dbb29; // inbox selected message shadow (below the bubble)
|
||||
msgOutShadow: #3ac34740; // outbox message shadow (below the bubble)
|
||||
msgOutShadowSelected: #37a78e40; // outbox selected message shadow (below the bubble)
|
||||
msgInDateFg: #a0acb6; // inbox message time text
|
||||
msgInDateFgSelected: #6a9cc5; // inbox selected message time text
|
||||
msgOutDateFg: #6cc264; // outbox message time text
|
||||
msgOutDateFgSelected: #50a79c; // outbox selected message time text
|
||||
msgServiceFg: windowFgActive; // service message text (like date dividers or service message about the group title being changed)
|
||||
msgServiceBg: #517c417f; // service message background (like in a service message about group title being changed) (adjusted)
|
||||
msgServiceBgSelected: #96b38ba2; // service message selected text background (like in a service message about group title being changed) (adjusted)
|
||||
msgInReplyBarColor: activeLineFg; // inbox message reply outline
|
||||
msgInReplyBarSelColor: activeLineFg; // inbox selected message reply outline
|
||||
msgOutReplyBarColor: historyOutIconFg; // outbox message reply outline
|
||||
msgOutReplyBarSelColor: historyOutIconFgSelected; // outbox selected message reply outline
|
||||
msgImgReplyBarColor: msgServiceFg; // sticker message reply outline
|
||||
msgInMonoFg: #4e7391; // inbox message monospace text (like a message sent with `test` text)
|
||||
msgOutMonoFg: #469165; // outbox message monospace text
|
||||
msgInMonoFgSelected: msgInMonoFg; // inbox message monospace text in a selected text or message
|
||||
msgOutMonoFgSelected: msgOutMonoFg; // outbox message monospace text in a selected text or message
|
||||
msgDateImgFg: msgServiceFg; // media message time text (like time text in a sent photo)
|
||||
msgDateImgBg: #00000054; // media message time bubble background (like time bubble in a sent photo) or file with thumbnail download icon circle background
|
||||
msgDateImgBgOver: #00000074; // media message download icon circle background with mouse over (like file with thumbnail download icon)
|
||||
msgDateImgBgSelected: #1c4a7187; // selected media message time bubble background
|
||||
|
||||
msgInBg: windowBg;
|
||||
msgInBgSelected: #c2dcf2; // #358cd4 with 30% opacity
|
||||
msgOutBg: #effdde;
|
||||
msgOutBgSelected: #b7dbdb;
|
||||
msgSelectOverlay: #358cd44c;
|
||||
msgStickerOverlay: #358cd47f;
|
||||
msgInServiceFg: windowActiveTextFg;
|
||||
msgInServiceFgSelected: windowActiveTextFg;
|
||||
msgOutServiceFg: #3a8e26;
|
||||
msgOutServiceFgSelected: #367570;
|
||||
msgInShadow: #748ea229;
|
||||
msgInShadowSelected: #548dbb29;
|
||||
msgOutShadow: #3ac34740;
|
||||
msgOutShadowSelected: #37a78e40;
|
||||
msgInDateFg: #a0acb6;
|
||||
msgInDateFgSelected: #6a9cc5;
|
||||
msgOutDateFg: #6cc264;
|
||||
msgOutDateFgSelected: #50a79c;
|
||||
msgServiceFg: windowFgActive;
|
||||
msgServiceBg: #517c417f;
|
||||
msgServiceBgSelected: #96b38ba2;
|
||||
msgInReplyBarColor: activeLineFg;
|
||||
msgInReplyBarSelColor: activeLineFg;
|
||||
msgOutReplyBarColor: historyOutIconFg;
|
||||
msgOutReplyBarSelColor: historyOutIconFgSelected;
|
||||
msgImgReplyBarColor: msgServiceFg;
|
||||
msgInMonoFg: #4e7391;
|
||||
msgOutMonoFg: #469165;
|
||||
msgDateImgFg: msgServiceFg;
|
||||
msgDateImgBg: #00000054;
|
||||
msgDateImgBgOver: #00000074;
|
||||
msgDateImgBgSelected: #1c4a7187;
|
||||
msgFileThumbLinkInFg: lightButtonFg; // inbox media file message with thumbnail download / open with button text
|
||||
msgFileThumbLinkInFgSelected: lightButtonFgOver; // inbox selected media file message with thumbnail download / open with button text
|
||||
msgFileThumbLinkOutFg: #5eba5b; // outbox media file message with thumbnail download / open with button text
|
||||
msgFileThumbLinkOutFgSelected: #31a298; // outbox selected media file message with thumbnail download / open with button text
|
||||
msgFileInBg: windowBgActive; // inbox audio file download circle background
|
||||
msgFileInBgOver: #4eade3; // inbox audio file download circle background with mouse over
|
||||
msgFileInBgSelected: #51a3d3; // inbox selected audio file download circle background
|
||||
msgFileOutBg: #78c67f; // outbox audio file download circle background
|
||||
msgFileOutBgOver: #6bc272; // outbox audio file download circle background with mouse over
|
||||
msgFileOutBgSelected: #5fb389; // outbox selected audio file download circle background
|
||||
|
||||
msgFileThumbLinkInFg: lightButtonFg;
|
||||
msgFileThumbLinkInFgSelected: lightButtonFgOver;
|
||||
msgFileThumbLinkOutFg: #5eba5b;
|
||||
msgFileThumbLinkOutFgSelected: #31a298;
|
||||
msgFileInBg: windowBgActive;
|
||||
msgFileInBgOver: #4eade3;
|
||||
msgFileInBgSelected: #51a3d3;
|
||||
msgFileOutBg: #78c67f;
|
||||
msgFileOutBgOver: #6bc272;
|
||||
msgFileOutBgSelected: #5fb389;
|
||||
msgFile1Bg: #72b1df; // blue shared links / files without image square thumbnail
|
||||
msgFile1BgDark: #5c9ece; // blue shared files without image download circle background
|
||||
msgFile1BgOver: #5294c4; // blue shared files without image download circle background with mouse over
|
||||
msgFile1BgSelected: #5099d0; // blue shared files without image download circle background if file is selected
|
||||
msgFile2Bg: #61b96e; // green shared links / shared files without image square thumbnail
|
||||
msgFile2BgDark: #4da859; // green shared files without image download circle background
|
||||
msgFile2BgOver: #44a050; // green shared files without image download circle background with mouse over
|
||||
msgFile2BgSelected: #46a07e; // green shared files without image download circle background if file is selected
|
||||
msgFile3Bg: #e47272; // red shared links / shared files without image square thumbnail
|
||||
msgFile3BgDark: #cd5b5e; // red shared files without image download circle background
|
||||
msgFile3BgOver: #c35154; // red shared files without image download circle background with mouse over
|
||||
msgFile3BgSelected: #9f6a82; // red shared files without image download circle background if file is selected
|
||||
msgFile4Bg: #efc274; // yellow shared links / shared files without image square thumbnail
|
||||
msgFile4BgDark: #e6a561; // yellow shared files without image download circle background
|
||||
msgFile4BgOver: #dc9c5a; // yellow shared files without image download circle background with mouse over
|
||||
msgFile4BgSelected: #b19d84; // yellow shared files without image download circle background if file is selected
|
||||
|
||||
msgFile1Bg: #72b1df; // blue
|
||||
msgFile1BgDark: #5c9ece;
|
||||
msgFile1BgOver: #5294c4;
|
||||
msgFile1BgSelected: #5099d0;
|
||||
msgFile2Bg: #61b96e; // green
|
||||
msgFile2BgDark: #4da859;
|
||||
msgFile2BgOver: #44a050;
|
||||
msgFile2BgSelected: #46a07e;
|
||||
msgFile3Bg: #e47272; // red
|
||||
msgFile3BgDark: #cd5b5e;
|
||||
msgFile3BgOver: #c35154;
|
||||
msgFile3BgSelected: #9f6a82;
|
||||
msgFile4Bg: #efc274; // yellow
|
||||
msgFile4BgDark: #e6a561;
|
||||
msgFile4BgOver: #dc9c5a;
|
||||
msgFile4BgSelected: #b19d84;
|
||||
historyFileInIconFg: msgInBg; // inbox file without thumbnail (like audio file) download arrow icon
|
||||
historyFileInIconFgSelected: msgInBgSelected; // inbox selected file without thumbnail (like audio file) download arrow icon
|
||||
historyFileInRadialFg: historyFileInIconFg; // inbox file without thumbnail (like audio file) radial download animation line
|
||||
historyFileInRadialFgSelected: historyFileInIconFgSelected; // inbox selected file without thumbnail (like audio file) radial download animation line
|
||||
historyFileOutIconFg: msgOutBg; // outbox file without thumbnail (like audio file) download arrow icon
|
||||
historyFileOutIconFgSelected: msgOutBgSelected; // outbox selected file without thumbnail (like audio file) download arrow icon
|
||||
historyFileOutRadialFg: historyFileOutIconFg; // outbox file without thumbnail (like audio file) radial download animation line
|
||||
historyFileOutRadialFgSelected: historyFileOutIconFgSelected; // outbox selected file without thumbnail (like audio file) radial download animation line
|
||||
historyFileThumbIconFg: msgInBg; // file with thumbnail (or photo / video) download arrow icon
|
||||
historyFileThumbIconFgSelected: msgInBgSelected; // selected file with thumbnail (or photo / video) download arrow icon
|
||||
historyFileThumbRadialFg: historyFileThumbIconFg; // file with thumbnail (or photo / video) radial download animation line
|
||||
historyFileThumbRadialFgSelected: historyFileThumbIconFgSelected; // selected file with thumbnail (or photo / video) radial download animation line
|
||||
|
||||
historyFileInIconFg: msgInBg;
|
||||
historyFileInIconFgSelected: msgInBgSelected;
|
||||
historyFileInRadialFg: historyFileInIconFg;
|
||||
historyFileInRadialFgSelected: historyFileInIconFgSelected;
|
||||
historyFileOutIconFg: msgOutBg;
|
||||
historyFileOutIconFgSelected: msgOutBgSelected;
|
||||
historyFileOutRadialFg: historyFileOutIconFg;
|
||||
historyFileOutRadialFgSelected: historyFileOutIconFgSelected;
|
||||
historyFileThumbIconFg: msgInBg;
|
||||
historyFileThumbIconFgSelected: msgInBgSelected;
|
||||
historyFileThumbRadialFg: historyFileThumbIconFg;
|
||||
historyFileThumbRadialFgSelected: historyFileThumbIconFgSelected;
|
||||
msgWaveformInActive: windowBgActive; // inbox voice message active waveform lines (like played part of currently playing voice message)
|
||||
msgWaveformInActiveSelected: #51a3d3; // inbox selected voice message active waveform lines (like played part of currently playing voice message)
|
||||
msgWaveformInInactive: #d4dee6; // inbox voice message inactive waveform lines (like upcoming part of currently playing voice message)
|
||||
msgWaveformInInactiveSelected: #9cc1e1; // inbox selected voice message inactive waveform lines (like upcoming part of currently playing voice message)
|
||||
msgWaveformOutActive: #78c67f; // outbox voice message active waveform lines (like played part of currently playing voice message)
|
||||
msgWaveformOutActiveSelected: #6badad; // outbox selected voice message active waveform lines (like played part of currently playing voice message)
|
||||
msgWaveformOutInactive: #b3e2b4; // outbox voice message inactive waveform lines (like upcoming part of currently playing voice message)
|
||||
msgWaveformOutInactiveSelected: #91c3c3; // outbox selected voice message inactive waveform lines (like upcoming part of currently playing voice message)
|
||||
|
||||
msgWaveformInActive: windowBgActive;
|
||||
msgWaveformInActiveSelected: #51a3d3;
|
||||
msgWaveformInInactive: #d4dee6;
|
||||
msgWaveformInInactiveSelected: #9cc1e1;
|
||||
msgWaveformOutActive: #78c67f;
|
||||
msgWaveformOutActiveSelected: #6badad;
|
||||
msgWaveformOutInactive: #b3e2b4;
|
||||
msgWaveformOutInactiveSelected: #91c3c3;
|
||||
msgBotKbOverBgAdd: #ffffff20; // this is painted over a bot inline keyboard button (which has msgServiceBg background) when mouse is over that button
|
||||
msgBotKbIconFg: msgServiceFg; // bot inline keyboard button icon in the top-right corner (like in @vote bot when a poll is ready to be shared)
|
||||
msgBotKbRippleBg: #00000020; // bot inline keyboard button ripple effect
|
||||
|
||||
msgBotKbOverBgAdd: #ffffff20;
|
||||
msgBotKbIconFg: msgServiceFg;
|
||||
msgBotKbRippleBg: #00000020;
|
||||
mediaInFg: msgInDateFg; // inbox media message status text (like in file that is being downloaded)
|
||||
mediaInFgSelected: msgInDateFgSelected; // inbox selected media message status text (like in file that is being downloaded)
|
||||
mediaOutFg: msgOutDateFg; // outbox media message status text (like in file that is being downloaded)
|
||||
mediaOutFgSelected: msgOutDateFgSelected; // outbox selected media message status text (like in file that is being downloaded)
|
||||
|
||||
mediaInFg: msgInDateFg;
|
||||
mediaInFgSelected: msgInDateFgSelected;
|
||||
mediaOutFg: msgOutDateFg;
|
||||
mediaOutFgSelected: msgOutDateFgSelected;
|
||||
youtubePlayIconBg: #e83131c8; // youtube play icon background (when a link to a youtube video with a webpage preview is sent)
|
||||
youtubePlayIconFg: windowFgActive; // youtube play icon arrow (when a link to a youtube video with a webpage preview is sent)
|
||||
videoPlayIconBg: #0000007f; // other video play icon background (like when a link to a vimeo video with a webpage preview is sent)
|
||||
videoPlayIconFg: #ffffff; // other video play icon arrow (like when a link to a vimeo video with a webpage preview is sent)
|
||||
toastBg: #000000b2; // toast notification background (like when you click on your t.me link when editing your username)
|
||||
toastFg: windowFgActive; // toast notification text (like when you click on your t.me link when editing your username)
|
||||
|
||||
youtubePlayIconBg: #e83131c8;
|
||||
youtubePlayIconFg: windowFgActive;
|
||||
videoPlayIconBg: #0000007f;
|
||||
videoPlayIconFg: #ffffff;
|
||||
toastBg: #000000b2;
|
||||
toastFg: windowFgActive;
|
||||
reportSpamBg: emojiPanHeaderBg; // report spam panel background (like a non contact user writes your for the first time)
|
||||
reportSpamFg: windowFg; // report spam panel text (when you send a report from that panel)
|
||||
|
||||
reportSpamBg: emojiPanHeaderBg;
|
||||
reportSpamFg: windowFg;
|
||||
historyToDownBg: windowBg; // arrow button background (to scroll to the end of the viewed chat)
|
||||
historyToDownBgOver: windowBgOver; // arrow button background with mouse over
|
||||
historyToDownBgRipple: windowBgRipple; // arrow button ripple effect
|
||||
historyToDownFg: menuIconFg; // arrow button icon
|
||||
historyToDownFgOver: menuIconFgOver; // arrow button icon with mouse over
|
||||
historyToDownShadow: #00000040; // arrow button shadow
|
||||
|
||||
historyToDownBg: windowBg;
|
||||
historyToDownBgOver: windowBgOver;
|
||||
historyToDownBgRipple: windowBgRipple;
|
||||
historyToDownFg: menuIconFg;
|
||||
historyToDownFgOver: menuIconFgOver;
|
||||
historyToDownShadow: #00000040;
|
||||
historyComposeAreaBg: msgInBg; // history compose area background (message write area / reply information / forwarding information)
|
||||
historyComposeAreaFg: historyTextInFg; // history compose area text
|
||||
historyComposeAreaFgService: msgInDateFg; // history compose area text when replying to a media message
|
||||
historyComposeIconFg: menuIconFg; // history compose area icon (like emoji, attach, bot command..)
|
||||
historyComposeIconFgOver: menuIconFgOver; // history compose area icon with mouse over
|
||||
historySendIconFg: windowBgActive; // send message icon
|
||||
historySendIconFgOver: windowBgActive; // send message icon with mouse over
|
||||
historyPinnedBg: historyComposeAreaBg; // pinned message area background
|
||||
historyReplyBg: historyComposeAreaBg; // reply / forward / edit message area background
|
||||
historyReplyIconFg: windowBgActive; // reply / forward / edit message left icon
|
||||
historyReplyCancelFg: cancelIconFg; // reply / forward / edit message cancel button
|
||||
historyReplyCancelFgOver: cancelIconFgOver; // reply / forward / edit message cancel button with mouse over
|
||||
|
||||
historyComposeAreaBg: msgInBg;
|
||||
historyComposeAreaFg: historyTextInFg;
|
||||
historyComposeAreaFgService: msgInDateFg;
|
||||
historyComposeIconFg: menuIconFg;
|
||||
historyComposeIconFgOver: menuIconFgOver;
|
||||
historySendIconFg: windowBgActive;
|
||||
historySendIconFgOver: windowBgActive;
|
||||
historyPinnedBg: historyComposeAreaBg;
|
||||
historyReplyBg: historyComposeAreaBg;
|
||||
historyReplyIconFg: windowBgActive;
|
||||
historyReplyCancelFg: cancelIconFg;
|
||||
historyReplyCancelFgOver: cancelIconFgOver;
|
||||
|
||||
historyComposeButtonBg: historyComposeAreaBg;
|
||||
historyComposeButtonBgOver: windowBgOver;
|
||||
historyComposeButtonBgRipple: windowBgRipple;
|
||||
historyComposeButtonBg: historyComposeAreaBg; // unblock / join channel / mute channel button background
|
||||
historyComposeButtonBgOver: windowBgOver; // unblock / join channel / mute channel button background with mouse over
|
||||
historyComposeButtonBgRipple: windowBgRipple; // unblock / join channel / mute channel button ripple effect
|
||||
|
||||
// overview
|
||||
overviewCheckBg: #00000040;
|
||||
overviewCheckFg: windowBg;
|
||||
overviewCheckFgActive: windowBg;
|
||||
overviewPhotoSelectOverlay: #40ace333;
|
||||
overviewCheckBg: #00000040; // shared files / links checkbox background for not selected rows when some rows are selected
|
||||
overviewCheckFg: windowBg; // shared files / links checkbox icon for not selected rows when some rows are selected
|
||||
overviewCheckFgActive: windowBg; // shared files / links checkbox icon for selected rows
|
||||
overviewPhotoSelectOverlay: #40ace333; // shared photos / videos / links fill for selected rows
|
||||
|
||||
// profile
|
||||
profileStatusFgOver: #7c99b2;
|
||||
profileVerifiedCheckBg: windowBgActive;
|
||||
profileVerifiedCheckFg: windowFgActive;
|
||||
profileAdminStartFg: windowBgActive;
|
||||
profileStatusFgOver: #7c99b2; // group members list in group profile user last seen text with mouse over
|
||||
profileVerifiedCheckBg: windowBgActive; // profile verified check icon background
|
||||
profileVerifiedCheckFg: windowFgActive; // profile verified check icon tick
|
||||
profileAdminStartFg: windowBgActive; // group members list admin star icon
|
||||
|
||||
// settings
|
||||
notificationsBoxMonitorFg: windowFg;
|
||||
notificationsBoxScreenBg: dialogsBgActive; // #6389a8;
|
||||
notificationsBoxMonitorFg: windowFg; // custom notifications settings box monitor color
|
||||
notificationsBoxScreenBg: dialogsBgActive; // #6389a8; // custom notifications settings box monitor screen background
|
||||
|
||||
notificationSampleUserpicFg: windowBgActive;
|
||||
notificationSampleCloseFg: #d7d7d7 | windowSubTextFg;
|
||||
notificationSampleTextFg: #d7d7d7 | windowSubTextFg;
|
||||
notificationSampleNameFg: #939393 | windowSubTextFg;
|
||||
notificationSampleUserpicFg: windowBgActive; // custom notifications settings box small sample userpic placeholder
|
||||
notificationSampleCloseFg: #d7d7d7 | windowSubTextFg; // custom notifications settings box small sample close button placeholder
|
||||
notificationSampleTextFg: #d7d7d7 | windowSubTextFg; // custom notifications settings box small sample text placeholder
|
||||
notificationSampleNameFg: #939393 | windowSubTextFg; // custom notifications settings box small sample name placeholder
|
||||
|
||||
mainMenuBg: windowBg;
|
||||
mainMenuCoverBg: dialogsBgActive;
|
||||
mainMenuCoverFg: windowFgActive;
|
||||
mainMenuBg: windowBg; // main menu background
|
||||
mainMenuCoverBg: dialogsBgActive; // main menu top cover background
|
||||
mainMenuCoverFg: windowFgActive; // main menu top cover text
|
||||
|
||||
mediaPlayerBg: windowBg;
|
||||
mediaPlayerActiveFg: windowBgActive;
|
||||
mediaPlayerInactiveFg: sliderBgInactive;
|
||||
mediaPlayerDisabledFg: #9dd1ef;
|
||||
mediaPlayerBg: windowBg; // audio file player background
|
||||
mediaPlayerActiveFg: windowBgActive; // audio file player playback progress already played part
|
||||
mediaPlayerInactiveFg: sliderBgInactive; // audio file player playback progress upcoming (not played yet) part with mouse over
|
||||
mediaPlayerDisabledFg: #9dd1ef; // audio file player loading progress (when you're playing an audio file and switch to the previous one which is not loaded yet)
|
||||
|
||||
// mediaview
|
||||
mediaviewFileBg: windowBg;
|
||||
mediaviewFileNameFg: windowFg;
|
||||
mediaviewFileSizeFg: windowSubTextFg;
|
||||
mediaviewFileRedCornerFg: #d55959;
|
||||
mediaviewFileYellowCornerFg: #e8a659;
|
||||
mediaviewFileGreenCornerFg: #49a957;
|
||||
mediaviewFileBlueCornerFg: #599dcf;
|
||||
mediaviewFileExtFg: activeButtonFg;
|
||||
mediaviewFileBg: windowBg; // file rectangle background (when you view a png file in Media Viewer and go to a previous, not loaded yet, file)
|
||||
mediaviewFileNameFg: windowFg; // file name in file rectangle
|
||||
mediaviewFileSizeFg: windowSubTextFg; // file size text in file rectangle
|
||||
mediaviewFileRedCornerFg: #d55959; // red file thumbnail placeholder corner in file rectangle (for a file without thumbnail, like .pdf)
|
||||
mediaviewFileYellowCornerFg: #e8a659; // yellow file thumbnail placeholder corner in file rectangle (for a file without thumbnail, like .zip)
|
||||
mediaviewFileGreenCornerFg: #49a957; // green file thumbnail placeholder corner in file rectangle (for a file without thumbnail, like .exe)
|
||||
mediaviewFileBlueCornerFg: #599dcf; // blue file thumbnail placeholder corner in file rectangle (for a file without thumbnail, like .dmg)
|
||||
mediaviewFileExtFg: activeButtonFg; // file extension text in file thumbnail placeholder in file rectangle
|
||||
|
||||
mediaviewMenuBg: #383838;
|
||||
mediaviewMenuBgOver: #505050;
|
||||
mediaviewMenuBgRipple: #676767;
|
||||
mediaviewMenuFg: windowFgActive;
|
||||
mediaviewMenuBg: #383838; // context menu in Media Viewer background
|
||||
mediaviewMenuBgOver: #505050; // context menu item background with mouse over
|
||||
mediaviewMenuBgRipple: #676767; // context menu item ripple effect
|
||||
mediaviewMenuFg: windowFgActive; // context menu item text
|
||||
|
||||
mediaviewBg: #222222eb;
|
||||
mediaviewVideoBg: imageBg;
|
||||
mediaviewControlBg: #0000003c;
|
||||
mediaviewControlFg: windowFgActive;
|
||||
mediaviewCaptionBg: #11111180;
|
||||
mediaviewCaptionFg: mediaviewControlFg;
|
||||
mediaviewTextLinkFg: #91d9ff;
|
||||
mediaviewSaveMsgBg: toastBg;
|
||||
mediaviewSaveMsgFg: toastFg;
|
||||
mediaviewBg: #222222eb; // Media Viewer background
|
||||
mediaviewVideoBg: imageBg; // Media Viewer background when viewing a video in full screen
|
||||
mediaviewControlBg: #0000003c; // controls background (like next photo / previous photo)
|
||||
mediaviewControlFg: windowFgActive; // controls icon (like next photo / previous photo)
|
||||
mediaviewCaptionBg: #11111180; // caption text background (when viewing photo with caption)
|
||||
mediaviewCaptionFg: mediaviewControlFg; // caption text
|
||||
mediaviewTextLinkFg: #91d9ff; // caption text link
|
||||
mediaviewSaveMsgBg: toastBg; // save to file toast message background in Media Viewer
|
||||
mediaviewSaveMsgFg: toastFg; // save to file toast message text
|
||||
|
||||
mediaviewPlaybackActive: #c7c7c7;
|
||||
mediaviewPlaybackInactive: #252525;
|
||||
mediaviewPlaybackActiveOver: #ffffff;
|
||||
mediaviewPlaybackInactiveOver: #474747;
|
||||
mediaviewPlaybackProgressFg: #ffffffc7;
|
||||
mediaviewPlaybackIconFg: mediaviewPlaybackActive;
|
||||
mediaviewPlaybackIconFgOver: mediaviewPlaybackActiveOver;
|
||||
mediaviewTransparentBg: #ffffff;
|
||||
mediaviewTransparentFg: #cccccc;
|
||||
mediaviewPlaybackActive: #c7c7c7; // video playback progress already played part
|
||||
mediaviewPlaybackInactive: #252525; // video playback progress upcoming (not played yet) part
|
||||
mediaviewPlaybackActiveOver: #ffffff; // video playback progress already played part with mouse over
|
||||
mediaviewPlaybackInactiveOver: #474747; // video playback progress upcoming (not played yet) part with mouse over
|
||||
mediaviewPlaybackProgressFg: #ffffffc7; // video playback progress text
|
||||
mediaviewPlaybackIconFg: mediaviewPlaybackActive; // video playback controls icon
|
||||
mediaviewPlaybackIconFgOver: mediaviewPlaybackActiveOver; // video playback controls icon with mouse over
|
||||
mediaviewTransparentBg: #ffffff; // transparent filling part (when viewing a transparent .png file in Media Viewer)
|
||||
mediaviewTransparentFg: #cccccc; // another transparent filling part
|
||||
|
||||
// notification
|
||||
notificationBg: windowBg;
|
||||
notificationBg: windowBg; // custom notification window background
|
||||
|
||||
@@ -124,8 +124,6 @@ boxTextFgGood: #4ab44a;
|
||||
boxTextFgError: #d84d4d;
|
||||
boxTitleFg: #404040;
|
||||
boxSearchBg: boxBg;
|
||||
boxSearchCancelIconFg: cancelIconFg;
|
||||
boxSearchCancelIconFgOver: cancelIconFgOver;
|
||||
boxTitleAdditionalFg: #808080;
|
||||
boxTitleCloseFg: cancelIconFg;
|
||||
boxTitleCloseFgOver: cancelIconFgOver;
|
||||
@@ -196,7 +194,6 @@ dialogsUnreadFgActive: dialogsBgActive;
|
||||
dialogsForwardBg: dialogsBgActive;
|
||||
dialogsForwardFg: dialogsNameFgActive;
|
||||
searchedBarBg: windowBgOver;
|
||||
searchedBarBorder: shadowFg;
|
||||
searchedBarFg: windowSubTextFgOver;
|
||||
topBarBg: windowBg;
|
||||
emojiPanBg: windowBg;
|
||||
@@ -218,9 +215,6 @@ historyIconFgInverted: windowFgActive;
|
||||
historySendingOutIconFg: #98d292;
|
||||
historySendingInIconFg: #a0adb5;
|
||||
historySendingInvertedIconFg: #ffffffc8;
|
||||
historySystemBg: #89a0b47f;
|
||||
historySystemBgSelected: #bbc8d4a2;
|
||||
historySystemFg: windowFgActive;
|
||||
historyUnreadBarBg: #fcfbfa;
|
||||
historyUnreadBarBorder: shadowFg;
|
||||
historyUnreadBarFg: #538bb4;
|
||||
|
||||
BIN
Telegram/Resources/icons/color_slider_arrow.png
Normal file
|
After Width: | Height: | Size: 152 B |
BIN
Telegram/Resources/icons/color_slider_arrow@2x.png
Normal file
|
After Width: | Height: | Size: 193 B |
BIN
Telegram/Resources/icons/color_slider_arrow_vertical.png
Normal file
|
After Width: | Height: | Size: 175 B |
BIN
Telegram/Resources/icons/color_slider_arrow_vertical@2x.png
Normal file
|
After Width: | Height: | Size: 236 B |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
@@ -133,7 +133,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_edit_too_long" = "Your message text is too long";
|
||||
"lng_edit_message" = "Edit message";
|
||||
"lng_edit_message_text" = "New message text...";
|
||||
"lng_deleted" = "Unknown";
|
||||
"lng_deleted" = "Deleted Account";
|
||||
"lng_deleted_message" = "Deleted message";
|
||||
"lng_pinned_message" = "Pinned message";
|
||||
"lng_pinned_unpin_sure" = "Would you like to unpin this message?";
|
||||
@@ -224,7 +224,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_crop_profile" = "Select a square area for your profile photo";
|
||||
"lng_settings_uploading_photo" = "Uploading photo...";
|
||||
"lng_settings_edit" = "Edit";
|
||||
|
||||
"lng_settings_drop_area_subtitle" = "to set it as your photo";
|
||||
|
||||
"lng_username_title" = "Username";
|
||||
@@ -296,6 +295,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_bg_use_default" = "Use default color theme";
|
||||
"lng_settings_bg_from_gallery" = "Choose from gallery";
|
||||
"lng_settings_bg_from_file" = "Choose from file";
|
||||
"lng_settings_bg_edit_theme" = "Edit theme";
|
||||
"lng_settings_bg_tile" = "Tile background";
|
||||
"lng_settings_adaptive_wide" = "Adaptive layout for wide screens";
|
||||
|
||||
@@ -1010,7 +1010,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
|
||||
"lng_new_version_wrap" = "Telegram Desktop was updated to version {version}\n\n{changes}\n\nFull version history is available here:\n{link}";
|
||||
"lng_new_version_minor" = "— Bug fixes and other minor improvements";
|
||||
"lng_new_version_text" = "— Click and drag to reorder pinned chats.\n— Bug fixes and other minor improvements.";
|
||||
"lng_new_version_text" = "— Support for more emoji.\n— Click and drag on waveform to play audio from a chosen moment.\n— Added Theme editor to Settings.\n— Bug fixes and other minor improvements.";
|
||||
|
||||
"lng_menu_insert_unicode" = "Insert Unicode control character";
|
||||
|
||||
@@ -1023,6 +1023,22 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_confirm_phone_send" = "Send";
|
||||
"lng_confirm_phone_enter_code" = "Please enter the code.";
|
||||
|
||||
"lng_theme_editor_no_keys" = "No keys in the palette yet";
|
||||
"lng_theme_editor_cant_change_theme" = "You can not apply new themes while you're editing the color palette. Please close the theme editor first.";
|
||||
"lng_theme_editor_new_keys" = "Not in the palette yet";
|
||||
"lng_theme_editor_background_image" = "Background image";
|
||||
"lng_theme_editor_saved_to_jpg" = "Saved to JPEG, {size}";
|
||||
"lng_theme_editor_read_from_jpg" = "JPEG image, {size}";
|
||||
"lng_theme_editor_read_from_png" = "PNG image, {size}";
|
||||
"lng_theme_editor_export" = "Export";
|
||||
"lng_theme_editor_choose_image" = "Choose background image";
|
||||
"lng_theme_editor_save_palette" = "Save palette file";
|
||||
"lng_theme_editor_choose_name" = "Save theme file";
|
||||
"lng_theme_editor_error" = "The editor encountered an error :( See 'log.txt' for details.";
|
||||
"lng_theme_editor_done" = "Theme exported successfully!";
|
||||
"lng_theme_editor_title" = "Edit color palette";
|
||||
"lng_theme_editor_export_button" = "Export theme";
|
||||
|
||||
// Not used
|
||||
|
||||
"lng_topbar_info" = "Info";
|
||||
|
||||
@@ -224,7 +224,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_crop_profile" = "Sichtbaren Bereich für Bild wählen";
|
||||
"lng_settings_uploading_photo" = "Bild wird geladen...";
|
||||
"lng_settings_edit" = "Bearbeiten";
|
||||
|
||||
"lng_settings_drop_area_subtitle" = "um es als dein Bild auszuwählen";
|
||||
|
||||
"lng_username_title" = "Benutzername";
|
||||
@@ -296,6 +295,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_bg_use_default" = "Benutze Standardthema";
|
||||
"lng_settings_bg_from_gallery" = "Aus der Galerie";
|
||||
"lng_settings_bg_from_file" = "Durchsuchen";
|
||||
"lng_settings_bg_edit_theme" = "Thema bearbeiten";
|
||||
"lng_settings_bg_tile" = "Nebeneinander";
|
||||
"lng_settings_adaptive_wide" = "Flexibles Layout für breite Bildschirme";
|
||||
|
||||
@@ -1010,7 +1010,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
|
||||
"lng_new_version_wrap" = "Telegram Desktop wurde aktualisiert auf Version {version}\n\n{changes}\n\nGesamter Versionsverlauf:\n{link}";
|
||||
"lng_new_version_minor" = "— Fehlerbehebungen und Softwareoptimierungen";
|
||||
"lng_new_version_text" = "— Angeheftete Chats lassen sich verschieben (gedrückt halten und nach oben oder unter ziehen).\n— Fehlerbehebungen und sonstige Softwareoptimierungen.";
|
||||
"lng_new_version_text" = "— Weitere Emoji wurden hinzugefügt.\n— Springe an jede gewünschte Stelle einer Sprachnachricht (klicken und ziehen).\n— Themen-Editor wurde Einstellungen hinzugefügt.\n— Fehlerbehebungen und sonstige Verbesserungen.";
|
||||
|
||||
"lng_menu_insert_unicode" = "Unicode-Steuerzeichen einfügen";
|
||||
|
||||
@@ -1023,6 +1023,22 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_confirm_phone_send" = "Senden";
|
||||
"lng_confirm_phone_enter_code" = "Bitte den Code eingeben.";
|
||||
|
||||
"lng_theme_editor_no_keys" = "Noch keine Werte in der Palette";
|
||||
"lng_theme_editor_cant_change_theme" = "Neue Themen kannst du während der Bearbeitung nicht anwenden. Bitte schliesse zuerst den Editor.";
|
||||
"lng_theme_editor_new_keys" = "Noch nicht in der Palette";
|
||||
"lng_theme_editor_background_image" = "Hintergrundbild";
|
||||
"lng_theme_editor_saved_to_jpg" = "Als JPEG gespeichert, {size}";
|
||||
"lng_theme_editor_read_from_jpg" = "JPEG Bild, {size}";
|
||||
"lng_theme_editor_read_from_png" = "PNG Bild, {size}";
|
||||
"lng_theme_editor_export" = "Exportieren";
|
||||
"lng_theme_editor_choose_image" = "Hintergrundbild wählen";
|
||||
"lng_theme_editor_save_palette" = "Palettendatei speichern";
|
||||
"lng_theme_editor_choose_name" = "Themen-Datei speichern";
|
||||
"lng_theme_editor_error" = "Ein Fehler ist im Editor aufgetreten. Mehr Infos gibt es in der Datei 'log.txt'.";
|
||||
"lng_theme_editor_done" = "Thema erfolgreich exportiert!";
|
||||
"lng_theme_editor_title" = "Farbpalette bearbeiten";
|
||||
"lng_theme_editor_export_button" = "Thema exportieren";
|
||||
|
||||
// Not used
|
||||
|
||||
"lng_topbar_info" = "Info";
|
||||
|
||||
@@ -224,7 +224,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_crop_profile" = "Selecciona el área para tu foto de perfil";
|
||||
"lng_settings_uploading_photo" = "Subiendo foto...";
|
||||
"lng_settings_edit" = "Editar";
|
||||
|
||||
"lng_settings_drop_area_subtitle" = "para ponerla como tu foto";
|
||||
|
||||
"lng_username_title" = "Alias";
|
||||
@@ -296,6 +295,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_bg_use_default" = "Usar el tema por defecto";
|
||||
"lng_settings_bg_from_gallery" = "Elegir desde la galería";
|
||||
"lng_settings_bg_from_file" = "Elegir desde archivos";
|
||||
"lng_settings_bg_edit_theme" = "Editar tema";
|
||||
"lng_settings_bg_tile" = "Fondo con mosaico";
|
||||
"lng_settings_adaptive_wide" = "Diseño adaptable para pantallas anchas";
|
||||
|
||||
@@ -1010,7 +1010,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
|
||||
"lng_new_version_wrap" = "Telegram Desktop ha sido actualizada a la versión {version}\n\n{changes}\n\nEl historial completo está disponible aquí:\n{link}";
|
||||
"lng_new_version_minor" = "— Corrección de errores y otras mejoras menores";
|
||||
"lng_new_version_text" = "— Arrastra un chat anclado para cambiar su posición.\n— Corrección de errores y otras mejoras menores.";
|
||||
"lng_new_version_text" = "— Soporte de más emojis.\n— Haz clic y arrastra sobre la onda de audio para reproducir el momento que quieras.\n— Editor de temas añadido a Ajustes.\n— Corrección de errores y otras mejoras menores.";
|
||||
|
||||
"lng_menu_insert_unicode" = "Insertar caracteres de control Unicode";
|
||||
|
||||
@@ -1023,6 +1023,22 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_confirm_phone_send" = "Enviar";
|
||||
"lng_confirm_phone_enter_code" = "Por favor, pon el código.";
|
||||
|
||||
"lng_theme_editor_no_keys" = "Aún no hay valores en la paleta";
|
||||
"lng_theme_editor_cant_change_theme" = "No puedes aplicar nuevos temas mientras editas la paleta de colores. Por favor, cierra el editor de temas primero.";
|
||||
"lng_theme_editor_new_keys" = "Aún no está en la paleta";
|
||||
"lng_theme_editor_background_image" = "Imagen de fondo";
|
||||
"lng_theme_editor_saved_to_jpg" = "Guardado como JPEG, {size}";
|
||||
"lng_theme_editor_read_from_jpg" = "Imagen JPEG, {size}";
|
||||
"lng_theme_editor_read_from_png" = "Imagen PNG, {size}";
|
||||
"lng_theme_editor_export" = "Exportar";
|
||||
"lng_theme_editor_choose_image" = "Elige la imagen de fondo";
|
||||
"lng_theme_editor_save_palette" = "Guardar archivo de la paleta de colores";
|
||||
"lng_theme_editor_choose_name" = "Guardar archivo del tema";
|
||||
"lng_theme_editor_error" = "El editor encontró un error :( Ve “log.txt” para los detalles.";
|
||||
"lng_theme_editor_done" = "¡Tema exportado con éxito!";
|
||||
"lng_theme_editor_title" = "Editar la paleta de colores";
|
||||
"lng_theme_editor_export_button" = "Exportar tema";
|
||||
|
||||
// Not used
|
||||
|
||||
"lng_topbar_info" = "Información";
|
||||
|
||||
@@ -19,7 +19,7 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
"lng_language_name" = "Italiano";
|
||||
"lng_switch_to_this" = "Passa all'italiano";
|
||||
"lng_switch_to_this" = "Passa all'Italiano";
|
||||
|
||||
"lng_menu_contacts" = "Contatti";
|
||||
"lng_menu_settings" = "Impostazioni";
|
||||
@@ -224,7 +224,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_crop_profile" = "Seleziona un riquadro per la tua foto profilo";
|
||||
"lng_settings_uploading_photo" = "Carico foto...";
|
||||
"lng_settings_edit" = "Modifica";
|
||||
|
||||
"lng_settings_drop_area_subtitle" = "per impostarla come foto profilo";
|
||||
|
||||
"lng_username_title" = "Username";
|
||||
@@ -296,6 +295,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_bg_use_default" = "Usa tema predefinito";
|
||||
"lng_settings_bg_from_gallery" = "Scegli dalla galleria";
|
||||
"lng_settings_bg_from_file" = "Scegli da file";
|
||||
"lng_settings_bg_edit_theme" = "Modifica tema";
|
||||
"lng_settings_bg_tile" = "Affianca sfondo";
|
||||
"lng_settings_adaptive_wide" = "Layout adattivo per grandi schermi";
|
||||
|
||||
@@ -1010,7 +1010,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
|
||||
"lng_new_version_wrap" = "Telegram Desktop si è aggiornato alla versione {version}\n\n{changes}\n\nLa cronologia degli aggiornamenti è disponibile qui:\n{link}";
|
||||
"lng_new_version_minor" = "— Risoluzione di problemi e altri miglioramenti minori";
|
||||
"lng_new_version_text" = "— Premi e trascina per riordinare le chat fissate.\n— Risoluzione di problemi e altri miglioramenti minori.";
|
||||
"lng_new_version_text" = "— Supporto per più emoji.\n— Clicca e trascina sui messaggi vocali per riprodurli da dove vuoi.\n— Aggiunto l'editor temi nelle Impostazioni.\n— Risoluzione di problemi e altri miglioramenti minori.";
|
||||
|
||||
"lng_menu_insert_unicode" = "Inserisci carattere di controllo Unicode";
|
||||
|
||||
@@ -1023,6 +1023,22 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_confirm_phone_send" = "Invia";
|
||||
"lng_confirm_phone_enter_code" = "Per favore inserisci il codice.";
|
||||
|
||||
"lng_theme_editor_no_keys" = "Ancora nessun valore nella tavolozza";
|
||||
"lng_theme_editor_cant_change_theme" = "Non puoi applicare nuovi temi mentre modifichi la tavolozza dei colori. Per favore chiudi prima l'editor dei temi.";
|
||||
"lng_theme_editor_new_keys" = "Non ancora nella tavolozza";
|
||||
"lng_theme_editor_background_image" = "Immagine di sfondo";
|
||||
"lng_theme_editor_saved_to_jpg" = "Salvato in JPEG, {size}";
|
||||
"lng_theme_editor_read_from_jpg" = "Immagine JPEG, {size}";
|
||||
"lng_theme_editor_read_from_png" = "Immagine PNG, {size}";
|
||||
"lng_theme_editor_export" = "Esporta";
|
||||
"lng_theme_editor_choose_image" = "Scegli immagine di sfondo";
|
||||
"lng_theme_editor_save_palette" = "Salva file tavolozza";
|
||||
"lng_theme_editor_choose_name" = "Salva file tema";
|
||||
"lng_theme_editor_error" = "L'editor ha rilevato un errore :( Controlla 'log.txt' per i dettagli.";
|
||||
"lng_theme_editor_done" = "Tema esportato con successo!";
|
||||
"lng_theme_editor_title" = "Modifica tavolozza dei colori";
|
||||
"lng_theme_editor_export_button" = "Esporta tema";
|
||||
|
||||
// Not used
|
||||
|
||||
"lng_topbar_info" = "Info";
|
||||
|
||||
@@ -224,7 +224,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_crop_profile" = "프로필 사진으로 사용할 사각영역을 선택하세요";
|
||||
"lng_settings_uploading_photo" = "사진 업로드 중...";
|
||||
"lng_settings_edit" = "수정";
|
||||
|
||||
"lng_settings_drop_area_subtitle" = "프로필 사진으로 설정";
|
||||
|
||||
"lng_username_title" = "아이디";
|
||||
@@ -296,6 +295,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_bg_use_default" = "기존 테마 색상 사용";
|
||||
"lng_settings_bg_from_gallery" = "이미지 선택";
|
||||
"lng_settings_bg_from_file" = "파일 선택";
|
||||
"lng_settings_bg_edit_theme" = "테마 수정";
|
||||
"lng_settings_bg_tile" = "타일형 배경화면";
|
||||
"lng_settings_adaptive_wide" = "와이드 스크린 레이아웃 적용";
|
||||
|
||||
@@ -746,7 +746,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_in_dlg_sticker_emoji" = "{emoji} 스티커";
|
||||
|
||||
"lng_ban_user" = "차단하기";
|
||||
"lng_delete_all_from" = "모두에게 메시지 삭제";
|
||||
"lng_delete_all_from" = "사용자의 모든 메시지 삭제";
|
||||
"lng_report_spam" = "스팸 신고";
|
||||
"lng_report_spam_hide" = "숨기기";
|
||||
"lng_report_spam_thanks" = "신고해주셔서 감사합니다!";
|
||||
@@ -1010,7 +1010,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
|
||||
"lng_new_version_wrap" = "텔레그램 데스크탑은 {version} 버전으로 업데이트 되었습니다.\n\n{changes}\n\n전체 버전 히스토리는 아래에서 확인 가능합니다:\n{link}";
|
||||
"lng_new_version_minor" = "— 버그 수정 및 일부 기능 향상";
|
||||
"lng_new_version_text" = "— 클릭 후 드래그로 고정된 대화 순서 변경\n— 버그 수정 및 일부기능 향상";
|
||||
"lng_new_version_text" = "— 더많은 이모티콘 지원\n— 오디오 구간을 선택하여 원하는 시간대 재생\n— 설정에 테마 에디터 추가\n— 버그 수정 및 일부 기능 향상";
|
||||
|
||||
"lng_menu_insert_unicode" = "유니코드 문자를 입력하세요.";
|
||||
|
||||
@@ -1023,6 +1023,22 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_confirm_phone_send" = "보내기";
|
||||
"lng_confirm_phone_enter_code" = "코드를 입력해주세요";
|
||||
|
||||
"lng_theme_editor_no_keys" = "팔레트에 아직 키가 없습니다";
|
||||
"lng_theme_editor_cant_change_theme" = "색상 팔레트를 수정하는 동시에 새로운 테마를 적용할 수 없습니다. 테마 에디터를 먼저 닫아주세요.";
|
||||
"lng_theme_editor_new_keys" = "팔레트에 아직 없습니다.";
|
||||
"lng_theme_editor_background_image" = "배경 이미지";
|
||||
"lng_theme_editor_saved_to_jpg" = "JPEG로 저장, {size}";
|
||||
"lng_theme_editor_read_from_jpg" = "JPEG 이미지, {size}";
|
||||
"lng_theme_editor_read_from_png" = "PNG 이미지, {size}";
|
||||
"lng_theme_editor_export" = "내보내기";
|
||||
"lng_theme_editor_choose_image" = "배경 이미지 선택";
|
||||
"lng_theme_editor_save_palette" = "팔레트 파일 저장";
|
||||
"lng_theme_editor_choose_name" = "테마 파일 저장";
|
||||
"lng_theme_editor_error" = "에디터 오류가 발생하였습니다 :( 'log.txt' 에서 자세한 내역 확인하세요.";
|
||||
"lng_theme_editor_done" = "성공적으로 테마 내보내기가 완료되었습니다!";
|
||||
"lng_theme_editor_title" = "색상 팔레트 수정";
|
||||
"lng_theme_editor_export_button" = "테마 내보내기";
|
||||
|
||||
// Not used
|
||||
|
||||
"lng_topbar_info" = "정보";
|
||||
|
||||
@@ -224,7 +224,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_crop_profile" = "Kies een vierkant voor je profielfoto";
|
||||
"lng_settings_uploading_photo" = "Foto uploaden...";
|
||||
"lng_settings_edit" = "Wijzig";
|
||||
|
||||
"lng_settings_drop_area_subtitle" = "om als foto in te stellen";
|
||||
|
||||
"lng_username_title" = "Gebruikersnaam";
|
||||
@@ -296,6 +295,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_bg_use_default" = "Standaardthema gebruiken";
|
||||
"lng_settings_bg_from_gallery" = "Uit galerij kiezen";
|
||||
"lng_settings_bg_from_file" = "Bestand kiezen";
|
||||
"lng_settings_bg_edit_theme" = "Thema wijzigen";
|
||||
"lng_settings_bg_tile" = "Naast elkaar";
|
||||
"lng_settings_adaptive_wide" = "Adaptieve layout voor brede schermen";
|
||||
|
||||
@@ -1010,7 +1010,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
|
||||
"lng_new_version_wrap" = "Telegram is bijgewerkt naar versie {version}\n\n{changes} \n\nVolledige versiegeschiedenis is hier te vinden:\n{link}";
|
||||
"lng_new_version_minor" = "— Probleemoplossing en andere kleine verbeteringen";
|
||||
"lng_new_version_text" = "— Klik en sleep om de volgorde van vastgezette chats aan te passen.\n— Probleemoplossing en andere kleine verbeteringen.";
|
||||
"lng_new_version_text" = "— Ondersteuning voor meer Emoji\n— Klik en sleep om naar de gewenste tijd te springen in spraakberichten.\n— Thema-editor toegevoegd aan instellingen.\n— Probleemoplossing en andere kleine verbeteringen.";
|
||||
|
||||
"lng_menu_insert_unicode" = "Unicode-besturingsteken invoegen";
|
||||
|
||||
@@ -1023,6 +1023,22 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_confirm_phone_send" = "Stuur";
|
||||
"lng_confirm_phone_enter_code" = "Geef de code in.";
|
||||
|
||||
"lng_theme_editor_no_keys" = "Palet bevat nog geen waarden";
|
||||
"lng_theme_editor_cant_change_theme" = "Je kunt geen nieuw thema toepassen terwijl je het kleurenpalet bewerkt. Sluit eerst de editor.";
|
||||
"lng_theme_editor_new_keys" = "Nog niet in het kleurenpalet";
|
||||
"lng_theme_editor_background_image" = "Achtergrondafbeelding";
|
||||
"lng_theme_editor_saved_to_jpg" = "Opgeslagen als JPEG, {size}";
|
||||
"lng_theme_editor_read_from_jpg" = "JPEG-afbeelding, {size}";
|
||||
"lng_theme_editor_read_from_png" = "PNG-afbeelding, {size}";
|
||||
"lng_theme_editor_export" = "Exporteren";
|
||||
"lng_theme_editor_choose_image" = "Achtergrondafbeelding kiezen";
|
||||
"lng_theme_editor_save_palette" = "Kleurenpalet opslaan";
|
||||
"lng_theme_editor_choose_name" = "Thema opslaan";
|
||||
"lng_theme_editor_error" = "Er is iets misgegaan in de editor :( Bekijk 'log.txt' voor meer info.";
|
||||
"lng_theme_editor_done" = "Exporteren van thema gelukt!";
|
||||
"lng_theme_editor_title" = "Kleurenpalet bewerken";
|
||||
"lng_theme_editor_export_button" = "Thema exporteren";
|
||||
|
||||
// Not used
|
||||
|
||||
"lng_topbar_info" = "Info";
|
||||
|
||||
@@ -224,7 +224,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_crop_profile" = "Selecione uma área para a foto do perfil";
|
||||
"lng_settings_uploading_photo" = "Carregando foto...";
|
||||
"lng_settings_edit" = "Editar";
|
||||
|
||||
"lng_settings_drop_area_subtitle" = "para defini-la como sua foto";
|
||||
|
||||
"lng_username_title" = "Nome de usuário";
|
||||
@@ -296,12 +295,13 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_settings_bg_use_default" = "Usar o tema padrão de cores";
|
||||
"lng_settings_bg_from_gallery" = "Escolher da galeria";
|
||||
"lng_settings_bg_from_file" = "Escolher dos arquivos";
|
||||
"lng_settings_bg_edit_theme" = "Editar tema";
|
||||
"lng_settings_bg_tile" = "Lado-a-lado";
|
||||
"lng_settings_adaptive_wide" = "Layout adaptativo para wide screens";
|
||||
"lng_settings_adaptive_wide" = "Layout adaptativo para telas wide";
|
||||
|
||||
"lng_backgrounds_header" = "Escolha o seu novo papel de parede";
|
||||
"lng_theme_sure_keep" = "Manter esse tema de cores?";
|
||||
"lng_theme_reverting" = "Revertendo ao antigo tema de cores em {count:_not_used_|# segundo|# segundos}.";
|
||||
"lng_theme_reverting" = "Revertendo ao antigo tema em {count:_not_used_|# segundo|# segundos}.";
|
||||
"lng_theme_keep_changes" = "Manter alterações";
|
||||
"lng_theme_revert" = "Reverter";
|
||||
|
||||
@@ -1010,7 +1010,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
|
||||
"lng_new_version_wrap" = "Telegram Desktop foi atualizado para a versão {version}\n\n{changes}\n\nHistórico completo de mudanças disponível aqui:\n{link}";
|
||||
"lng_new_version_minor" = "— Resolução de bugs e outras melhorias menores";
|
||||
"lng_new_version_text" = "— Clique e arraste para reordenar os chats fixados.\n— Resolução de bugs e outras melhorias.";
|
||||
"lng_new_version_text" = "— Suporte para mais emojis.\n— Pule para qualquer posição ao ouvir uma mensagem de voz.\n— Adicionado um editor de Temas nas Configurações.\n— Resolução de bugs e outras melhorias.";
|
||||
|
||||
"lng_menu_insert_unicode" = "Inserir caractere de controle Unicode";
|
||||
|
||||
@@ -1023,6 +1023,22 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
"lng_confirm_phone_send" = "Enviar";
|
||||
"lng_confirm_phone_enter_code" = "Por favor, insira o código.";
|
||||
|
||||
"lng_theme_editor_no_keys" = "Ainda não há chaves na paleta";
|
||||
"lng_theme_editor_cant_change_theme" = "Você não pode aplicar novos temas enquanto está editando a paleta de cores. Feche o editor de temas primeiro.";
|
||||
"lng_theme_editor_new_keys" = "Ainda não está na paleta";
|
||||
"lng_theme_editor_background_image" = "Imagem de fundo";
|
||||
"lng_theme_editor_saved_to_jpg" = "Salvar como JPEG, {size}";
|
||||
"lng_theme_editor_read_from_jpg" = "Imagem JPEG, {size}";
|
||||
"lng_theme_editor_read_from_png" = "Imagem PNG, {size}";
|
||||
"lng_theme_editor_export" = "Exportar";
|
||||
"lng_theme_editor_choose_image" = "Escolher imagem de fundo";
|
||||
"lng_theme_editor_save_palette" = "Salvar arquivo de paleta";
|
||||
"lng_theme_editor_choose_name" = "Salvar arquivo de tema";
|
||||
"lng_theme_editor_error" = "O editor encontrou um erro :( Veja o 'log.txt' para detalhes.";
|
||||
"lng_theme_editor_done" = "Tema exportado com sucesso!";
|
||||
"lng_theme_editor_title" = "Editar paleta de cores";
|
||||
"lng_theme_editor_export_button" = "Exportar tema";
|
||||
|
||||
// Not used
|
||||
|
||||
"lng_topbar_info" = "Info";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
FullExecPath=$PWD
|
||||
pushd `dirname $0` > /dev/null
|
||||
|
||||
@@ -4,6 +4,5 @@
|
||||
<file>art/emoji_125x.webp</file>
|
||||
<file>art/emoji_150x.webp</file>
|
||||
<file>art/emoji_200x.webp</file>
|
||||
<file>art/emoji_250x.webp</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
5
Telegram/Resources/telegram_emoji_large.qrc
Normal file
@@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/gui">
|
||||
<file>art/emoji_250x.webp</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -2,22 +2,25 @@
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities">
|
||||
xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2"
|
||||
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
|
||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||
IgnorableNamespaces="uap uap2 uap3 rescap">
|
||||
<Identity Name="TelegramDesktop"
|
||||
ProcessorArchitecture="x64"
|
||||
Publisher="CN=Telegram Messenger LLP, O=Telegram Messenger LLP, L=London, C=GB"
|
||||
Version="1.0.6.0" />
|
||||
Version="1.0.15.0" />
|
||||
<Properties>
|
||||
<DisplayName>Telegram Desktop</DisplayName>
|
||||
<PublisherDisplayName>Reserved</PublisherDisplayName>
|
||||
<Description>No description entered</Description>
|
||||
<Logo>Assets\logo.png</Logo>
|
||||
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>
|
||||
<Description>Telegram Desktop official messenger</Description>
|
||||
<Logo>Assets\logo\logo.png</Logo>
|
||||
</Properties>
|
||||
<Resources>
|
||||
<Resource Language="en-us" />
|
||||
</Resources>
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="1.0.6.0" MaxVersionTested="10.0.14316.0" />
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.14316.0" />
|
||||
</Dependencies>
|
||||
<Capabilities>
|
||||
<rescap:Capability Name="runFullTrust"/>
|
||||
@@ -25,11 +28,16 @@
|
||||
<Applications>
|
||||
<Application Id="Telegram.TelegramDesktop.Store" Executable="Telegram.exe" EntryPoint="Windows.FullTrustApplication">
|
||||
<uap:VisualElements
|
||||
BackgroundColor="#0e6b99"
|
||||
BackgroundColor="transparent"
|
||||
DisplayName="Telegram Desktop"
|
||||
Square150x150Logo="Assets\logo150.png"
|
||||
Square44x44Logo="Assets\logo44.png"
|
||||
Square150x150Logo="Assets\logo150\logo150.png"
|
||||
Square44x44Logo="Assets\logo44\logo44.png"
|
||||
Description="Telegram Desktop official messenger" />
|
||||
<Extensions>
|
||||
<uap3:Extension Category="windows.protocol">
|
||||
<uap3:Protocol Name="tg" Parameters="-- "%1"" />
|
||||
</uap3:Extension>
|
||||
</Extensions>
|
||||
</Application>
|
||||
</Applications>
|
||||
</Package>
|
||||
BIN
Telegram/Resources/uwp/AppX/Assets/logo/logo.scale-100.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
Telegram/Resources/uwp/AppX/Assets/logo/logo.scale-125.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
Telegram/Resources/uwp/AppX/Assets/logo/logo.scale-150.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
Telegram/Resources/uwp/AppX/Assets/logo/logo.scale-200.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
Telegram/Resources/uwp/AppX/Assets/logo/logo.scale-400.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
BIN
Telegram/Resources/uwp/AppX/Assets/logo150/logo150.scale-125.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
Telegram/Resources/uwp/AppX/Assets/logo150/logo150.scale-150.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
Telegram/Resources/uwp/AppX/Assets/logo150/logo150.scale-200.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
Telegram/Resources/uwp/AppX/Assets/logo150/logo150.scale-400.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
BIN
Telegram/Resources/uwp/AppX/Assets/logo44/logo44.scale-125.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
Telegram/Resources/uwp/AppX/Assets/logo44/logo44.scale-150.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
Telegram/Resources/uwp/AppX/Assets/logo44/logo44.scale-200.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
Telegram/Resources/uwp/AppX/Assets/logo44/logo44.scale-400.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 852 B |
|
After Width: | Height: | Size: 852 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
@@ -1,6 +0,0 @@
|
||||
[Files]
|
||||
"..\out\Release\Telegram.exe" "Telegram.exe"
|
||||
"Resources\uwp\appxmanifest.xml" "AppxManifest.xml"
|
||||
"Resources\art\uwp\logo.png" "Assets\logo.png"
|
||||
"Resources\art\uwp\logo44.png" "Assets\logo44.png"
|
||||
"Resources\art\uwp\logo150.png" "Assets\logo150.png"
|
||||
23
Telegram/Resources/uwp/priconfig.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<resources targetOsVersion="10.0.0" majorVersion="1">
|
||||
<index root="\" startIndexAt="\">
|
||||
<default>
|
||||
<qualifier name="Language" value="en-US"/>
|
||||
<qualifier name="Contrast" value="standard"/>
|
||||
<qualifier name="Scale" value="100"/>
|
||||
<qualifier name="HomeRegion" value="001"/>
|
||||
<qualifier name="TargetSize" value="256"/>
|
||||
<qualifier name="LayoutDirection" value="LTR"/>
|
||||
<qualifier name="Theme" value="dark"/>
|
||||
<qualifier name="AlternateForm" value=""/>
|
||||
<qualifier name="DXFeatureLevel" value="DX9"/>
|
||||
<qualifier name="Configuration" value=""/>
|
||||
<qualifier name="DeviceFamily" value="Universal"/>
|
||||
<qualifier name="Custom" value=""/>
|
||||
</default>
|
||||
<indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true" qualifierDelimiter="."/>
|
||||
<indexer-config type="resw" convertDotsToSlashes="true" initialPath=""/>
|
||||
<indexer-config type="resjson" initialPath=""/>
|
||||
<indexer-config type="PRI"/>
|
||||
</index>
|
||||
</resources>
|
||||
@@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,6,0
|
||||
PRODUCTVERSION 1,0,6,0
|
||||
FILEVERSION 1,0,15,0
|
||||
PRODUCTVERSION 1,0,15,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -51,10 +51,11 @@ BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Telegram Messenger LLP"
|
||||
VALUE "FileVersion", "1.0.6.0"
|
||||
VALUE "FileDescription", "Telegram Desktop"
|
||||
VALUE "FileVersion", "1.0.15.0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2014-2017"
|
||||
VALUE "ProductName", "Telegram Desktop"
|
||||
VALUE "ProductVersion", "1.0.6.0"
|
||||
VALUE "ProductVersion", "1.0.15.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,6,0
|
||||
PRODUCTVERSION 1,0,6,0
|
||||
FILEVERSION 1,0,15,0
|
||||
PRODUCTVERSION 1,0,15,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -42,11 +42,11 @@ BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Telegram Messenger LLP"
|
||||
VALUE "FileDescription", "Telegram Updater"
|
||||
VALUE "FileVersion", "1.0.6.0"
|
||||
VALUE "FileDescription", "Telegram Desktop Updater"
|
||||
VALUE "FileVersion", "1.0.15.0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2014-2017"
|
||||
VALUE "ProductName", "Telegram Desktop"
|
||||
VALUE "ProductVersion", "1.0.6.0"
|
||||
VALUE "ProductVersion", "1.0.15.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
Telegram Desktop is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
It is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
In addition, as a special exception, the copyright holders give permission
|
||||
to link the code of portions of this program with the OpenSSL library.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QBuffer>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QRegularExpression>
|
||||
#include <QtGui/QImage>
|
||||
#include <QtGui/QPainter>
|
||||
#include <iostream>
|
||||
#include <exception>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtGui/QGuiApplication>
|
||||
|
||||
using std::string;
|
||||
using std::cout;
|
||||
using std::cerr;
|
||||
using std::exception;
|
||||
|
||||
class Exception : public exception {
|
||||
public:
|
||||
|
||||
Exception(const QString &msg) : _msg(msg.toUtf8()) {
|
||||
}
|
||||
|
||||
virtual const char *what() const throw() {
|
||||
return _msg.constData();
|
||||
}
|
||||
virtual ~Exception() throw() {
|
||||
}
|
||||
|
||||
private:
|
||||
QByteArray _msg;
|
||||
};
|
||||
|
||||
bool genEmoji(QString emoji_in, const QString &emoji_out, const QString &emoji_png);
|
||||
|
||||
class GenEmoji : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GenEmoji(const QString &emoji_in, const QString &emoji_out, const QString &emoji_png) : QObject(0),
|
||||
_emoji_in(emoji_in), _emoji_out(emoji_out), _emoji_png(emoji_png) {
|
||||
}
|
||||
|
||||
public slots :
|
||||
void run() {
|
||||
if (genEmoji(_emoji_in, _emoji_out, _emoji_png)) {
|
||||
emit finished();
|
||||
}
|
||||
}
|
||||
|
||||
signals:
|
||||
void finished();
|
||||
|
||||
private:
|
||||
|
||||
QString _emoji_in, _emoji_out, _emoji_png;
|
||||
};
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
Telegram Desktop is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
It is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
In addition, as a special exception, the copyright holders give permission
|
||||
to link the code of portions of this program with the OpenSSL library.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "memain.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
QString emoji_in("./Resources/art/emojisprite_"), emoji_out("./SourceFiles/gui/emoji_config.cpp"), emoji_png("./Resources/art/emoji");
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
if (string("-emoji_in") == argv[i]) {
|
||||
if (++i < argc) emoji_in = argv[i];
|
||||
} else if (string("-emoji_out") == argv[i]) {
|
||||
if (++i < argc) emoji_out = argv[i];
|
||||
} else if (string("-emoji_png") == argv[i]) {
|
||||
if (++i < argc) emoji_png = argv[i];
|
||||
}
|
||||
}
|
||||
#ifdef Q_OS_MAC
|
||||
if (QDir(QString()).absolutePath() == "/") {
|
||||
QString first = argc ? QString::fromLocal8Bit(argv[0]) : QString();
|
||||
if (!first.isEmpty()) {
|
||||
QFileInfo info(first);
|
||||
if (info.exists()) {
|
||||
QDir result(info.absolutePath() + "/../../..");
|
||||
QString basePath = result.absolutePath() + '/';
|
||||
emoji_in = basePath + emoji_in;
|
||||
emoji_out = basePath + emoji_out;
|
||||
emoji_png = basePath + emoji_png;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
QObject *taskImpl = new GenEmoji(emoji_in, emoji_out, emoji_png);
|
||||
|
||||
QGuiApplication a(argc, argv);
|
||||
|
||||
QObject::connect(taskImpl, SIGNAL(finished()), &a, SLOT(quit()));
|
||||
QTimer::singleShot(0, taskImpl, SLOT(run()));
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
@@ -29,8 +29,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
#include "mainwidget.h"
|
||||
#include "historywidget.h"
|
||||
#include "localstorage.h"
|
||||
#include "auth_session.h"
|
||||
#include "boxes/confirmbox.h"
|
||||
#include "window/window_theme.h"
|
||||
#include "window/themes/window_theme.h"
|
||||
|
||||
ApiWrap::ApiWrap(QObject *parent) : QObject(parent)
|
||||
, _messageDataResolveDelayed(new SingleDelayedCall(this, "resolveMessageDatas")) {
|
||||
@@ -43,7 +44,7 @@ ApiWrap::ApiWrap(QObject *parent) : QObject(parent)
|
||||
void ApiWrap::init() {
|
||||
}
|
||||
|
||||
void ApiWrap::requestMessageData(ChannelData *channel, MsgId msgId, const RequestMessageDataCallback &callback) {
|
||||
void ApiWrap::requestMessageData(ChannelData *channel, MsgId msgId, RequestMessageDataCallback callback) {
|
||||
MessageDataRequest &req(channel ? _channelMessageDataRequests[channel][msgId] : _messageDataRequests[msgId]);
|
||||
if (callback) {
|
||||
req.callbacks.append(callback);
|
||||
@@ -591,27 +592,27 @@ void ApiWrap::gotSelfParticipant(ChannelData *channel, const MTPchannels_Channel
|
||||
return;
|
||||
}
|
||||
|
||||
const auto &p(result.c_channels_channelParticipant());
|
||||
auto &p = result.c_channels_channelParticipant();
|
||||
App::feedUsers(p.vusers);
|
||||
|
||||
switch (p.vparticipant.type()) {
|
||||
case mtpc_channelParticipantSelf: {
|
||||
const auto &d(p.vparticipant.c_channelParticipantSelf());
|
||||
auto &d = p.vparticipant.c_channelParticipantSelf();
|
||||
channel->inviter = d.vinviter_id.v;
|
||||
channel->inviteDate = date(d.vdate);
|
||||
} break;
|
||||
case mtpc_channelParticipantCreator: {
|
||||
const auto &d(p.vparticipant.c_channelParticipantCreator());
|
||||
channel->inviter = MTP::authedId();
|
||||
auto &d = p.vparticipant.c_channelParticipantCreator();
|
||||
channel->inviter = AuthSession::CurrentUserId();
|
||||
channel->inviteDate = date(MTP_int(channel->date));
|
||||
} break;
|
||||
case mtpc_channelParticipantModerator: {
|
||||
const auto &d(p.vparticipant.c_channelParticipantModerator());
|
||||
auto &d = p.vparticipant.c_channelParticipantModerator();
|
||||
channel->inviter = d.vinviter_id.v;
|
||||
channel->inviteDate = date(d.vdate);
|
||||
} break;
|
||||
case mtpc_channelParticipantEditor: {
|
||||
const auto &d(p.vparticipant.c_channelParticipantEditor());
|
||||
auto &d = p.vparticipant.c_channelParticipantEditor();
|
||||
channel->inviter = d.vinviter_id.v;
|
||||
channel->inviteDate = date(d.vdate);
|
||||
} break;
|
||||
@@ -1089,22 +1090,24 @@ void ApiWrap::gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result)
|
||||
} else {
|
||||
it->stickers = pack;
|
||||
it->emoji.clear();
|
||||
const auto &v(d.vpacks.c_vector().v);
|
||||
for (int32 i = 0, l = v.size(); i < l; ++i) {
|
||||
if (v.at(i).type() != mtpc_stickerPack) continue;
|
||||
auto &v = d.vpacks.c_vector().v;
|
||||
for (auto i = 0, l = v.size(); i != l; ++i) {
|
||||
if (v[i].type() != mtpc_stickerPack) continue;
|
||||
|
||||
auto &pack = v[i].c_stickerPack();
|
||||
if (auto emoji = Ui::Emoji::Find(qs(pack.vemoticon))) {
|
||||
emoji = emoji->original();
|
||||
auto &stickers = pack.vdocuments.c_vector().v;
|
||||
|
||||
const auto &pack(v.at(i).c_stickerPack());
|
||||
if (EmojiPtr e = emojiGetNoColor(emojiFromText(qs(pack.vemoticon)))) {
|
||||
const auto &stickers(pack.vdocuments.c_vector().v);
|
||||
StickerPack p;
|
||||
p.reserve(stickers.size());
|
||||
for (int32 j = 0, c = stickers.size(); j < c; ++j) {
|
||||
DocumentData *doc = App::document(stickers.at(j).v);
|
||||
for (auto j = 0, c = stickers.size(); j != c; ++j) {
|
||||
auto doc = App::document(stickers[j].v);
|
||||
if (!doc || !doc->sticker()) continue;
|
||||
|
||||
p.push_back(doc);
|
||||
}
|
||||
it->emoji.insert(e, p);
|
||||
it->emoji.insert(emoji, p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ public:
|
||||
ApiWrap(QObject *parent);
|
||||
void init();
|
||||
|
||||
using RequestMessageDataCallback = base::lambda_copy<void(ChannelData*, MsgId)>;
|
||||
void requestMessageData(ChannelData *channel, MsgId msgId, const RequestMessageDataCallback &callback);
|
||||
using RequestMessageDataCallback = base::lambda<void(ChannelData*, MsgId)>;
|
||||
void requestMessageData(ChannelData *channel, MsgId msgId, RequestMessageDataCallback callback);
|
||||
|
||||
void requestFullPeer(PeerData *peer);
|
||||
void requestPeer(PeerData *peer);
|
||||
|
||||
@@ -37,14 +37,17 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
#include "history/history_media_types.h"
|
||||
#include "media/media_audio.h"
|
||||
#include "inline_bots/inline_bot_layout_item.h"
|
||||
#include "messenger.h"
|
||||
#include "application.h"
|
||||
#include "fileuploader.h"
|
||||
#include "mainwindow.h"
|
||||
#include "mainwidget.h"
|
||||
#include "localstorage.h"
|
||||
#include "apiwrap.h"
|
||||
#include "numbers.h"
|
||||
#include "observer_peer.h"
|
||||
#include "window/window_theme.h"
|
||||
#include "auth_session.h"
|
||||
#include "window/themes/window_theme.h"
|
||||
#include "window/notifications_manager.h"
|
||||
#include "platform/platform_notifications_manager.h"
|
||||
|
||||
@@ -119,9 +122,9 @@ namespace {
|
||||
CornersMap cornersMap;
|
||||
QImage *cornersMaskLarge[4] = { nullptr }, *cornersMaskSmall[4] = { nullptr };
|
||||
|
||||
using EmojiMap = QMap<uint64, QPixmap>;
|
||||
EmojiMap mainEmojiMap;
|
||||
QMap<int32, EmojiMap> otherEmojiMap;
|
||||
using EmojiImagesMap = QMap<int, QPixmap>;
|
||||
EmojiImagesMap MainEmojiMap;
|
||||
QMap<int, EmojiImagesMap> OtherEmojiMap;
|
||||
|
||||
int32 serviceImageCacheSize = 0;
|
||||
|
||||
@@ -159,24 +162,27 @@ namespace App {
|
||||
return result;
|
||||
}
|
||||
|
||||
AppClass *app() {
|
||||
return AppClass::app();
|
||||
Messenger *app() {
|
||||
return Messenger::InstancePointer();
|
||||
}
|
||||
|
||||
MainWindow *wnd() {
|
||||
return AppClass::wnd();
|
||||
if (auto instance = app()) {
|
||||
return instance->mainWindow();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MainWidget *main() {
|
||||
if (auto w = wnd()) {
|
||||
return w->mainWidget();
|
||||
if (auto window = wnd()) {
|
||||
return window->mainWidget();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool passcoded() {
|
||||
if (auto w = wnd()) {
|
||||
return w->passcodeWidget();
|
||||
if (auto window = wnd()) {
|
||||
return window->passcodeWidget();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -201,7 +207,7 @@ namespace {
|
||||
w->notifyClearFast();
|
||||
w->setupIntro();
|
||||
}
|
||||
MTP::setAuthedId(0);
|
||||
Messenger::Instance().authSessionDestroy();
|
||||
Local::reset();
|
||||
Window::Theme::Background()->reset();
|
||||
|
||||
@@ -220,11 +226,11 @@ namespace {
|
||||
} // namespace
|
||||
|
||||
void logOut() {
|
||||
if (MTP::started()) {
|
||||
MTP::logoutKeys(rpcDone(&loggedOut), rpcFail(&loggedOut));
|
||||
if (auto mtproto = Messenger::Instance().mtp()) {
|
||||
mtproto->logout(rpcDone(&loggedOut), rpcFail(&loggedOut));
|
||||
} else {
|
||||
loggedOut();
|
||||
MTP::start();
|
||||
Messenger::Instance().startMtp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,7 +476,7 @@ namespace {
|
||||
bool showPhoneChanged = !isServiceUser(data->id) && !d.is_self() && ((showPhone && data->contact) || (!showPhone && !data->contact));
|
||||
if (minimal) {
|
||||
showPhoneChanged = false;
|
||||
showPhone = !isServiceUser(data->id) && (data->id != peerFromUser(MTP::authedId())) && !data->contact;
|
||||
showPhone = !isServiceUser(data->id) && (data->id != AuthSession::CurrentUserPeerId()) && !data->contact;
|
||||
}
|
||||
|
||||
// see also Local::readPeer
|
||||
@@ -546,7 +552,7 @@ namespace {
|
||||
update.flags |= UpdateFlag::UserOnlineChanged;
|
||||
}
|
||||
|
||||
if (data->contact < 0 && !data->phone().isEmpty() && peerToUser(data->id) != MTP::authedId()) {
|
||||
if (data->contact < 0 && !data->phone().isEmpty() && data->id != AuthSession::CurrentUserPeerId()) {
|
||||
data->contact = 0;
|
||||
}
|
||||
if (App::main()) {
|
||||
@@ -841,7 +847,7 @@ namespace {
|
||||
UserData *user = App::userLoaded(uid);
|
||||
if (user) {
|
||||
chat->participants[user] = pversion;
|
||||
if (inviter == MTP::authedId()) {
|
||||
if (inviter == AuthSession::CurrentUserId()) {
|
||||
chat->invitedByMe.insert(user);
|
||||
}
|
||||
if (i->type() == mtpc_chatParticipantAdmin) {
|
||||
@@ -916,7 +922,7 @@ namespace {
|
||||
chat->botStatus = 0;
|
||||
} else if (chat->participants.find(user) == chat->participants.end()) {
|
||||
chat->participants[user] = (chat->participants.isEmpty() ? 1 : chat->participants.begin().value());
|
||||
if (d.vinviter_id.v == MTP::authedId()) {
|
||||
if (d.vinviter_id.v == AuthSession::CurrentUserId()) {
|
||||
chat->invitedByMe.insert(user);
|
||||
} else {
|
||||
chat->invitedByMe.remove(user);
|
||||
@@ -1090,7 +1096,7 @@ namespace {
|
||||
|
||||
bool checkEntitiesAndViewsUpdate(const MTPDmessage &m) {
|
||||
auto peerId = peerFromMTP(m.vto_id);
|
||||
if (m.has_from_id() && peerToUser(peerId) == MTP::authedId()) {
|
||||
if (m.has_from_id() && peerId == AuthSession::CurrentUserPeerId()) {
|
||||
peerId = peerFromUser(m.vfrom_id);
|
||||
}
|
||||
if (auto existing = App::histItemById(peerToChannel(peerId), m.vid.v)) {
|
||||
@@ -1115,7 +1121,7 @@ namespace {
|
||||
template <typename TMTPDclass>
|
||||
void updateEditedMessage(const TMTPDclass &m) {
|
||||
auto peerId = peerFromMTP(m.vto_id);
|
||||
if (m.has_from_id() && peerToUser(peerId) == MTP::authedId()) {
|
||||
if (m.has_from_id() && peerId == AuthSession::CurrentUserPeerId()) {
|
||||
peerId = peerFromUser(m.vfrom_id);
|
||||
}
|
||||
if (auto existing = App::histItemById(peerToChannel(peerId), m.vid.v)) {
|
||||
@@ -1318,7 +1324,7 @@ namespace {
|
||||
break;
|
||||
}
|
||||
if (user->contact < 1) {
|
||||
if (user->contact < 0 && !user->phone().isEmpty() && peerToUser(user->id) != MTP::authedId()) {
|
||||
if (user->contact < 0 && !user->phone().isEmpty() && user->id != AuthSession::CurrentUserPeerId()) {
|
||||
user->contact = 0;
|
||||
}
|
||||
}
|
||||
@@ -1521,10 +1527,6 @@ namespace {
|
||||
return App::gameSet(game.vid.v, convert, game.vaccess_hash.v, qs(game.vshort_name), qs(game.vtitle), qs(game.vdescription), App::feedPhoto(game.vphoto), game.has_document() ? App::feedDocument(game.vdocument) : nullptr);
|
||||
}
|
||||
|
||||
UserData *curUser() {
|
||||
return user(MTP::authedId());
|
||||
}
|
||||
|
||||
PeerData *peer(const PeerId &id, PeerData::LoadedStatus restriction) {
|
||||
if (!id) return nullptr;
|
||||
|
||||
@@ -2186,7 +2188,7 @@ namespace {
|
||||
cors[3] = rect.copy(r * 2, r * 2, r, r + (shadow ? s : 0));
|
||||
if (index != SmallMaskCorners && index != LargeMaskCorners) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
::corners[index].p[i] = new QPixmap(pixmapFromImageInPlace(std_::move(cors[i])));
|
||||
::corners[index].p[i] = new QPixmap(pixmapFromImageInPlace(std::move(cors[i])));
|
||||
::corners[index].p[i]->setDevicePixelRatio(cRetinaFactor());
|
||||
}
|
||||
}
|
||||
@@ -2278,13 +2280,13 @@ namespace {
|
||||
if (family.isEmpty()) family = QFontDatabase::systemFont(QFontDatabase::FixedFont).family();
|
||||
::monofont = style::font(st::normalFont->f.pixelSize(), 0, family);
|
||||
}
|
||||
emojiInit();
|
||||
Ui::Emoji::Init();
|
||||
if (!::emoji) {
|
||||
::emoji = new QPixmap(QLatin1String(EName));
|
||||
::emoji = new QPixmap(Ui::Emoji::Filename(Ui::Emoji::Index()));
|
||||
if (cRetina()) ::emoji->setDevicePixelRatio(cRetinaFactor());
|
||||
}
|
||||
if (!::emojiLarge) {
|
||||
::emojiLarge = new QPixmap(QLatin1String(EmojiNames[EIndex + 1]));
|
||||
::emojiLarge = new QPixmap(Ui::Emoji::Filename(Ui::Emoji::Index() + 1));
|
||||
if (cRetina()) ::emojiLarge->setDevicePixelRatio(cRetinaFactor());
|
||||
}
|
||||
|
||||
@@ -2336,8 +2338,8 @@ namespace {
|
||||
|
||||
clearCorners();
|
||||
|
||||
mainEmojiMap.clear();
|
||||
otherEmojiMap.clear();
|
||||
MainEmojiMap.clear();
|
||||
OtherEmojiMap.clear();
|
||||
|
||||
Data::clearGlobalStructures();
|
||||
|
||||
@@ -2414,20 +2416,17 @@ namespace {
|
||||
}
|
||||
|
||||
const QPixmap &emojiSingle(EmojiPtr emoji, int32 fontHeight) {
|
||||
EmojiMap *map = &(fontHeight == st::msgFont->height ? mainEmojiMap : otherEmojiMap[fontHeight]);
|
||||
EmojiMap::const_iterator i = map->constFind(emojiKey(emoji));
|
||||
if (i == map->cend()) {
|
||||
QImage img(ESize + st::emojiPadding * cIntRetinaFactor() * 2, fontHeight * cIntRetinaFactor(), QImage::Format_ARGB32_Premultiplied);
|
||||
if (cRetina()) img.setDevicePixelRatio(cRetinaFactor());
|
||||
auto &map = (fontHeight == st::msgFont->height) ? MainEmojiMap : OtherEmojiMap[fontHeight];
|
||||
auto i = map.constFind(emoji->index());
|
||||
if (i == map.cend()) {
|
||||
auto image = QImage(Ui::Emoji::Size() + st::emojiPadding * cIntRetinaFactor() * 2, fontHeight * cIntRetinaFactor(), QImage::Format_ARGB32_Premultiplied);
|
||||
if (cRetina()) image.setDevicePixelRatio(cRetinaFactor());
|
||||
image.fill(Qt::transparent);
|
||||
{
|
||||
QPainter p(&img);
|
||||
QPainter::CompositionMode m = p.compositionMode();
|
||||
p.setCompositionMode(QPainter::CompositionMode_Source);
|
||||
p.fillRect(0, 0, img.width(), img.height(), Qt::transparent);
|
||||
p.setCompositionMode(m);
|
||||
emojiDraw(p, emoji, st::emojiPadding * cIntRetinaFactor(), (fontHeight * cIntRetinaFactor() - ESize) / 2);
|
||||
QPainter p(&image);
|
||||
emojiDraw(p, emoji, st::emojiPadding * cIntRetinaFactor(), (fontHeight * cIntRetinaFactor() - Ui::Emoji::Size()) / 2);
|
||||
}
|
||||
i = map->insert(emojiKey(emoji), App::pixmapFromImageInPlace(std_::move(img)));
|
||||
i = map.insert(emoji->index(), App::pixmapFromImageInPlace(std::move(image)));
|
||||
}
|
||||
return i.value();
|
||||
}
|
||||
@@ -2466,11 +2465,11 @@ namespace {
|
||||
if (auto apiwrap = api()) {
|
||||
if (apiwrap->hasUnsavedDrafts()) {
|
||||
apiwrap->saveDraftsToCloud();
|
||||
QTimer::singleShot(SaveDraftBeforeQuitTimeout, Application::instance(), SLOT(quit()));
|
||||
QTimer::singleShot(SaveDraftBeforeQuitTimeout, QCoreApplication::instance(), SLOT(quit()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
Application::quit();
|
||||
QCoreApplication::quit();
|
||||
}
|
||||
|
||||
bool quitting() {
|
||||
@@ -2479,7 +2478,7 @@ namespace {
|
||||
|
||||
void allDraftsSaved() {
|
||||
if (quitting()) {
|
||||
Application::quit();
|
||||
QCoreApplication::quit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2553,7 +2552,7 @@ namespace {
|
||||
}
|
||||
#endif // OS_MAC_OLD
|
||||
} else if (opaque) {
|
||||
result = Images::prepareOpaque(std_::move(result));
|
||||
result = Images::prepareOpaque(std::move(result));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -2573,7 +2572,7 @@ namespace {
|
||||
}
|
||||
|
||||
QPixmap pixmapFromImageInPlace(QImage &&image) {
|
||||
return QPixmap::fromImage(std_::move(image), Qt::ColorOnly);
|
||||
return QPixmap::fromImage(std::move(image), Qt::ColorOnly);
|
||||
}
|
||||
|
||||
void regPhotoItem(PhotoData *data, HistoryItem *item) {
|
||||
@@ -2863,7 +2862,7 @@ namespace {
|
||||
|
||||
CornersPixmaps pixmaps;
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
pixmaps.p[j] = new QPixmap(pixmapFromImageInPlace(std_::move(images[j])));
|
||||
pixmaps.p[j] = new QPixmap(pixmapFromImageInPlace(std::move(images[j])));
|
||||
pixmaps.p[j]->setDevicePixelRatio(cRetinaFactor());
|
||||
}
|
||||
i = cornersMap.insert(colorKey, pixmaps);
|
||||
|
||||
@@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
#include "history/history_message.h"
|
||||
#include "layout.h"
|
||||
|
||||
class AppClass;
|
||||
class Messenger;
|
||||
class MainWindow;
|
||||
class MainWidget;
|
||||
class ApiWrap;
|
||||
@@ -44,11 +44,11 @@ using GifItems = QHash<Media::Clip::Reader*, HistoryItem*>;
|
||||
using PhotosData = QHash<PhotoId, PhotoData*>;
|
||||
using DocumentsData = QHash<DocumentId, DocumentData*>;
|
||||
|
||||
struct LocationCoords;
|
||||
class LocationCoords;
|
||||
struct LocationData;
|
||||
|
||||
namespace App {
|
||||
AppClass *app();
|
||||
Messenger *app();
|
||||
MainWindow *wnd();
|
||||
MainWidget *main();
|
||||
bool passcoded();
|
||||
|
||||
@@ -25,6 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
#include "pspecific.h"
|
||||
#include "fileuploader.h"
|
||||
#include "mainwidget.h"
|
||||
#include "mainwindow.h"
|
||||
#include "lang.h"
|
||||
#include "boxes/confirmbox.h"
|
||||
#include "ui/filedialog.h"
|
||||
@@ -34,26 +35,18 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
#include "autoupdater.h"
|
||||
#include "core/observer.h"
|
||||
#include "observer_peer.h"
|
||||
#include "window/window_theme.h"
|
||||
#include "window/themes/window_theme.h"
|
||||
#include "media/player/media_player_instance.h"
|
||||
#include "window/notifications_manager.h"
|
||||
#include "history/history_location_manager.h"
|
||||
#include "core/task_queue.h"
|
||||
#include "mtproto/dc_options.h"
|
||||
#include "core/single_timer.h"
|
||||
#include "auth_session.h"
|
||||
#include "messenger.h"
|
||||
|
||||
namespace {
|
||||
|
||||
void mtpStateChanged(int32 dc, int32 state) {
|
||||
if (App::wnd()) {
|
||||
App::wnd()->mtpStateChanged(dc, state);
|
||||
}
|
||||
}
|
||||
|
||||
void mtpSessionReset(int32 dc) {
|
||||
if (App::main() && dc == MTP::maindc()) {
|
||||
App::main()->getDifference();
|
||||
}
|
||||
}
|
||||
|
||||
QChar _toHex(ushort v) {
|
||||
v = v & 0x000F;
|
||||
return QChar::fromLatin1((v >= 10) ? ('a' + (v - 10)) : ('0' + v));
|
||||
@@ -94,8 +87,6 @@ QString _escapeFrom7bit(const QString &str) {
|
||||
|
||||
} // namespace
|
||||
|
||||
AppClass *AppObject = nullptr;
|
||||
|
||||
Application::Application(int &argc, char **argv) : QApplication(argc, argv) {
|
||||
QByteArray d(QFile::encodeName(QDir(cWorkingDir()).absolutePath()));
|
||||
char h[33] = { 0 };
|
||||
@@ -118,7 +109,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) {
|
||||
connect(this, SIGNAL(aboutToQuit()), this, SLOT(closeApplication()));
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||
connect(&_updateCheckTimer, SIGNAL(timeout()), this, SLOT(updateCheck()));
|
||||
_updateCheckTimer.create(this);
|
||||
connect(_updateCheckTimer, SIGNAL(timeout()), this, SLOT(updateCheck()));
|
||||
connect(this, SIGNAL(updateFailed()), this, SLOT(onUpdateFailed()));
|
||||
connect(this, SIGNAL(updateReady()), this, SLOT(onUpdateReady()));
|
||||
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
|
||||
@@ -132,6 +124,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) {
|
||||
}
|
||||
}
|
||||
|
||||
Application::~Application() = default;
|
||||
|
||||
bool Application::event(QEvent *e) {
|
||||
if (e->type() == QEvent::Close) {
|
||||
App::quit();
|
||||
@@ -332,6 +326,11 @@ void Application::startApplication() {
|
||||
}
|
||||
}
|
||||
|
||||
void Application::createMessenger() {
|
||||
t_assert(!App::quitting());
|
||||
_messengerInstance = std::make_unique<Messenger>();
|
||||
}
|
||||
|
||||
void Application::closeApplication() {
|
||||
if (App::launchState() == App::QuitProcessed) return;
|
||||
App::setLaunchState(App::QuitProcessed);
|
||||
@@ -340,7 +339,10 @@ void Application::closeApplication() {
|
||||
manager->clearAllFast();
|
||||
}
|
||||
|
||||
delete base::take(AppObject);
|
||||
if (_messengerInstance) {
|
||||
Messenger::Instance().prepareToDestroy();
|
||||
_messengerInstance.reset();
|
||||
}
|
||||
|
||||
Sandbox::finish();
|
||||
|
||||
@@ -424,9 +426,9 @@ void Application::updateFailedCurrent(QNetworkReply::NetworkError e) {
|
||||
void Application::onUpdateReady() {
|
||||
if (_updateChecker) {
|
||||
_updateChecker->deleteLater();
|
||||
_updateChecker = 0;
|
||||
_updateChecker = nullptr;
|
||||
}
|
||||
_updateCheckTimer.stop();
|
||||
_updateCheckTimer->stop();
|
||||
|
||||
cSetLastUpdateCheck(unixtime());
|
||||
Local::writeSettings();
|
||||
@@ -477,7 +479,7 @@ void Application::stopUpdate() {
|
||||
void Application::startUpdateCheck(bool forceWait) {
|
||||
if (!Sandbox::started()) return;
|
||||
|
||||
_updateCheckTimer.stop();
|
||||
_updateCheckTimer->stop();
|
||||
if (_updateThread || _updateReply || !cAutoUpdate()) return;
|
||||
|
||||
int32 constDelay = cBetaVersion() ? 600 : UpdateDelayConstPart, randDelay = cBetaVersion() ? 300 : UpdateDelayRandPart;
|
||||
@@ -515,7 +517,7 @@ void Application::startUpdateCheck(bool forceWait) {
|
||||
connect(_updateReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(updateFailedCurrent(QNetworkReply::NetworkError)));
|
||||
emit updateChecking();
|
||||
} else {
|
||||
_updateCheckTimer.start((updateInSecs + 5) * 1000);
|
||||
_updateCheckTimer->start((updateInSecs + 5) * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,601 +529,154 @@ inline Application *application() {
|
||||
|
||||
namespace Sandbox {
|
||||
|
||||
QRect availableGeometry() {
|
||||
if (Application *a = application()) {
|
||||
return a->desktop()->availableGeometry();
|
||||
}
|
||||
return QDesktopWidget().availableGeometry();
|
||||
QRect availableGeometry() {
|
||||
if (auto a = application()) {
|
||||
return a->desktop()->availableGeometry();
|
||||
}
|
||||
|
||||
QRect screenGeometry(const QPoint &p) {
|
||||
if (Application *a = application()) {
|
||||
return a->desktop()->screenGeometry(p);
|
||||
}
|
||||
return QDesktopWidget().screenGeometry(p);
|
||||
}
|
||||
|
||||
void setActiveWindow(QWidget *window) {
|
||||
if (Application *a = application()) {
|
||||
a->setActiveWindow(window);
|
||||
}
|
||||
}
|
||||
|
||||
bool isSavingSession() {
|
||||
if (Application *a = application()) {
|
||||
return a->isSavingSession();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void installEventFilter(QObject *filter) {
|
||||
if (Application *a = application()) {
|
||||
a->installEventFilter(filter);
|
||||
}
|
||||
}
|
||||
|
||||
void removeEventFilter(QObject *filter) {
|
||||
if (Application *a = application()) {
|
||||
a->removeEventFilter(filter);
|
||||
}
|
||||
}
|
||||
|
||||
void execExternal(const QString &cmd) {
|
||||
DEBUG_LOG(("Application Info: executing external command '%1'").arg(cmd));
|
||||
if (cmd == "show") {
|
||||
if (App::wnd()) {
|
||||
App::wnd()->activate();
|
||||
} else if (PreLaunchWindow::instance()) {
|
||||
PreLaunchWindow::instance()->activate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||
|
||||
void startUpdateCheck() {
|
||||
if (Application *a = application()) {
|
||||
return a->startUpdateCheck(false);
|
||||
}
|
||||
}
|
||||
|
||||
void stopUpdate() {
|
||||
if (Application *a = application()) {
|
||||
return a->stopUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
Application::UpdatingState updatingState() {
|
||||
if (Application *a = application()) {
|
||||
return a->updatingState();
|
||||
}
|
||||
return Application::UpdatingNone;
|
||||
}
|
||||
|
||||
int32 updatingSize() {
|
||||
if (Application *a = application()) {
|
||||
return a->updatingSize();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32 updatingReady() {
|
||||
if (Application *a = application()) {
|
||||
return a->updatingReady();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void updateChecking() {
|
||||
if (Application *a = application()) {
|
||||
emit a->updateChecking();
|
||||
}
|
||||
}
|
||||
|
||||
void updateLatest() {
|
||||
if (Application *a = application()) {
|
||||
emit a->updateLatest();
|
||||
}
|
||||
}
|
||||
|
||||
void updateProgress(qint64 ready, qint64 total) {
|
||||
if (Application *a = application()) {
|
||||
emit a->updateProgress(ready, total);
|
||||
}
|
||||
}
|
||||
|
||||
void updateFailed() {
|
||||
if (Application *a = application()) {
|
||||
emit a->updateFailed();
|
||||
}
|
||||
}
|
||||
|
||||
void updateReady() {
|
||||
if (Application *a = application()) {
|
||||
emit a->updateReady();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
|
||||
|
||||
void connect(const char *signal, QObject *object, const char *method) {
|
||||
if (Application *a = application()) {
|
||||
a->connect(a, signal, object, method);
|
||||
}
|
||||
}
|
||||
|
||||
void launch() {
|
||||
t_assert(application() != 0);
|
||||
|
||||
float64 dpi = Application::primaryScreen()->logicalDotsPerInch();
|
||||
if (dpi <= 108) { // 0-96-108
|
||||
cSetScreenScale(dbisOne);
|
||||
} else if (dpi <= 132) { // 108-120-132
|
||||
cSetScreenScale(dbisOneAndQuarter);
|
||||
} else if (dpi <= 168) { // 132-144-168
|
||||
cSetScreenScale(dbisOneAndHalf);
|
||||
} else { // 168-192-inf
|
||||
cSetScreenScale(dbisTwo);
|
||||
}
|
||||
|
||||
auto devicePixelRatio = application()->devicePixelRatio();
|
||||
if (devicePixelRatio > 1.) {
|
||||
if ((cPlatform() != dbipMac && cPlatform() != dbipMacOld) || (devicePixelRatio != 2.)) {
|
||||
LOG(("Found non-trivial Device Pixel Ratio: %1").arg(devicePixelRatio));
|
||||
LOG(("Environmental variables: QT_DEVICE_PIXEL_RATIO='%1'").arg(QString::fromLatin1(qgetenv("QT_DEVICE_PIXEL_RATIO"))));
|
||||
LOG(("Environmental variables: QT_SCALE_FACTOR='%1'").arg(QString::fromLatin1(qgetenv("QT_SCALE_FACTOR"))));
|
||||
LOG(("Environmental variables: QT_AUTO_SCREEN_SCALE_FACTOR='%1'").arg(QString::fromLatin1(qgetenv("QT_AUTO_SCREEN_SCALE_FACTOR"))));
|
||||
LOG(("Environmental variables: QT_SCREEN_SCALE_FACTORS='%1'").arg(QString::fromLatin1(qgetenv("QT_SCREEN_SCALE_FACTORS"))));
|
||||
}
|
||||
cSetRetina(true);
|
||||
cSetRetinaFactor(devicePixelRatio);
|
||||
cSetIntRetinaFactor(int32(cRetinaFactor()));
|
||||
cSetConfigScale(dbisOne);
|
||||
cSetRealScale(dbisOne);
|
||||
}
|
||||
|
||||
new AppClass();
|
||||
}
|
||||
|
||||
return QDesktopWidget().availableGeometry();
|
||||
}
|
||||
|
||||
AppClass::AppClass() : QObject() {
|
||||
AppObject = this;
|
||||
|
||||
Fonts::start();
|
||||
|
||||
ThirdParty::start();
|
||||
Global::start();
|
||||
Local::start();
|
||||
if (Local::oldSettingsVersion() < AppVersion) {
|
||||
psNewVersion();
|
||||
QRect screenGeometry(const QPoint &p) {
|
||||
if (auto a = application()) {
|
||||
return a->desktop()->screenGeometry(p);
|
||||
}
|
||||
return QDesktopWidget().screenGeometry(p);
|
||||
}
|
||||
|
||||
if (cLaunchMode() == LaunchModeAutoStart && !cAutoStart()) {
|
||||
psAutoStart(false, true);
|
||||
application()->quit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (cRetina()) {
|
||||
cSetConfigScale(dbisOne);
|
||||
cSetRealScale(dbisOne);
|
||||
}
|
||||
loadLanguage();
|
||||
style::startManager();
|
||||
anim::startManager();
|
||||
historyInit();
|
||||
Media::Player::start();
|
||||
Window::Notifications::start();
|
||||
|
||||
DEBUG_LOG(("Application Info: inited..."));
|
||||
|
||||
application()->installNativeEventFilter(psNativeEventFilter());
|
||||
|
||||
cChangeTimeFormat(QLocale::system().timeFormat(QLocale::ShortFormat));
|
||||
|
||||
connect(&killDownloadSessionsTimer, SIGNAL(timeout()), this, SLOT(killDownloadSessions()));
|
||||
|
||||
DEBUG_LOG(("Application Info: starting app..."));
|
||||
|
||||
// Create mime database, so it won't be slow later.
|
||||
QMimeDatabase().mimeTypeForName(qsl("text/plain"));
|
||||
|
||||
_window = new MainWindow();
|
||||
_window->createWinId();
|
||||
_window->init();
|
||||
|
||||
Sandbox::connect(SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState)));
|
||||
|
||||
DEBUG_LOG(("Application Info: window created..."));
|
||||
|
||||
Shortcuts::start();
|
||||
|
||||
initLocationManager();
|
||||
App::initMedia();
|
||||
|
||||
Local::ReadMapState state = Local::readMap(QByteArray());
|
||||
if (state == Local::ReadMapPassNeeded) {
|
||||
Global::SetLocalPasscode(true);
|
||||
Global::RefLocalPasscodeChanged().notify();
|
||||
DEBUG_LOG(("Application Info: passcode needed..."));
|
||||
} else {
|
||||
DEBUG_LOG(("Application Info: local map read..."));
|
||||
MTP::start();
|
||||
}
|
||||
|
||||
MTP::setStateChangedHandler(mtpStateChanged);
|
||||
MTP::setSessionResetHandler(mtpSessionReset);
|
||||
|
||||
DEBUG_LOG(("Application Info: MTP started..."));
|
||||
|
||||
DEBUG_LOG(("Application Info: showing."));
|
||||
if (state == Local::ReadMapPassNeeded) {
|
||||
_window->setupPasscode();
|
||||
} else {
|
||||
if (MTP::authedId()) {
|
||||
_window->setupMain();
|
||||
} else {
|
||||
_window->setupIntro();
|
||||
}
|
||||
}
|
||||
_window->firstShow();
|
||||
|
||||
if (cStartToSettings()) {
|
||||
_window->showSettings();
|
||||
}
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||
#endif // !TDESKTOP_DISABLE_NETWORK_PROXY
|
||||
|
||||
if (state != Local::ReadMapPassNeeded) {
|
||||
checkMapVersion();
|
||||
}
|
||||
|
||||
_window->updateIsActive(Global::OnlineFocusTimeout());
|
||||
|
||||
if (!Shortcuts::errors().isEmpty()) {
|
||||
const QStringList &errors(Shortcuts::errors());
|
||||
for (QStringList::const_iterator i = errors.cbegin(), e = errors.cend(); i != e; ++i) {
|
||||
LOG(("Shortcuts Error: %1").arg(*i));
|
||||
}
|
||||
void setActiveWindow(QWidget *window) {
|
||||
if (auto a = application()) {
|
||||
a->setActiveWindow(window);
|
||||
}
|
||||
}
|
||||
|
||||
void AppClass::loadLanguage() {
|
||||
if (cLang() < languageTest) {
|
||||
cSetLang(Sandbox::LangSystem());
|
||||
}
|
||||
if (cLang() == languageTest) {
|
||||
if (QFileInfo(cLangFile()).exists()) {
|
||||
LangLoaderPlain loader(cLangFile());
|
||||
cSetLangErrors(loader.errors());
|
||||
if (!cLangErrors().isEmpty()) {
|
||||
LOG(("Lang load errors: %1").arg(cLangErrors()));
|
||||
} else if (!loader.warnings().isEmpty()) {
|
||||
LOG(("Lang load warnings: %1").arg(loader.warnings()));
|
||||
}
|
||||
} else {
|
||||
cSetLang(languageDefault);
|
||||
}
|
||||
} else if (cLang() > languageDefault && cLang() < languageCount) {
|
||||
LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[cLang()].c_str() + qsl(".strings"));
|
||||
if (!loader.errors().isEmpty()) {
|
||||
LOG(("Lang load errors: %1").arg(loader.errors()));
|
||||
} else if (!loader.warnings().isEmpty()) {
|
||||
LOG(("Lang load warnings: %1").arg(loader.warnings()));
|
||||
}
|
||||
}
|
||||
application()->installTranslator(_translator = new Translator());
|
||||
}
|
||||
|
||||
void AppClass::regPhotoUpdate(const PeerId &peer, const FullMsgId &msgId) {
|
||||
photoUpdates.insert(msgId, peer);
|
||||
}
|
||||
|
||||
bool AppClass::isPhotoUpdating(const PeerId &peer) {
|
||||
for (QMap<FullMsgId, PeerId>::iterator i = photoUpdates.begin(), e = photoUpdates.end(); i != e; ++i) {
|
||||
if (i.value() == peer) {
|
||||
return true;
|
||||
}
|
||||
bool isSavingSession() {
|
||||
if (auto a = application()) {
|
||||
return a->isSavingSession();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void AppClass::cancelPhotoUpdate(const PeerId &peer) {
|
||||
for (QMap<FullMsgId, PeerId>::iterator i = photoUpdates.begin(), e = photoUpdates.end(); i != e;) {
|
||||
if (i.value() == peer) {
|
||||
i = photoUpdates.erase(i);
|
||||
} else {
|
||||
++i;
|
||||
void execExternal(const QString &cmd) {
|
||||
DEBUG_LOG(("Application Info: executing external command '%1'").arg(cmd));
|
||||
if (cmd == "show") {
|
||||
if (App::wnd()) {
|
||||
App::wnd()->activate();
|
||||
} else if (PreLaunchWindow::instance()) {
|
||||
PreLaunchWindow::instance()->activate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AppClass::selfPhotoCleared(const MTPUserProfilePhoto &result) {
|
||||
if (!App::self()) return;
|
||||
App::self()->setPhoto(result);
|
||||
emit peerPhotoDone(App::self()->id);
|
||||
}
|
||||
|
||||
void AppClass::chatPhotoCleared(PeerId peer, const MTPUpdates &updates) {
|
||||
if (App::main()) {
|
||||
App::main()->sentUpdatesReceived(updates);
|
||||
void adjustSingleTimers() {
|
||||
if (auto a = application()) {
|
||||
a->adjustSingleTimers();
|
||||
}
|
||||
cancelPhotoUpdate(peer);
|
||||
emit peerPhotoDone(peer);
|
||||
}
|
||||
|
||||
void AppClass::selfPhotoDone(const MTPphotos_Photo &result) {
|
||||
if (!App::self()) return;
|
||||
const auto &photo(result.c_photos_photo());
|
||||
App::feedPhoto(photo.vphoto);
|
||||
App::feedUsers(photo.vusers);
|
||||
cancelPhotoUpdate(App::self()->id);
|
||||
emit peerPhotoDone(App::self()->id);
|
||||
}
|
||||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||
|
||||
void AppClass::chatPhotoDone(PeerId peer, const MTPUpdates &updates) {
|
||||
if (App::main()) {
|
||||
App::main()->sentUpdatesReceived(updates);
|
||||
void startUpdateCheck() {
|
||||
if (auto a = application()) {
|
||||
return a->startUpdateCheck(false);
|
||||
}
|
||||
cancelPhotoUpdate(peer);
|
||||
emit peerPhotoDone(peer);
|
||||
}
|
||||
|
||||
bool AppClass::peerPhotoFail(PeerId peer, const RPCError &error) {
|
||||
if (MTP::isDefaultHandledError(error)) return false;
|
||||
|
||||
LOG(("Application Error: update photo failed %1: %2").arg(error.type()).arg(error.description()));
|
||||
cancelPhotoUpdate(peer);
|
||||
emit peerPhotoFail(peer);
|
||||
return true;
|
||||
void stopUpdate() {
|
||||
if (auto a = application()) {
|
||||
return a->stopUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
void AppClass::peerClearPhoto(PeerId id) {
|
||||
if (MTP::authedId() && peerToUser(id) == MTP::authedId()) {
|
||||
MTP::send(MTPphotos_UpdateProfilePhoto(MTP_inputPhotoEmpty()), rpcDone(&AppClass::selfPhotoCleared), rpcFail(&AppClass::peerPhotoFail, id));
|
||||
} else if (peerIsChat(id)) {
|
||||
MTP::send(MTPmessages_EditChatPhoto(peerToBareMTPInt(id), MTP_inputChatPhotoEmpty()), rpcDone(&AppClass::chatPhotoCleared, id), rpcFail(&AppClass::peerPhotoFail, id));
|
||||
} else if (peerIsChannel(id)) {
|
||||
if (ChannelData *channel = App::channelLoaded(id)) {
|
||||
MTP::send(MTPchannels_EditPhoto(channel->inputChannel, MTP_inputChatPhotoEmpty()), rpcDone(&AppClass::chatPhotoCleared, id), rpcFail(&AppClass::peerPhotoFail, id));
|
||||
Application::UpdatingState updatingState() {
|
||||
if (auto a = application()) {
|
||||
return a->updatingState();
|
||||
}
|
||||
return Application::UpdatingNone;
|
||||
}
|
||||
|
||||
int32 updatingSize() {
|
||||
if (auto a = application()) {
|
||||
return a->updatingSize();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32 updatingReady() {
|
||||
if (auto a = application()) {
|
||||
return a->updatingReady();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void updateChecking() {
|
||||
if (auto a = application()) {
|
||||
emit a->updateChecking();
|
||||
}
|
||||
}
|
||||
|
||||
void updateLatest() {
|
||||
if (auto a = application()) {
|
||||
emit a->updateLatest();
|
||||
}
|
||||
}
|
||||
|
||||
void updateProgress(qint64 ready, qint64 total) {
|
||||
if (auto a = application()) {
|
||||
emit a->updateProgress(ready, total);
|
||||
}
|
||||
}
|
||||
|
||||
void updateFailed() {
|
||||
if (auto a = application()) {
|
||||
emit a->updateFailed();
|
||||
}
|
||||
}
|
||||
|
||||
void updateReady() {
|
||||
if (auto a = application()) {
|
||||
emit a->updateReady();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
|
||||
|
||||
void connect(const char *signal, QObject *object, const char *method) {
|
||||
if (auto a = application()) {
|
||||
a->connect(a, signal, object, method);
|
||||
}
|
||||
}
|
||||
|
||||
void launch() {
|
||||
t_assert(application() != 0);
|
||||
|
||||
float64 dpi = Application::primaryScreen()->logicalDotsPerInch();
|
||||
if (dpi <= 108) { // 0-96-108
|
||||
cSetScreenScale(dbisOne);
|
||||
} else if (dpi <= 132) { // 108-120-132
|
||||
cSetScreenScale(dbisOneAndQuarter);
|
||||
} else if (dpi <= 168) { // 132-144-168
|
||||
cSetScreenScale(dbisOneAndHalf);
|
||||
} else { // 168-192-inf
|
||||
cSetScreenScale(dbisTwo);
|
||||
}
|
||||
|
||||
auto devicePixelRatio = application()->devicePixelRatio();
|
||||
if (devicePixelRatio > 1.) {
|
||||
if ((cPlatform() != dbipMac && cPlatform() != dbipMacOld) || (devicePixelRatio != 2.)) {
|
||||
LOG(("Found non-trivial Device Pixel Ratio: %1").arg(devicePixelRatio));
|
||||
LOG(("Environmental variables: QT_DEVICE_PIXEL_RATIO='%1'").arg(QString::fromLatin1(qgetenv("QT_DEVICE_PIXEL_RATIO"))));
|
||||
LOG(("Environmental variables: QT_SCALE_FACTOR='%1'").arg(QString::fromLatin1(qgetenv("QT_SCALE_FACTOR"))));
|
||||
LOG(("Environmental variables: QT_AUTO_SCREEN_SCALE_FACTOR='%1'").arg(QString::fromLatin1(qgetenv("QT_AUTO_SCREEN_SCALE_FACTOR"))));
|
||||
LOG(("Environmental variables: QT_SCREEN_SCALE_FACTORS='%1'").arg(QString::fromLatin1(qgetenv("QT_SCREEN_SCALE_FACTORS"))));
|
||||
}
|
||||
cSetRetina(true);
|
||||
cSetRetinaFactor(devicePixelRatio);
|
||||
cSetIntRetinaFactor(int32(cRetinaFactor()));
|
||||
cSetConfigScale(dbisOne);
|
||||
cSetRealScale(dbisOne);
|
||||
}
|
||||
|
||||
application()->createMessenger();
|
||||
}
|
||||
|
||||
void AppClass::killDownloadSessionsStart(int32 dc) {
|
||||
if (killDownloadSessionTimes.constFind(dc) == killDownloadSessionTimes.cend()) {
|
||||
killDownloadSessionTimes.insert(dc, getms() + MTPAckSendWaiting + MTPKillFileSessionTimeout);
|
||||
}
|
||||
if (!killDownloadSessionsTimer.isActive()) {
|
||||
killDownloadSessionsTimer.start(MTPAckSendWaiting + MTPKillFileSessionTimeout + 5);
|
||||
}
|
||||
}
|
||||
|
||||
void AppClass::killDownloadSessionsStop(int32 dc) {
|
||||
killDownloadSessionTimes.remove(dc);
|
||||
if (killDownloadSessionTimes.isEmpty() && killDownloadSessionsTimer.isActive()) {
|
||||
killDownloadSessionsTimer.stop();
|
||||
}
|
||||
}
|
||||
|
||||
void AppClass::checkLocalTime() {
|
||||
if (App::main()) App::main()->checkLastUpdate(checkms());
|
||||
}
|
||||
|
||||
void AppClass::onAppStateChanged(Qt::ApplicationState state) {
|
||||
checkLocalTime();
|
||||
if (_window) {
|
||||
_window->updateIsActive((state == Qt::ApplicationActive) ? Global::OnlineFocusTimeout() : Global::OfflineBlurTimeout());
|
||||
}
|
||||
if (state != Qt::ApplicationActive) {
|
||||
Ui::Tooltip::Hide();
|
||||
}
|
||||
}
|
||||
|
||||
void AppClass::call_handleHistoryUpdate() {
|
||||
Notify::handlePendingHistoryUpdate();
|
||||
}
|
||||
|
||||
void AppClass::call_handleUnreadCounterUpdate() {
|
||||
Global::RefUnreadCounterUpdate().notify(true);
|
||||
}
|
||||
|
||||
void AppClass::call_handleFileDialogQueue() {
|
||||
while (true) {
|
||||
if (!FileDialog::processQuery()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AppClass::call_handleDelayedPeerUpdates() {
|
||||
Notify::peerUpdatedSendDelayed();
|
||||
}
|
||||
|
||||
void AppClass::call_handleObservables() {
|
||||
base::HandleObservables();
|
||||
}
|
||||
|
||||
void AppClass::killDownloadSessions() {
|
||||
auto ms = getms(), left = static_cast<TimeMs>(MTPAckSendWaiting) + MTPKillFileSessionTimeout;
|
||||
for (auto i = killDownloadSessionTimes.begin(); i != killDownloadSessionTimes.end(); ) {
|
||||
if (i.value() <= ms) {
|
||||
for (int j = 0; j < MTPDownloadSessionsCount; ++j) {
|
||||
MTP::stopSession(MTP::dldDcId(i.key(), j));
|
||||
}
|
||||
i = killDownloadSessionTimes.erase(i);
|
||||
} else {
|
||||
if (i.value() - ms < left) {
|
||||
left = i.value() - ms;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
if (!killDownloadSessionTimes.isEmpty()) {
|
||||
killDownloadSessionsTimer.start(left);
|
||||
}
|
||||
}
|
||||
|
||||
void AppClass::photoUpdated(const FullMsgId &msgId, bool silent, const MTPInputFile &file) {
|
||||
if (!App::self()) return;
|
||||
|
||||
auto i = photoUpdates.find(msgId);
|
||||
if (i != photoUpdates.end()) {
|
||||
auto id = i.value();
|
||||
if (MTP::authedId() && peerToUser(id) == MTP::authedId()) {
|
||||
MTP::send(MTPphotos_UploadProfilePhoto(file), rpcDone(&AppClass::selfPhotoDone), rpcFail(&AppClass::peerPhotoFail, id));
|
||||
} else if (peerIsChat(id)) {
|
||||
auto history = App::history(id);
|
||||
history->sendRequestId = MTP::send(MTPmessages_EditChatPhoto(history->peer->asChat()->inputChat, MTP_inputChatUploadedPhoto(file)), rpcDone(&AppClass::chatPhotoDone, id), rpcFail(&AppClass::peerPhotoFail, id), 0, 0, history->sendRequestId);
|
||||
} else if (peerIsChannel(id)) {
|
||||
auto history = App::history(id);
|
||||
history->sendRequestId = MTP::send(MTPchannels_EditPhoto(history->peer->asChannel()->inputChannel, MTP_inputChatUploadedPhoto(file)), rpcDone(&AppClass::chatPhotoDone, id), rpcFail(&AppClass::peerPhotoFail, id), 0, 0, history->sendRequestId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AppClass::onSwitchDebugMode() {
|
||||
if (cDebug()) {
|
||||
QFile(cWorkingDir() + qsl("tdata/withdebug")).remove();
|
||||
cSetDebug(false);
|
||||
App::restart();
|
||||
} else {
|
||||
cSetDebug(true);
|
||||
DEBUG_LOG(("Debug logs started."));
|
||||
QFile f(cWorkingDir() + qsl("tdata/withdebug"));
|
||||
if (f.open(QIODevice::WriteOnly)) {
|
||||
f.write("1");
|
||||
f.close();
|
||||
}
|
||||
Ui::hideLayer();
|
||||
}
|
||||
}
|
||||
|
||||
void AppClass::onSwitchWorkMode() {
|
||||
Global::SetDialogsModeEnabled(!Global::DialogsModeEnabled());
|
||||
Global::SetDialogsMode(Dialogs::Mode::All);
|
||||
Local::writeUserSettings();
|
||||
App::restart();
|
||||
}
|
||||
|
||||
void AppClass::onSwitchTestMode() {
|
||||
if (cTestMode()) {
|
||||
QFile(cWorkingDir() + qsl("tdata/withtestmode")).remove();
|
||||
cSetTestMode(false);
|
||||
} else {
|
||||
QFile f(cWorkingDir() + qsl("tdata/withtestmode"));
|
||||
if (f.open(QIODevice::WriteOnly)) {
|
||||
f.write("1");
|
||||
f.close();
|
||||
}
|
||||
cSetTestMode(true);
|
||||
}
|
||||
App::restart();
|
||||
}
|
||||
|
||||
FileUploader *AppClass::uploader() {
|
||||
if (!_uploader && !App::quitting()) _uploader = new FileUploader();
|
||||
return _uploader;
|
||||
}
|
||||
|
||||
void AppClass::uploadProfilePhoto(const QImage &tosend, const PeerId &peerId) {
|
||||
PreparedPhotoThumbs photoThumbs;
|
||||
QVector<MTPPhotoSize> photoSizes;
|
||||
|
||||
auto thumb = App::pixmapFromImageInPlace(tosend.scaled(160, 160, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
photoThumbs.insert('a', thumb);
|
||||
photoSizes.push_back(MTP_photoSize(MTP_string("a"), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(thumb.width()), MTP_int(thumb.height()), MTP_int(0)));
|
||||
|
||||
auto medium = App::pixmapFromImageInPlace(tosend.scaled(320, 320, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
photoThumbs.insert('b', medium);
|
||||
photoSizes.push_back(MTP_photoSize(MTP_string("b"), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(medium.width()), MTP_int(medium.height()), MTP_int(0)));
|
||||
|
||||
auto full = QPixmap::fromImage(tosend, Qt::ColorOnly);
|
||||
photoThumbs.insert('c', full);
|
||||
photoSizes.push_back(MTP_photoSize(MTP_string("c"), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(full.width()), MTP_int(full.height()), MTP_int(0)));
|
||||
|
||||
QByteArray jpeg;
|
||||
QBuffer jpegBuffer(&jpeg);
|
||||
full.save(&jpegBuffer, "JPG", 87);
|
||||
|
||||
PhotoId id = rand_value<PhotoId>();
|
||||
|
||||
MTPDphoto::Flags photoFlags = 0;
|
||||
auto photo = MTP_photo(MTP_flags(photoFlags), MTP_long(id), MTP_long(0), MTP_int(unixtime()), MTP_vector<MTPPhotoSize>(photoSizes));
|
||||
|
||||
QString file, filename;
|
||||
int32 filesize = 0;
|
||||
QByteArray data;
|
||||
|
||||
SendMediaReady ready(SendMediaType::Photo, file, filename, filesize, data, id, id, qsl("jpg"), peerId, photo, photoThumbs, MTP_documentEmpty(MTP_long(0)), jpeg, 0);
|
||||
|
||||
connect(App::uploader(), SIGNAL(photoReady(const FullMsgId&,bool,const MTPInputFile&)), App::app(), SLOT(photoUpdated(const FullMsgId&,bool,const MTPInputFile&)), Qt::UniqueConnection);
|
||||
|
||||
FullMsgId newId(peerToChannel(peerId), clientMsgId());
|
||||
App::app()->regPhotoUpdate(peerId, newId);
|
||||
App::uploader()->uploadMedia(newId, ready);
|
||||
}
|
||||
|
||||
void AppClass::checkMapVersion() {
|
||||
if (Local::oldMapVersion() < AppVersion) {
|
||||
if (Local::oldMapVersion()) {
|
||||
QString versionFeatures;
|
||||
if ((cAlphaVersion() || cBetaVersion()) && Local::oldMapVersion() < 1000004) {
|
||||
versionFeatures = QString::fromUtf8("\xe2\x80\x94 Click and drag to reorder pinned chats.");
|
||||
} else if (!(cAlphaVersion() || cBetaVersion()) && Local::oldMapVersion() < 1000005) {
|
||||
versionFeatures = langNewVersionText();
|
||||
} else {
|
||||
versionFeatures = lang(lng_new_version_minor).trimmed();
|
||||
}
|
||||
if (!versionFeatures.isEmpty()) {
|
||||
versionFeatures = lng_new_version_wrap(lt_version, QString::fromLatin1(AppVersionStr.c_str()), lt_changes, versionFeatures, lt_link, qsl("https://desktop.telegram.org/changelog"));
|
||||
_window->serviceNotificationLocal(versionFeatures);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AppClass::~AppClass() {
|
||||
Shortcuts::finish();
|
||||
|
||||
delete base::take(_window);
|
||||
App::clearHistories();
|
||||
|
||||
Window::Notifications::finish();
|
||||
|
||||
anim::stopManager();
|
||||
|
||||
stopWebLoadManager();
|
||||
App::deinitMedia();
|
||||
deinitLocationManager();
|
||||
|
||||
MTP::finish();
|
||||
|
||||
AppObject = nullptr;
|
||||
delete base::take(_uploader);
|
||||
delete base::take(_translator);
|
||||
|
||||
Window::Theme::Unload();
|
||||
|
||||
Media::Player::finish();
|
||||
style::stopManager();
|
||||
|
||||
Local::finish();
|
||||
Global::finish();
|
||||
ThirdParty::finish();
|
||||
}
|
||||
|
||||
AppClass *AppClass::app() {
|
||||
return AppObject;
|
||||
}
|
||||
|
||||
MainWindow *AppClass::wnd() {
|
||||
return AppObject ? AppObject->_window : nullptr;
|
||||
}
|
||||
|
||||
MainWidget *AppClass::main() {
|
||||
return (AppObject && AppObject->_window) ? AppObject->_window->mainWidget() : nullptr;
|
||||
}
|
||||
} // namespace Sandbox
|
||||
|
||||
@@ -20,10 +20,6 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "pspecific.h"
|
||||
#include "core/single_timer.h"
|
||||
|
||||
class UpdateChecker;
|
||||
class Application : public QApplication {
|
||||
Q_OBJECT
|
||||
@@ -33,6 +29,13 @@ public:
|
||||
|
||||
bool event(QEvent *e) override;
|
||||
|
||||
void createMessenger();
|
||||
|
||||
~Application();
|
||||
|
||||
signals:
|
||||
void adjustSingleTimers();
|
||||
|
||||
// Single instance application
|
||||
public slots:
|
||||
void socketConnected();
|
||||
@@ -54,6 +57,8 @@ private:
|
||||
typedef QPair<QLocalSocket*, QByteArray> LocalClient;
|
||||
typedef QList<LocalClient> LocalClients;
|
||||
|
||||
std::unique_ptr<Messenger> _messengerInstance;
|
||||
|
||||
QString _localServerName, _localSocketReadData;
|
||||
QLocalServer _localServer;
|
||||
QLocalSocket _localSocket;
|
||||
@@ -95,7 +100,7 @@ public slots:
|
||||
void onUpdateFailed();
|
||||
|
||||
private:
|
||||
SingleTimer _updateCheckTimer;
|
||||
object_ptr<SingleTimer> _updateCheckTimer = { nullptr };
|
||||
QNetworkReply *_updateReply = nullptr;
|
||||
QNetworkAccessManager _updateManager;
|
||||
QThread *_updateThread = nullptr;
|
||||
@@ -106,111 +111,34 @@ private:
|
||||
|
||||
namespace Sandbox {
|
||||
|
||||
QRect availableGeometry();
|
||||
QRect screenGeometry(const QPoint &p);
|
||||
void setActiveWindow(QWidget *window);
|
||||
bool isSavingSession();
|
||||
QRect availableGeometry();
|
||||
QRect screenGeometry(const QPoint &p);
|
||||
void setActiveWindow(QWidget *window);
|
||||
bool isSavingSession();
|
||||
|
||||
void installEventFilter(QObject *filter);
|
||||
void removeEventFilter(QObject *filter);
|
||||
void execExternal(const QString &cmd);
|
||||
|
||||
void execExternal(const QString &cmd);
|
||||
void adjustSingleTimers();
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||
|
||||
void startUpdateCheck();
|
||||
void stopUpdate();
|
||||
void startUpdateCheck();
|
||||
void stopUpdate();
|
||||
|
||||
Application::UpdatingState updatingState();
|
||||
int32 updatingSize();
|
||||
int32 updatingReady();
|
||||
Application::UpdatingState updatingState();
|
||||
int32 updatingSize();
|
||||
int32 updatingReady();
|
||||
|
||||
void updateChecking();
|
||||
void updateLatest();
|
||||
void updateProgress(qint64 ready, qint64 total);
|
||||
void updateFailed();
|
||||
void updateReady();
|
||||
void updateChecking();
|
||||
void updateLatest();
|
||||
void updateProgress(qint64 ready, qint64 total);
|
||||
void updateFailed();
|
||||
void updateReady();
|
||||
|
||||
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
|
||||
|
||||
void connect(const char *signal, QObject *object, const char *method);
|
||||
void connect(const char *signal, QObject *object, const char *method);
|
||||
|
||||
void launch();
|
||||
void launch();
|
||||
|
||||
}
|
||||
|
||||
class MainWidget;
|
||||
class FileUploader;
|
||||
class Translator;
|
||||
|
||||
class AppClass : public QObject, public RPCSender {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
AppClass();
|
||||
~AppClass();
|
||||
|
||||
static AppClass *app();
|
||||
static MainWindow *wnd();
|
||||
static MainWidget *main();
|
||||
|
||||
FileUploader *uploader();
|
||||
void uploadProfilePhoto(const QImage &tosend, const PeerId &peerId);
|
||||
void regPhotoUpdate(const PeerId &peer, const FullMsgId &msgId);
|
||||
bool isPhotoUpdating(const PeerId &peer);
|
||||
void cancelPhotoUpdate(const PeerId &peer);
|
||||
|
||||
void selfPhotoCleared(const MTPUserProfilePhoto &result);
|
||||
void chatPhotoCleared(PeerId peer, const MTPUpdates &updates);
|
||||
void selfPhotoDone(const MTPphotos_Photo &result);
|
||||
void chatPhotoDone(PeerId peerId, const MTPUpdates &updates);
|
||||
bool peerPhotoFail(PeerId peerId, const RPCError &e);
|
||||
void peerClearPhoto(PeerId peer);
|
||||
|
||||
void writeUserConfigIn(TimeMs ms);
|
||||
|
||||
void killDownloadSessionsStart(int32 dc);
|
||||
void killDownloadSessionsStop(int32 dc);
|
||||
|
||||
void checkLocalTime();
|
||||
void checkMapVersion();
|
||||
|
||||
signals:
|
||||
|
||||
void peerPhotoDone(PeerId peer);
|
||||
void peerPhotoFail(PeerId peer);
|
||||
|
||||
void adjustSingleTimers();
|
||||
|
||||
public slots:
|
||||
void photoUpdated(const FullMsgId &msgId, bool silent, const MTPInputFile &file);
|
||||
|
||||
void onSwitchDebugMode();
|
||||
void onSwitchWorkMode();
|
||||
void onSwitchTestMode();
|
||||
|
||||
void killDownloadSessions();
|
||||
void onAppStateChanged(Qt::ApplicationState state);
|
||||
|
||||
void call_handleHistoryUpdate();
|
||||
void call_handleUnreadCounterUpdate();
|
||||
void call_handleFileDialogQueue();
|
||||
void call_handleDelayedPeerUpdates();
|
||||
void call_handleObservables();
|
||||
|
||||
private:
|
||||
void loadLanguage();
|
||||
|
||||
QMap<FullMsgId, PeerId> photoUpdates;
|
||||
|
||||
QMap<int32, TimeMs> killDownloadSessionTimes;
|
||||
SingleTimer killDownloadSessionsTimer;
|
||||
|
||||
TimeMs _lastActionTime = 0;
|
||||
|
||||
MainWindow *_window = nullptr;
|
||||
FileUploader *_uploader = nullptr;
|
||||
Translator *_translator = nullptr;
|
||||
|
||||
};
|
||||
} // namespace Sandbox
|
||||
|
||||
39
Telegram/SourceFiles/auth_session.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
Telegram Desktop is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
It is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
In addition, as a special exception, the copyright holders give permission
|
||||
to link the code of portions of this program with the OpenSSL library.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "auth_session.h"
|
||||
|
||||
#include "messenger.h"
|
||||
|
||||
AuthSession::AuthSession(UserId userId) : _userId(userId) {
|
||||
t_assert(_userId != 0);
|
||||
}
|
||||
|
||||
AuthSession *AuthSession::Current() {
|
||||
return Messenger::Instance().authSession();
|
||||
}
|
||||
|
||||
UserData *AuthSession::CurrentUser() {
|
||||
if (auto userId = CurrentUserId()) {
|
||||
return App::user(userId);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
48
Telegram/SourceFiles/auth_session.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop version of Telegram messaging app, see https://telegram.org
|
||||
|
||||
Telegram Desktop is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
It is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
In addition, as a special exception, the copyright holders give permission
|
||||
to link the code of portions of this program with the OpenSSL library.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
class AuthSession {
|
||||
public:
|
||||
AuthSession(UserId userId);
|
||||
|
||||
AuthSession(const AuthSession &other) = delete;
|
||||
AuthSession &operator=(const AuthSession &other) = delete;
|
||||
|
||||
static AuthSession *Current();
|
||||
static UserId CurrentUserId() {
|
||||
auto current = Current();
|
||||
return current ? current->userId() : 0;
|
||||
}
|
||||
static PeerId CurrentUserPeerId() {
|
||||
auto userId = CurrentUserId();
|
||||
return userId ? peerFromUser(userId) : 0;
|
||||
}
|
||||
static UserData *CurrentUser();
|
||||
|
||||
UserId userId() const {
|
||||
return _userId;
|
||||
}
|
||||
|
||||
private:
|
||||
UserId _userId = 0;
|
||||
|
||||
};
|
||||
@@ -88,34 +88,6 @@ void AboutBox::keyPressEvent(QKeyEvent *e) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||
QString _getCrashReportFile(const QMimeData *m) {
|
||||
if (!m || m->urls().size() != 1 || !m->urls().at(0).isLocalFile()) return QString();
|
||||
|
||||
auto file = Platform::FileDialog::UrlToLocal(m->urls().at(0));
|
||||
|
||||
return file.endsWith(qstr(".telegramcrash"), Qt::CaseInsensitive) ? file : QString();
|
||||
}
|
||||
#endif // !TDESKTOP_DISABLE_CRASH_REPORTS
|
||||
|
||||
void AboutBox::dragEnterEvent(QDragEnterEvent *e) {
|
||||
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||
if (!_getCrashReportFile(e->mimeData()).isEmpty()) {
|
||||
e->setDropAction(Qt::CopyAction);
|
||||
e->accept();
|
||||
}
|
||||
#endif // !TDESKTOP_DISABLE_CRASH_REPORTS
|
||||
}
|
||||
|
||||
void AboutBox::dropEvent(QDropEvent *e) {
|
||||
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||
if (!_getCrashReportFile(e->mimeData()).isEmpty()) {
|
||||
e->acceptProposedAction();
|
||||
showCrashReportWindow(_getCrashReportFile(e->mimeData()));
|
||||
}
|
||||
#endif // !TDESKTOP_DISABLE_CRASH_REPORTS
|
||||
}
|
||||
|
||||
QString telegramFaqLink() {
|
||||
QString result = qsl("https://telegram.org/faq");
|
||||
if (cLang() > languageDefault && cLang() < languageCount) {
|
||||
|
||||
@@ -36,8 +36,6 @@ protected:
|
||||
|
||||
void resizeEvent(QResizeEvent *e) override;
|
||||
void keyPressEvent(QKeyEvent *e) override;
|
||||
void dragEnterEvent(QDragEnterEvent *e) override;
|
||||
void dropEvent(QDropEvent *e) override;
|
||||
|
||||
private:
|
||||
void showVersionHistory();
|
||||
|
||||
@@ -33,16 +33,16 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
BoxLayerTitleShadow::BoxLayerTitleShadow(QWidget *parent) : Ui::PlainShadow(parent, st::boxLayerTitleShadow) {
|
||||
}
|
||||
|
||||
QPointer<Ui::RoundButton> BoxContent::addButton(const QString &text, base::lambda<void()> &&clickCallback) {
|
||||
return addButton(text, std_::move(clickCallback), st::defaultBoxButton);
|
||||
QPointer<Ui::RoundButton> BoxContent::addButton(const QString &text, base::lambda<void()> clickCallback) {
|
||||
return addButton(text, std::move(clickCallback), st::defaultBoxButton);
|
||||
}
|
||||
|
||||
QPointer<Ui::RoundButton> BoxContent::addLeftButton(const QString &text, base::lambda<void()> &&clickCallback) {
|
||||
return getDelegate()->addLeftButton(text, std_::move(clickCallback), st::defaultBoxButton);
|
||||
QPointer<Ui::RoundButton> BoxContent::addLeftButton(const QString &text, base::lambda<void()> clickCallback) {
|
||||
return getDelegate()->addLeftButton(text, std::move(clickCallback), st::defaultBoxButton);
|
||||
}
|
||||
|
||||
void BoxContent::setInner(object_ptr<TWidget> inner) {
|
||||
setInner(std_::move(inner), st::boxLayerScroll);
|
||||
setInner(std::move(inner), st::boxLayerScroll);
|
||||
}
|
||||
|
||||
void BoxContent::setInner(object_ptr<TWidget> inner, const style::ScrollArea &st) {
|
||||
@@ -50,7 +50,7 @@ void BoxContent::setInner(object_ptr<TWidget> inner, const style::ScrollArea &st
|
||||
getDelegate()->setLayerType(true);
|
||||
_scroll.create(this, st);
|
||||
_scroll->setGeometryToLeft(0, _innerTopSkip, width(), 0);
|
||||
_scroll->setOwnedWidget(std_::move(inner));
|
||||
_scroll->setOwnedWidget(std::move(inner));
|
||||
if (_topShadow) {
|
||||
_topShadow->raise();
|
||||
_bottomShadow->raise();
|
||||
@@ -155,7 +155,7 @@ QPixmap BoxContent::grabInnerCache() {
|
||||
auto result = myGrab(this, _scroll->geometry());
|
||||
if (isTopShadowVisible) _topShadow->show();
|
||||
if (isBottomShadowVisible) _bottomShadow->show();
|
||||
return std_::move(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void BoxContent::resizeEvent(QResizeEvent *e) {
|
||||
@@ -197,14 +197,14 @@ void BoxContent::paintEvent(QPaintEvent *e) {
|
||||
Painter p(this);
|
||||
|
||||
if (testAttribute(Qt::WA_OpaquePaintEvent)) {
|
||||
for_const (auto rect, e->region().rects()) {
|
||||
for (auto rect : e->region().rects()) {
|
||||
p.fillRect(rect, st::boxBg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AbstractBox::AbstractBox(QWidget *parent, object_ptr<BoxContent> content) : LayerWidget(parent)
|
||||
, _content(std_::move(content)) {
|
||||
, _content(std::move(content)) {
|
||||
_content->setParent(this);
|
||||
_content->setDelegate(this);
|
||||
}
|
||||
@@ -240,7 +240,7 @@ void AbstractBox::paintEvent(QPaintEvent *e) {
|
||||
}
|
||||
auto other = e->region().intersected(QRect(0, st::boxRadius, width(), height() - 2 * st::boxRadius));
|
||||
if (!other.isEmpty()) {
|
||||
for_const (auto rect, other.rects()) {
|
||||
for (auto rect : other.rects()) {
|
||||
p.fillRect(rect, st::boxBg);
|
||||
}
|
||||
}
|
||||
@@ -252,16 +252,14 @@ void AbstractBox::paintEvent(QPaintEvent *e) {
|
||||
void AbstractBox::paintTitle(Painter &p, const QString &title, const QString &additional) {
|
||||
p.setFont(st::boxTitleFont);
|
||||
p.setPen(st::boxTitleFg);
|
||||
if (_layerType) {
|
||||
auto titleWidth = st::boxTitleFont->width(title);
|
||||
p.drawTextLeft(st::boxLayerTitlePosition.x(), st::boxLayerTitlePosition.y(), width(), title, titleWidth);
|
||||
if (!additional.isEmpty()) {
|
||||
p.setFont(st::boxLayerTitleAdditionalFont);
|
||||
p.setPen(st::boxTitleAdditionalFg);
|
||||
p.drawTextLeft(st::boxLayerTitlePosition.x() + titleWidth + st::boxLayerTitleAdditionalSkip, st::boxLayerTitlePosition.y() + st::boxTitleFont->ascent - st::boxLayerTitleAdditionalFont->ascent, width(), additional);
|
||||
}
|
||||
} else {
|
||||
p.drawTextLeft(st::boxTitlePosition.x(), st::boxTitlePosition.y(), width(), title);
|
||||
auto titleWidth = st::boxTitleFont->width(title);
|
||||
auto titleLeft = _layerType ? st::boxLayerTitlePosition.x() : st::boxTitlePosition.x();
|
||||
auto titleTop = _layerType ? st::boxLayerTitlePosition.y() : st::boxTitlePosition.y();
|
||||
p.drawTextLeft(titleLeft, titleTop, width(), title, titleWidth);
|
||||
if (!additional.isEmpty()) {
|
||||
p.setFont(st::boxLayerTitleAdditionalFont);
|
||||
p.setPen(st::boxTitleAdditionalFg);
|
||||
p.drawTextLeft(titleLeft + titleWidth + st::boxLayerTitleAdditionalSkip, titleTop + st::boxTitleFont->ascent - st::boxLayerTitleAdditionalFont->ascent, width(), additional);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,7 +289,7 @@ void AbstractBox::updateSize() {
|
||||
}
|
||||
|
||||
void AbstractBox::updateButtonsPositions() {
|
||||
if (!_buttons.isEmpty() || _leftButton) {
|
||||
if (!_buttons.empty() || _leftButton) {
|
||||
auto padding = _layerType ? st::boxLayerButtonPadding : st::boxButtonPadding;
|
||||
auto right = padding.right();
|
||||
auto top = buttonsTop();
|
||||
@@ -312,19 +310,19 @@ void AbstractBox::clearButtons() {
|
||||
_leftButton.destroy();
|
||||
}
|
||||
|
||||
QPointer<Ui::RoundButton> AbstractBox::addButton(const QString &text, base::lambda<void()> &&clickCallback, const style::RoundButton &st) {
|
||||
QPointer<Ui::RoundButton> AbstractBox::addButton(const QString &text, base::lambda<void()> clickCallback, const style::RoundButton &st) {
|
||||
_buttons.push_back(object_ptr<Ui::RoundButton>(this, text, st));
|
||||
auto result = QPointer<Ui::RoundButton>(_buttons.back());
|
||||
result->setClickedCallback(std_::move(clickCallback));
|
||||
result->setClickedCallback(std::move(clickCallback));
|
||||
result->show();
|
||||
updateButtonsPositions();
|
||||
return result;
|
||||
}
|
||||
|
||||
QPointer<Ui::RoundButton> AbstractBox::addLeftButton(const QString &text, base::lambda<void()> &&clickCallback, const style::RoundButton &st) {
|
||||
QPointer<Ui::RoundButton> AbstractBox::addLeftButton(const QString &text, base::lambda<void()> clickCallback, const style::RoundButton &st) {
|
||||
_leftButton = object_ptr<Ui::RoundButton>(this, text, st);
|
||||
auto result = QPointer<Ui::RoundButton>(_leftButton);
|
||||
result->setClickedCallback(std_::move(clickCallback));
|
||||
result->setClickedCallback(std::move(clickCallback));
|
||||
result->show();
|
||||
updateButtonsPositions();
|
||||
return result;
|
||||
|
||||