Skip to content

Commit

Permalink
Closed beta 10019014: New input fields design and animations.
Browse files Browse the repository at this point in the history
john-preston committed Dec 30, 2016
1 parent 2d48cde commit 90234cb
Showing 51 changed files with 1,065 additions and 937 deletions.
9 changes: 0 additions & 9 deletions Telegram/Resources/basic.style
Original file line number Diff line number Diff line change
@@ -394,15 +394,6 @@ radialPeriod: 3000;
radialFg: #ffffff;
radialBg: #00000056;

downloadPathSkip: 10px;

usernamePadding: margins(23px, 22px, 21px, 12px);
usernameSkip: 49px;
usernameTextStyle: TextStyle(defaultTextStyle) {
lineHeight: 20px;
}
usernameDefaultFg: #777777;

youtubeIcon: icon {
{ "media_youtube_play_bg", #e83131c8 },
{ "media_youtube_play", #ffffff, point(24px, 12px) },
2 changes: 2 additions & 0 deletions Telegram/Resources/langs/lang.strings
Original file line number Diff line number Diff line change
@@ -154,6 +154,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
"lng_phone_notreg" = "If you don't have a Telegram account yet,\nplease [b]sign up[/b] with {link_start}Android / iPhone{link_end} or {signup_start}here{signup_end}";
"lng_country_code" = "Country Code";
"lng_bad_country_code" = "Invalid Country Code";
"lng_country_fake_ph" = "Your country";
"lng_country_ph" = "Search";
"lng_country_done" = "Done";
"lng_country_none" = "Country not found";
@@ -351,6 +352,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
"lng_passcode_wrong" = "Wrong passcode";
"lng_passcode_is_same" = "Passcode was not changed";
"lng_passcode_enter" = "Enter your local passcode";
"lng_passcode_ph" = "Your passcode";
"lng_passcode_submit" = "Submit";
"lng_passcode_logout" = "Log out";
"lng_passcode_need_unblock" = "You need to unlock me first.";
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Telegram.rc
Original file line number Diff line number Diff line change
@@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,10,19,13
PRODUCTVERSION 0,10,19,13
FILEVERSION 0,10,19,14
PRODUCTVERSION 0,10,19,14
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -51,10 +51,10 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileVersion", "0.10.19.13"
VALUE "FileVersion", "0.10.19.14"
VALUE "LegalCopyright", "Copyright (C) 2014-2016"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "0.10.19.13"
VALUE "ProductVersion", "0.10.19.14"
END
END
BLOCK "VarFileInfo"
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Updater.rc
Original file line number Diff line number Diff line change
@@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,10,19,13
PRODUCTVERSION 0,10,19,13
FILEVERSION 0,10,19,14
PRODUCTVERSION 0,10,19,14
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -43,10 +43,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Updater"
VALUE "FileVersion", "0.10.19.13"
VALUE "FileVersion", "0.10.19.14"
VALUE "LegalCopyright", "Copyright (C) 2014-2016"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "0.10.19.13"
VALUE "ProductVersion", "0.10.19.14"
END
END
BLOCK "VarFileInfo"
16 changes: 6 additions & 10 deletions Telegram/SourceFiles/boxes/addcontactbox.cpp
Original file line number Diff line number Diff line change
@@ -239,9 +239,7 @@ void AddContactBox::onRetry() {
_retry->hide();
resizeEvent(0);
_first->setText(QString());
_first->updatePlaceholder();
_last->setText(QString());
_last->updatePlaceholder();
_phone->clearText();
_phone->setDisabled(false);
_first->setFocus();
@@ -274,13 +272,11 @@ GroupInfoBox::GroupInfoBox(CreatingGroupType creating, bool fromTypeChoose) : Ab
connect(_next, SIGNAL(clicked()), this, SLOT(onNext()));
connect(_cancel, SIGNAL(clicked()), this, SLOT(onClose()));

_photo->setClickedCallback([this] {
App::CallDelayed(st::defaultActiveButton.ripple.hideDuration, base::lambda_guarded(this, [this] {
auto imgExtensions = cImgExtensions();
auto filter = qsl("Image files (*") + imgExtensions.join(qsl(" *")) + qsl(");;") + filedialogAllFilesFilter();
_setPhotoFileQueryId = FileDialog::queryReadFile(lang(lng_choose_image), filter);
}));
});
_photo->setClickedCallback(App::LambdaDelayed(st::defaultActiveButton.ripple.hideDuration, this, [this] {
auto imgExtensions = cImgExtensions();
auto filter = qsl("Image files (*") + imgExtensions.join(qsl(" *")) + qsl(");;") + filedialogAllFilesFilter();
_setPhotoFileQueryId = FileDialog::queryReadFile(lang(lng_choose_image), filter);
}));
subscribe(FileDialog::QueryDone(), [this](const FileDialog::QueryUpdate &update) {
notifyFileQueryUpdated(update);
});
@@ -433,7 +429,7 @@ SetupChannelBox::SetupChannelBox(ChannelData *channel, bool existing) : Abstract
, _aboutPublicWidth(width() - st::boxPadding.left() - st::boxButtonPadding.right() - st::newGroupPadding.left() - st::defaultBoxCheckbox.textPosition.x())
, _aboutPublic(st::normalFont, lang(channel->isMegagroup() ? lng_create_public_group_about : lng_create_public_channel_about), _defaultOptions, _aboutPublicWidth)
, _aboutPrivate(st::normalFont, lang(channel->isMegagroup() ? lng_create_private_group_about : lng_create_private_channel_about), _defaultOptions, _aboutPublicWidth)
, _link(this, st::defaultInputField, QString(), channel->username, true)
, _link(this, st::setupChannelLink, QString(), channel->username, true)
, _linkOver(false)
, _save(this, lang(lng_settings_save), st::defaultBoxButton)
, _skip(this, lang(existing ? lng_cancel : lng_create_group_skip), st::cancelBoxButton) {
63 changes: 42 additions & 21 deletions Telegram/SourceFiles/boxes/boxes.style
Original file line number Diff line number Diff line change
@@ -97,6 +97,7 @@ boxLinkButton: LinkButton {
}

boxOptionListPadding: margins(2px, 20px, 2px, 2px);
boxOptionInputSkip: 6px;

boxVerticalMargin: 10px;
boxWidth: 320px;
@@ -146,7 +147,7 @@ boxPhotoTitleFont: font(16px semibold);
boxPhotoTitlePosition: point(28px, 26px);
boxPhotoPadding: margins(28px, 28px, 28px, 0px);
boxPhotoCompressedSkip: 20px;
boxPhotoCaptionSkip: 22px;
boxPhotoCaptionSkip: 8px;
boxPhotoTextFg: #808080;

cropPointSize: 10px;
@@ -202,7 +203,7 @@ aboutRevokePublicLabel: FlatLabel(defaultFlatLabel) {

contactUserIcon: icon {{ "add_contact_user", #999999 }};
contactPhoneIcon: icon {{ "add_contact_phone", #999999 }};
contactIconTop: 10px;
contactIconTop: 28px;

contactsAddIconAbove: icon {{ "contacts_add", activeButtonFg, point(18px, 18px) }};
contactsAdd: TwoIconButton {
@@ -222,8 +223,8 @@ contactsAdd: TwoIconButton {
}
contactsAddPosition: point(14px, 8px);

contactPadding: margins(49px, 22px, 0px, 6px);
contactSkip: 13px;
contactPadding: margins(49px, 2px, 0px, 6px);
contactSkip: 6px;
contactPhoneSkip: 30px;

contactsPhotoSize: 42px;
@@ -283,13 +284,16 @@ contactsMultiSelect: MultiSelect {

placeholderFg: #999999;
placeholderFgActive: #aaaaaa;
placeholderFgError: #aaaaaa;
placeholderMargins: margins(2px, 0px, 2px, 0px);
placeholderScale: 0.;
placeholderFont: normalFont;

border: 0px;
borderActive: 0px;
borderError: 0px;

height: 32px;
heightMin: 32px;

font: normalFont;
}
@@ -406,20 +410,23 @@ sessionTerminateAllButton: LinkButton(boxLinkButton) {

passcodeHeaderFont: font(19px);
passcodeHeaderHeight: 80px;
passcodeInput: introPhone;
passcodeInput: InputField(introPhone) {
textMargins: margins(1px, 27px, 1px, 6px);
}
passcodeSubmit: RoundButton(introNextButton) {
width: 225px;
}
passcodeSubmitSkip: 40px;
passcodePadding: margins(0px, 22px, 0px, 3px);
passcodeSkip: 31px;
passcodePadding: margins(0px, 6px, 0px, 13px);
passcodeTextLine: 28px;
passcodeSkip: 21px;

newGroupAboutFg: #808080;
newGroupPadding: margins(4px, 6px, 4px, 3px);
newGroupSkip: 17px;
newGroupSkip: 27px;
newGroupInfoPadding: margins(0px, -4px, 0px, 1px);

newGroupLinkPadding: margins(4px, 27px, 4px, 12px);
newGroupLinkPadding: margins(4px, 27px, 4px, 21px);
newGroupLinkTop: 3px;
newGroupLinkFont: font(16px);

@@ -428,12 +435,17 @@ newGroupPhotoIcon: icon {{ "new_chat_photo", #ffffff }};
newGroupPhotoIconPosition: point(23px, 25px);
newGroupPhotoDuration: 150;

newGroupNamePosition: point(27px, 20px);
newGroupNamePosition: point(27px, 5px);

newGroupDescriptionPadding: margins(0px, 13px, 0px, 4px);
newGroupDescription: InputField(defaultInputField) {
textMargins: margins(1px, 26px, 1px, 4px);
heightMax: 135px;
}

newGroupDescriptionPadding: margins(0px, 23px, 0px, 14px);
newGroupDescription: InputArea(defaultInputArea) {
textMargins: margins(1px, 6px, 1px, 4px);
heightMax: 115px;
setupChannelLink: InputField(defaultInputField) {
textMargins: margins(0px, 6px, 0px, 4px);
heightMin: 32px;
}

newGroupPublicLinkPadding: margins(0px, 20px, 0px, 5px);
@@ -463,14 +475,14 @@ aboutTextStyle: TextStyle(defaultTextStyle) {
lineHeight: 22px;
}

editTextArea: InputArea(defaultInputArea) {
textMargins: margins(1px, 6px, 1px, 4px);
heightMax: 256px;
editTextArea: InputField(defaultInputField) {
textMargins: margins(1px, 26px, 1px, 4px);
heightMax: 276px;
}

confirmCaptionArea: InputArea(defaultInputArea) {
textMargins: margins(1px, 6px, 1px, 4px);
heightMax: 56px;
confirmCaptionArea: InputField(defaultInputField) {
textMargins: margins(1px, 26px, 1px, 4px);
heightMax: 78px;
}
confirmBg: windowBgOver;
confirmMaxHeight: 245px;
@@ -501,3 +513,12 @@ backgroundScroll: FlatScroll(boxScroll) {
deltat: 10px;
deltab: 0px;
}

usernamePadding: margins(23px, 6px, 21px, 12px);
usernameSkip: 49px;
usernameTextStyle: TextStyle(defaultTextStyle) {
lineHeight: 20px;
}
usernameDefaultFg: #777777;

downloadPathSkip: 10px;
11 changes: 5 additions & 6 deletions Telegram/SourceFiles/boxes/connectionbox.cpp
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ ConnectionBox::ConnectionBox() : AbstractBox(st::boxWidth, lang(lng_connection_h
void ConnectionBox::updateControlsVisibility() {
int32 h = titleHeight() + st::boxOptionListPadding.top() + _autoRadio->heightNoMargins() + st::boxOptionListPadding.top() + _httpProxyRadio->heightNoMargins() + st::boxOptionListPadding.top() + _tcpProxyRadio->heightNoMargins() + st::boxOptionListPadding.top() + st::connectionIPv6Skip + _tryIPv6->heightNoMargins() + st::boxOptionListPadding.bottom() + st::boxPadding.bottom() + st::boxButtonPadding.top() + _save->height() + st::boxButtonPadding.bottom();
if (_httpProxyRadio->checked() || _tcpProxyRadio->checked()) {
h += 2 * st::boxOptionListPadding.top() + 2 * _hostInput->height();
h += 2 * st::boxOptionInputSkip + 2 * _hostInput->height();
_hostInput->show();
_portInput->show();
_userInput->show();
@@ -89,19 +89,19 @@ void ConnectionBox::resizeEvent(QResizeEvent *e) {

int32 inputy = 0;
if (_httpProxyRadio->checked()) {
inputy = _httpProxyRadio->bottomNoMargins() + st::boxOptionListPadding.top();
_tcpProxyRadio->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), inputy + st::boxOptionListPadding.top() + 2 * _hostInput->height() + st::boxOptionListPadding.top());
inputy = _httpProxyRadio->bottomNoMargins() + st::boxOptionInputSkip;
_tcpProxyRadio->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), inputy + st::boxOptionInputSkip + 2 * _hostInput->height() + st::boxOptionListPadding.top());
} else {
_tcpProxyRadio->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), _httpProxyRadio->bottomNoMargins() + st::boxOptionListPadding.top());
if (_tcpProxyRadio->checked()) {
inputy = _tcpProxyRadio->bottomNoMargins() + st::boxOptionListPadding.top();
inputy = _tcpProxyRadio->bottomNoMargins() + st::boxOptionInputSkip;
}
}

if (inputy) {
_hostInput->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left() + st::defaultBoxCheckbox.textPosition.x() - st::defaultInputField.textMargins.left(), inputy);
_portInput->moveToRight(st::boxPadding.right(), inputy);
_userInput->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left() + st::defaultBoxCheckbox.textPosition.x() - st::defaultInputField.textMargins.left(), _hostInput->y() + _hostInput->height() + st::boxOptionListPadding.top());
_userInput->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left() + st::defaultBoxCheckbox.textPosition.x() - st::defaultInputField.textMargins.left(), _hostInput->y() + _hostInput->height() + st::boxOptionInputSkip);
_passwordInput->moveToRight(st::boxPadding.right(), _userInput->y());
}

@@ -120,7 +120,6 @@ void ConnectionBox::onChange() {
_hostInput->setFocus();
if (_httpProxyRadio->checked() && !_portInput->getLastText().toInt()) {
_portInput->setText(qsl("80"));
_portInput->updatePlaceholder();
}
}
update();
Loading

0 comments on commit 90234cb

Please sign in to comment.