Alpha 1.0.34: Fix tabbed section widget render.

Also fix error message layout in EditCaptionBox.
This commit is contained in:
John Preston 2017-04-21 16:17:54 +03:00
parent 8f719f8c06
commit 33ffa0715d
9 changed files with 44 additions and 18 deletions

View File

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

View File

@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,33,0
PRODUCTVERSION 1,0,33,0
FILEVERSION 1,0,34,0
PRODUCTVERSION 1,0,34,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -52,10 +52,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "1.0.33.0"
VALUE "FileVersion", "1.0.34.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2017"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.0.33.0"
VALUE "ProductVersion", "1.0.34.0"
END
END
BLOCK "VarFileInfo"

View File

@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,33,0
PRODUCTVERSION 1,0,33,0
FILEVERSION 1,0,34,0
PRODUCTVERSION 1,0,34,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -43,10 +43,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "1.0.33.0"
VALUE "FileVersion", "1.0.34.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2017"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "1.0.33.0"
VALUE "ProductVersion", "1.0.34.0"
END
END
BLOCK "VarFileInfo"

View File

@ -628,7 +628,7 @@ void EditCaptionBox::onCaptionResized() {
}
void EditCaptionBox::updateBoxSize() {
auto newHeight = st::boxPhotoPadding.top() + st::boxPhotoCaptionSkip + _field->height() + st::normalFont->height;
auto newHeight = st::boxPhotoPadding.top() + st::boxPhotoCaptionSkip + _field->height() + errorTopSkip() + st::normalFont->height;
if (_photo || _animated) {
newHeight += _thumbh;
} else if (_thumbw) {
@ -641,6 +641,10 @@ void EditCaptionBox::updateBoxSize() {
setDimensions(st::boxWideWidth, newHeight);
}
int EditCaptionBox::errorTopSkip() const {
return (st::boxButtonPadding.top() / 2);
}
void EditCaptionBox::paintEvent(QPaintEvent *e) {
BoxContent::paintEvent(e);
@ -731,14 +735,14 @@ void EditCaptionBox::paintEvent(QPaintEvent *e) {
if (!_error.isEmpty()) {
p.setFont(st::normalFont);
p.setPen(st::boxTextFgError);
p.drawTextLeft(_field->x(), _field->y() + _field->height() + (st::boxButtonPadding.top() / 2), width(), _error);
p.drawTextLeft(_field->x(), _field->y() + _field->height() + errorTopSkip(), width(), _error);
}
}
void EditCaptionBox::resizeEvent(QResizeEvent *e) {
BoxContent::resizeEvent(e);
_field->resize(st::boxWideWidth - st::boxPhotoPadding.left() - st::boxPhotoPadding.right(), _field->height());
_field->moveToLeft(st::boxPhotoPadding.left(), height() - st::normalFont->height - _field->height());
_field->moveToLeft(st::boxPhotoPadding.left(), height() - st::normalFont->height - errorTopSkip() - _field->height());
}
void EditCaptionBox::setInnerFocus() {
@ -748,7 +752,7 @@ void EditCaptionBox::setInnerFocus() {
void EditCaptionBox::onSave(bool ctrlShiftEnter) {
if (_saveRequestId) return;
HistoryItem *item = App::histItemById(_msgId);
auto item = App::histItemById(_msgId);
if (!item) {
_error = lang(lng_edit_deleted);
update();

View File

@ -139,6 +139,8 @@ private:
void saveDone(const MTPUpdates &updates);
bool saveFail(const RPCError &error);
int errorTopSkip() const;
FullMsgId _msgId;
bool _animated = false;
bool _photo = false;

View File

@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#define BETA_VERSION_MACRO (0ULL)
constexpr int AppVersion = 1000033;
constexpr str_const AppVersionStr = "1.0.33";
constexpr int AppVersion = 1000034;
constexpr str_const AppVersionStr = "1.0.34";
constexpr bool AppAlphaVersion = true;
constexpr uint64 AppBetaVersion = BETA_VERSION_MACRO;

View File

@ -2212,6 +2212,22 @@ void MainWidget::ui_showPeerHistory(quint64 peerId, qint32 showAtMsgId, Ui::Show
}
return false;
};
// Qt bug workaround: QWidget::render() for an arbitrary widget calls
// sendPendingMoveAndResizeEvents(true, true) for the whole window,
// which does something like:
//
// setAttribute(Qt::WA_UpdatesDisabled);
// sendEvent(QResizeEvent);
// setAttribute(Qt::WA_UpdatesDisabled, false);
//
// So if we create TabbedSection widget in HistoryWidget::resizeEvent()
// it will get an enabled Qt::WA_UpdatesDisabled from its parent and it
// will never be rendered, because no one will ever remove that attribute.
//
// So we force HistoryWidget::resizeEvent() here, without WA_UpdatesDisabled.
myEnsureResized(_history);
auto animationParams = animatedShow() ? prepareHistoryAnimation(peerId) : Window::SectionSlideParams();
if (_history->peer() && _history->peer()->id != peerId && way != Ui::ShowWay::Forward) {

View File

@ -1,6 +1,6 @@
AppVersion 1000033
AppVersion 1000034
AppVersionStrMajor 1.0
AppVersionStrSmall 1.0.33
AppVersionStr 1.0.33
AppVersionStrSmall 1.0.34
AppVersionStr 1.0.34
AlphaChannel 1
BetaVersion 0

View File

@ -1,3 +1,7 @@
1.0.34 alpha (21.04.17)
- Bug fixes and other minor improvements.
1.0.33 alpha (16.04.17)
- Bug fixes and other minor improvements.