Skip to content

Commit

Permalink
inline gif view done, some design improvements, version 0.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Oct 10, 2014
1 parent 3009200 commit 09e2fba
Show file tree
Hide file tree
Showing 29 changed files with 548 additions and 195 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.2
AppVersion=6002
AppVersionStr=0.6.3
AppVersion=6003

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.2
AppVersion=6002
AppVersionStr=0.6.3
AppVersion=6003

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.2
AppVersion=6002
AppVersionStr=0.6.3
AppVersion=6003

if [ -d "./../Mac/Release/deploy/$AppVersionStr" ]; then
echo "Deploy folder for version $AppVersionStr already exists!"
Expand Down
22 changes: 11 additions & 11 deletions Telegram/Resources/style.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ inpDefFlat: flatInput {
}

inpDefGray: flatInput(inpDefFlat) {
bgColor: #ebebeb;
bgColor: #f2f2f2;
borderWidth: 2px;
borderColor: #ebebeb;
borderColor: #f2f2f2;
borderActive: #80cff9;
borderError: #ed8080;
phColor: #808080;
Expand Down Expand Up @@ -374,7 +374,7 @@ introCountry: countryInput {
width: 300px;
height: 41px;
top: 24px;
bgColor: #ebebeb;
bgColor: #f2f2f2;
ptrSize: size(15px, 8px);
textMrg: margins(16px, 5px, 16px, 15px);
font: inpDefFont;
Expand Down Expand Up @@ -446,7 +446,7 @@ countryList: countryList {
color: #000;
codeColor: #aaaaaa;//rgb(20, 136, 210);
bgColor: #FFF;
bgHovered: #f1f1f1;
bgHovered: #f5f5f5;
margin: 13px;
codeWidth: 60px;

Expand Down Expand Up @@ -873,13 +873,13 @@ mediaInSelectColor: msgInSelectDateColor;
mediaOutSelectColor: msgOutSelectDateColor;
mediaSaveDelta: 14px; // between bubble and download
mediaSaveButton: flatButton(btnDefFlat) {
color: btnYesColor;
overColor: btnYesHover;
downColor: btnYesHover;
color: #507da2;
overColor: #507da2;
downColor: #507da2;

bgColor: white;
overBgColor: btnWhiteHover;
downBgColor: btnWhiteHover;
overBgColor: #f5f8fa;
downBgColor: #f5f8fa;

width: -28px;
height: 34px;
Expand Down Expand Up @@ -1074,7 +1074,7 @@ profileListPhotoSize: 46px;
profileListPadding: size(12px, 6px);
profileListNameTop: 8px;
profileListStatusBottom: 6px;
profileHoverBG: #f1f1f1;
profileHoverBG: #f5f5f5;
profileActiveBG: #6294b9;
profileSubFont: font(fsize);
profileCheckRect: sprite(88px, 108px, 24px, 24px);
Expand Down Expand Up @@ -1223,7 +1223,7 @@ contactsClose: flatButton {
overColor: btnYesHover;
downColor: btnYesHover;

bgColor: #fffe;
bgColor: white;
overBgColor: white;
downBgColor: white;

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.2"
#define MyAppVersionZero "0.6.2"
#define MyAppFullVersion "0.6.2.0"
#define MyAppVersion "0.6.3"
#define MyAppVersionZero "0.6.3"
#define MyAppFullVersion "0.6.3.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.2.exe
call ..\..\..\TelegramPrivate\Sign.bat tsetup.0.6.3.exe
cd ..\..\Telegram
26 changes: 14 additions & 12 deletions Telegram/SourceFiles/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,17 @@ namespace App {
return 0;
}

void itemReplaced(HistoryItem *oldItem, HistoryItem *newItem) {
newItem->history()->itemReplaced(oldItem, newItem);
if (App::main()) App::main()->itemReplaced(oldItem, newItem);
if (App::hoveredItem() == oldItem) App::hoveredItem(newItem);
if (App::pressedItem() == oldItem) App::pressedItem(newItem);
if (App::hoveredLinkItem() == oldItem) App::hoveredLinkItem(newItem);
if (App::pressedLinkItem() == oldItem) App::pressedLinkItem(newItem);
if (App::contextItem() == oldItem) App::contextItem(newItem);
if (App::mousedItem() == oldItem) App::mousedItem(newItem);
}

HistoryItem *historyRegItem(HistoryItem *item) {
MsgsData::const_iterator i = msgsData.constFind(item->id);
if (i == msgsData.cend()) {
Expand All @@ -1124,10 +1135,7 @@ namespace App {
return 0;
}
if (i.value() != item && !i.value()->block() && item->block()) { // replace search item
item->history()->itemReplaced(i.value(), item);
if (App::main()) {
emit App::main()->historyItemReplaced(i.value(), item);
}
itemReplaced(i.value(), item);
delete i.value();
msgsData.insert(item->id, item);
return 0;
Expand Down Expand Up @@ -1167,9 +1175,7 @@ namespace App {
}
}
historyItemDetached(item);
if (App::main()) {
emit App::main()->historyItemDeleted(item);
}
if (App::main()) App::main()->itemRemoved(item);
}

void historyClearMsgs() {
Expand Down Expand Up @@ -1261,10 +1267,6 @@ namespace App {
textlnkOver(TextLinkPtr());
textlnkDown(TextLinkPtr());

if (completely && App::main()) {
App::main()->disconnect(SIGNAL(historyItemDeleted(HistoryItem *)));
}

histories().clear();

if (completely) {
Expand Down Expand Up @@ -1860,7 +1862,7 @@ namespace App {

bool isValidPhone(QString phone) {
phone = phone.replace(QRegularExpression(qsl("[^\\d]")), QString());
return phone.length() >= 8 || phone == qsl("777") || phone == qsl("333") || phone == qsl("42") || phone == qsl("111");
return phone.length() >= 8 || phone == qsl("777") || phone == qsl("333") || phone == qsl("111") || (phone.startsWith(qsl("42")) && (phone.length() == 2 || phone.length() == 5));
}

void quit() {
Expand Down
6 changes: 3 additions & 3 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 = 6002;
static const wchar_t *AppVersionStr = L"0.6.2";
static const int32 AppVersion = 6003;
static const wchar_t *AppVersionStr = L"0.6.3";

static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";
static const wchar_t *AppName = L"Telegram Desktop";
Expand Down Expand Up @@ -80,7 +80,7 @@ enum {
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
MediaViewImageSizeLimit = 100 * 1024 * 1024, // show up to 100mb jpg/png/gif docs in app
MaxZoomLevel = 7, // x8

PreloadHeightsCount = 3, // when 3 screens to scroll left make a preload request
Expand Down
14 changes: 10 additions & 4 deletions Telegram/SourceFiles/dialogswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ dialogs(false), contactsNoDialogs(true), contacts(true), sel(0), contactSel(fals
connect(main, SIGNAL(peerNameChanged(PeerData *, const PeerData::Names &, const PeerData::NameFirstChars &)), this, SLOT(onPeerNameChanged(PeerData *, const PeerData::Names &, const PeerData::NameFirstChars &)));
connect(main, SIGNAL(peerPhotoChanged(PeerData *)), this, SLOT(onPeerPhotoChanged(PeerData *)));
connect(main, SIGNAL(dialogRowReplaced(DialogRow *, DialogRow *)), this, SLOT(onDialogRowReplaced(DialogRow *, DialogRow *)));
connect(main, SIGNAL(historyItemReplaced(HistoryItem *, HistoryItem *)), this, SLOT(onItemReplaced(HistoryItem *, HistoryItem *)));
connect(main, SIGNAL(historyItemDeleted(HistoryItem *)), this, SLOT(onItemRemoved(HistoryItem *)));
}

void DialogsListWidget::paintEvent(QPaintEvent *e) {
Expand Down Expand Up @@ -453,15 +451,15 @@ void DialogsListWidget::clearSearchResults() {
_lastSearchId = 0;
}

void DialogsListWidget::onItemReplaced(HistoryItem *oldItem, HistoryItem *newItem) {
void DialogsListWidget::itemReplaced(HistoryItem *oldItem, HistoryItem *newItem) {
for (int i = 0; i < searchResults.size(); ++i) {
if (searchResults[i]->_item == oldItem) {
searchResults[i]->_item = newItem;
}
}
}

void DialogsListWidget::onItemRemoved(HistoryItem *item) {
void DialogsListWidget::itemRemoved(HistoryItem *item) {
int wasCount = searchResults.size();
for (int i = 0; i < searchResults.size();) {
if (searchResults[i]->_item == item) {
Expand Down Expand Up @@ -1088,6 +1086,14 @@ void DialogsWidget::clearFiltered() {
onCancel();
}

void DialogsWidget::itemRemoved(HistoryItem *item) {
list.itemRemoved(item);
}

void DialogsWidget::itemReplaced(HistoryItem *oldItem, HistoryItem *newItem) {
list.itemReplaced(oldItem, newItem);
}

void DialogsWidget::unreadCountsReceived(const QVector<MTPDialog> &dialogs) {
for (QVector<MTPDialog>::const_iterator i = dialogs.cbegin(), e = dialogs.cend(); i != e; ++i) {
const MTPDdialog &d(i->c_dialog());
Expand Down
8 changes: 5 additions & 3 deletions Telegram/SourceFiles/dialogswidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ class DialogsListWidget : public QWidget {
State state() const;

void onFilterUpdate(QString newFilter, bool force = false);
void itemRemoved(HistoryItem *item);
void itemReplaced(HistoryItem *oldItem, HistoryItem *newItem);

~DialogsListWidget();

Expand All @@ -92,9 +94,6 @@ public slots:
void onPeerPhotoChanged(PeerData *peer);
void onDialogRowReplaced(DialogRow *oldRow, DialogRow *newRow);

void onItemRemoved(HistoryItem *item);
void onItemReplaced(HistoryItem *oldItem, HistoryItem *newItem);

signals:

void peerChosen(const PeerId &, MsgId);
Expand Down Expand Up @@ -177,6 +176,9 @@ class DialogsWidget : public QWidget, public Animated, public RPCSender {
void onSearchMore(MsgId minMsgId);
void clearFiltered();

void itemRemoved(HistoryItem *item);
void itemReplaced(HistoryItem *oldItem, HistoryItem *newItem);

signals:

void peerChosen(const PeerId &, MsgId);
Expand Down
8 changes: 7 additions & 1 deletion Telegram/SourceFiles/gui/countryinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ void CountryList::paintEvent(QPaintEvent *e) {

int l = countriesNow->size();
if (l) {
int from = (r.top() > _st.verticalMargin) ? (r.top() - _st.verticalMargin) / _st.rowHeight : 0, to = from + r.height() / _st.rowHeight + 1;
int from = (r.top() > _st.verticalMargin) ? (r.top() - _st.verticalMargin) / _st.rowHeight : 0, to = from + (r.height() / _st.rowHeight) + 2;
if (to >= l) {
if (from >= l) return;
to = l;
Expand Down Expand Up @@ -518,6 +518,12 @@ void CountrySelect::keyPressEvent(QKeyEvent *e) {
}
}

void CountrySelect::mousePressEvent(QMouseEvent *e) {
if (!QRect(_innerLeft, _innerTop, _innerWidth, _innerHeight).contains(e->pos())) {
onCountryCancel();
}
}

void CountrySelect::onFilterUpdate() {
QString newFilter(_filter.text().trimmed().toLower());
if (newFilter != lastFilter) {
Expand Down
1 change: 1 addition & 0 deletions Telegram/SourceFiles/gui/countryinput.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class CountrySelect : public QWidget, public Animated {

void paintEvent(QPaintEvent *e);
void keyPressEvent(QKeyEvent *e);
void mousePressEvent(QMouseEvent *e);
void resizeEvent(QResizeEvent *e);

bool animStep(float64 ms);
Expand Down
Loading

0 comments on commit 09e2fba

Please sign in to comment.