Skip to content

Commit

Permalink
0.6.2 version, context menus fixed, image documents view in overlay a…
Browse files Browse the repository at this point in the history
…dded
  • Loading branch information
john-preston committed Oct 7, 2014
1 parent c3a5194 commit aebe171
Show file tree
Hide file tree
Showing 27 changed files with 649 additions and 327 deletions.
4 changes: 2 additions & 2 deletions Telegram/PrepareLinux.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AppVersionStr=0.6.1
AppVersion=6001
AppVersionStr=0.6.2
AppVersion=6002

if [ -d "./../Linux/Release/deploy/$AppVersionStr" ]; then
echo "Deploy folder for version $AppVersionStr already exists!"
Expand Down
4 changes: 2 additions & 2 deletions Telegram/PrepareLinux32.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AppVersionStr=0.6.1
AppVersion=6001
AppVersionStr=0.6.2
AppVersion=6002

if [ -d "./../Linux/Release/deploy/$AppVersionStr" ]; then
echo "Deploy folder for version $AppVersionStr already exists!"
Expand Down
4 changes: 2 additions & 2 deletions Telegram/PrepareMac.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AppVersionStr=0.6.1
AppVersion=6001
AppVersionStr=0.6.2
AppVersion=6002

if [ -d "./../Mac/Release/deploy/$AppVersionStr" ]; then
echo "Deploy folder for version $AppVersionStr already exists!"
Expand Down
4 changes: 4 additions & 0 deletions Telegram/Resources/lang.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@ lng_context_open_audio: "Open Audio";
lng_context_save_audio: "Save Audio As...";
lng_context_open_document: "Open File";
lng_context_save_document: "Save File As...";
lng_context_forward_file: "Forward File";
lng_context_delete_file: "Delete File";
lng_context_close_file: "Close File";
lng_context_copy_text: "Copy Message Text";
lng_context_to_msg: "Go To Message";
lng_context_forward_msg: "Forward Message";
Expand Down Expand Up @@ -436,6 +439,7 @@ lng_mediaview_single_photo: "Single Photo";
lng_mediaview_group_photo: "Group Photo";
lng_mediaview_profile_photo: "Profile Photo";
lng_mediaview_n_of_count: "{n} of {count}";
lng_mediaview_doc_image: "Document";

// Mac specific

Expand Down
2 changes: 2 additions & 0 deletions Telegram/Resources/style.txt
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ msgFont: font(fsize);
msgNameFont: font(fsize semibold);
msgServiceFont: font(fsize semibold);
msgServiceNameFont: font(fsize semibold);
msgServicePhotoWidth: 100px;
msgDateFont: font(13px);
msgMinWidth: 190px;
msgPhotoSize: 30px;
Expand Down Expand Up @@ -1466,6 +1467,7 @@ medviewNavBarWidth: 120px;
medviewTopSkip: 66px;
medviewBottomSkip: 66px;
medviewMainWidth: 600px;
medviewControlsBgOpacity: 0.5;
medviewLightOpacity: 0.7;
medviewDarkOpacity: 0.8;
medviewLightNav: 0.5;
Expand Down
6 changes: 3 additions & 3 deletions Telegram/Setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#define MyAppShortName "Telegram"
#define MyAppName "Telegram Desktop"
#define MyAppVersion "0.6.1"
#define MyAppVersionZero "0.6.1"
#define MyAppFullVersion "0.6.1.0"
#define MyAppVersion "0.6.2"
#define MyAppVersionZero "0.6.2"
#define MyAppFullVersion "0.6.2.0"
#define MyAppPublisher "Telegram Messenger LLP"
#define MyAppURL "https://tdesktop.com"
#define MyAppExeName "Telegram.exe"
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SignWinSetup.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cd ..\Win32\Deploy
call ..\..\..\TelegramPrivate\Sign.bat tsetup.0.6.1.exe
call ..\..\..\TelegramPrivate\Sign.bat tsetup.0.6.2.exe
cd ..\..\Telegram
7 changes: 5 additions & 2 deletions Telegram/SourceFiles/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://tdesktop.com
*/
#pragma once

static const int32 AppVersion = 6001;
static const wchar_t *AppVersionStr = L"0.6.1";
static const int32 AppVersion = 6002;
static const wchar_t *AppVersionStr = L"0.6.2";

static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";
static const wchar_t *AppName = L"Telegram Desktop";
Expand Down Expand Up @@ -79,6 +79,9 @@ enum {
AudioVoiceMsgChannels = 2, // stereo
AudioVoiceMsgBufferSize = 1024 * 1024, // 1 Mb buffers
AudioVoiceMsgInMemory = 1024 * 1024, // 1 Mb audio is hold in memory and auto loaded

MediaViewImageSizeLimit = 10 * 1024 * 1024, // show up to 10mb jpg/png docs in mediaview
MaxZoomLevel = 7, // x8
};

#ifdef Q_OS_WIN
Expand Down
3 changes: 2 additions & 1 deletion Telegram/SourceFiles/dialogswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ void DialogsListWidget::onPeerPhotoChanged(PeerData *peer) {
}

void DialogsListWidget::onFilterUpdate(QString newFilter, bool force) {
newFilter = textAccentFold(newFilter.trimmed().toLower());
newFilter = textSearchKey(newFilter);
if (newFilter != filter || force) {
QStringList f;
if (!newFilter.isEmpty()) {
Expand Down Expand Up @@ -466,6 +466,7 @@ void DialogsListWidget::onItemRemoved(HistoryItem *item) {
for (int i = 0; i < searchResults.size();) {
if (searchResults[i]->_item == item) {
searchResults.remove(i);
if (searchedCount > 0) --searchedCount;
} else {
++i;
}
Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/gui/contextmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ void ContextMenu::popup(const QPoint &p) {
if (w.y() + height() - st::dropdownPadding.bottom() > r.y() + r.height()) {
w.setY(p.y() - height() + st::dropdownPadding.bottom());
}
if (w.y() < 0) {
w.setY(0);
if (w.y() < r.y()) {
w.setY(r.y());
}
move(w);
showStart();
Expand Down
16 changes: 14 additions & 2 deletions Telegram/SourceFiles/gui/emoji_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Copyright (c) 2014 John Preston, https://tdesktop.com
*/
#pragma once

#include "gui/text.h"

void initEmoji();
EmojiPtr getEmoji(uint32 code);

Expand All @@ -38,15 +40,25 @@ inline bool emojiEdge(const QChar *ch) {

inline QString replaceEmojis(const QString &text) {
QString result;
const QChar *emojiEnd = text.unicode(), *e = text.cend();
LinkRanges lnkRanges = textParseLinks(text);
int32 currentLink = 0, lnkCount = lnkRanges.size();
const QChar *emojiStart = text.unicode(), *emojiEnd = emojiStart, *e = text.cend();
bool canFindEmoji = true, consumePrevious = false;
for (const QChar *ch = emojiEnd; ch != e;) {
uint32 emojiCode = 0;
const QChar *newEmojiEnd = 0;
if (canFindEmoji) {
findEmoji(ch, e, newEmojiEnd, emojiCode);
}
if (emojiCode) {

while (currentLink < lnkCount && ch >= lnkRanges[currentLink].from + lnkRanges[currentLink].len) {
++currentLink;
}
if (emojiCode &&
(ch == emojiStart || !ch->isLetterOrNumber() || !(ch - 1)->isLetterOrNumber()) &&
(newEmojiEnd == e || !newEmojiEnd->isLetterOrNumber() || newEmojiEnd == emojiStart || !(newEmojiEnd - 1)->isLetterOrNumber()) &&
(currentLink >= lnkCount || (ch < lnkRanges[currentLink].from && newEmojiEnd <= lnkRanges[currentLink].from) || (ch >= lnkRanges[currentLink].from + lnkRanges[currentLink].len && newEmojiEnd > lnkRanges[currentLink].from + lnkRanges[currentLink].len))
) {
// if (newEmojiEnd < e && newEmojiEnd->unicode() == ' ') ++newEmojiEnd;
if (result.isEmpty()) result.reserve(text.size());
if (ch > emojiEnd + (consumePrevious ? 1 : 0)) {
Expand Down
Loading

0 comments on commit aebe171

Please sign in to comment.