mirror of https://github.com/procxx/kepka.git
Passcode box layout fix. Drop image from Firefox fix.
Also admin star color in group profile has separate palette entry.
This commit is contained in:
parent
7fb1463c43
commit
8a8e0c1182
Telegram
Resources
SourceFiles
|
@ -411,6 +411,7 @@ overviewPhotoSelectOverlay: #40ace333;
|
|||
profileStatusFgOver: #7c99b2;
|
||||
profileVerifiedCheckBg: windowBgActive;
|
||||
profileVerifiedCheckFg: windowFgActive;
|
||||
profileAdminStartFg: windowBgActive;
|
||||
|
||||
// settings
|
||||
notificationsBoxMonitorFg: windowFg;
|
||||
|
|
|
@ -351,6 +351,7 @@ overviewPhotoSelectOverlay: #40ace333;
|
|||
profileStatusFgOver: #7c99b2;
|
||||
profileVerifiedCheckBg: windowBgActive;
|
||||
profileVerifiedCheckFg: windowFgActive;
|
||||
profileAdminStartFg: windowBgActive;
|
||||
notificationsBoxMonitorFg: windowFg;
|
||||
notificationsBoxScreenBg: dialogsBgActive;
|
||||
notificationSampleUserpicFg: windowBgActive;
|
||||
|
|
|
@ -143,7 +143,7 @@ void PasscodeBox::paintEvent(QPaintEvent *e) {
|
|||
Painter p(this);
|
||||
|
||||
int32 w = st::boxWidth - st::boxPadding.left() * 1.5;
|
||||
int32 abouty = (_passwordHint->isHidden() ? ((_reenterPasscode->isHidden() ? (_oldPasscode->y() + (_hasRecovery && !_hintText.isEmpty() ? st::passcodeTextLine : 0)) : _reenterPasscode->y()) + st::passcodeSkip) : (_passwordHint->y() + st::passcodeLittleSkip)) + _oldPasscode->height() + st::passcodeLittleSkip + st::passcodeAboutSkip;
|
||||
int32 abouty = (_passwordHint->isHidden() ? ((_reenterPasscode->isHidden() ? (_oldPasscode->y() + (_hasRecovery && !_hintText.isEmpty() ? st::passcodeTextLine : 0)) : _reenterPasscode->y()) + st::passcodeSkip) : _passwordHint->y()) + _oldPasscode->height() + st::passcodeLittleSkip + st::passcodeAboutSkip;
|
||||
p.setPen(st::boxTextFg);
|
||||
_about.drawLeft(p, st::boxPadding.left(), abouty, w, width());
|
||||
|
||||
|
|
|
@ -6532,7 +6532,7 @@ bool HistoryWidget::confirmSendingFiles(const SendingFilesLists &lists, Compress
|
|||
return validateSendingFiles(lists, [this, &lists, compressed, addedComment](const QStringList &files) {
|
||||
auto image = QImage();
|
||||
auto insertTextOnCancel = QString();
|
||||
auto prepareBox = [this, &files, &lists, compressed, &image] {
|
||||
auto box = ([this, &files, &lists, compressed, &image] {
|
||||
if (files.size() > 1) {
|
||||
return Box<SendFilesBox>(files, lists.allFilesForCompress ? compressed : CompressConfirm::None);
|
||||
}
|
||||
|
@ -6540,12 +6540,12 @@ bool HistoryWidget::confirmSendingFiles(const SendingFilesLists &lists, Compress
|
|||
auto animated = false;
|
||||
image = App::readImage(filepath, nullptr, false, &animated);
|
||||
return Box<SendFilesBox>(filepath, image, imageCompressConfirm(image, compressed, animated), animated);
|
||||
};
|
||||
})();
|
||||
auto sendCallback = [this, image](const QStringList &files, bool compressed, const QString &caption, MsgId replyTo) {
|
||||
auto type = compressed ? SendMediaType::Photo : SendMediaType::File;
|
||||
uploadFilesAfterConfirmation(files, image, QByteArray(), type, caption);
|
||||
};
|
||||
return showSendFilesBox(prepareBox(), insertTextOnCancel, addedComment, std_::move(sendCallback));
|
||||
return showSendFilesBox(std_::move(box), insertTextOnCancel, addedComment, std_::move(sendCallback));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -6686,7 +6686,7 @@ void HistoryWidget::uploadFilesAfterConfirmation(const QStringList &files, const
|
|||
if (filepath.isEmpty() && (!image.isNull() || !content.isNull())) {
|
||||
tasks.push_back(MakeShared<FileLoadTask>(content, image, type, to, caption));
|
||||
} else {
|
||||
tasks.push_back(MakeShared<FileLoadTask>(filepath, type, to, caption));
|
||||
tasks.push_back(MakeShared<FileLoadTask>(filepath, image, type, to, caption));
|
||||
}
|
||||
}
|
||||
_fileLoader.addTasks(tasks);
|
||||
|
@ -6699,7 +6699,7 @@ void HistoryWidget::uploadFile(const QByteArray &fileContent, SendMediaType type
|
|||
|
||||
auto to = FileLoadTo(_peer->id, _silent->checked(), replyToId());
|
||||
auto caption = QString();
|
||||
_fileLoader.addTask(MakeShared<FileLoadTask>(fileContent, type, to, caption));
|
||||
_fileLoader.addTask(MakeShared<FileLoadTask>(fileContent, QImage(), type, to, caption));
|
||||
|
||||
cancelReplyAfterMediaSend(lastForceReplyReplied());
|
||||
}
|
||||
|
|
|
@ -172,9 +172,10 @@ void TaskQueueWorker::onTaskAdded() {
|
|||
_inTaskAdded = false;
|
||||
}
|
||||
|
||||
FileLoadTask::FileLoadTask(const QString &filepath, SendMediaType type, const FileLoadTo &to, const QString &caption) : _id(rand_value<uint64>())
|
||||
FileLoadTask::FileLoadTask(const QString &filepath, const QImage &image, SendMediaType type, const FileLoadTo &to, const QString &caption) : _id(rand_value<uint64>())
|
||||
, _to(to)
|
||||
, _filepath(filepath)
|
||||
, _image(image)
|
||||
, _type(type)
|
||||
, _caption(caption) {
|
||||
}
|
||||
|
@ -214,9 +215,8 @@ void FileLoadTask::process() {
|
|||
auto gif = false;
|
||||
auto voice = (_type == SendMediaType::Audio);
|
||||
auto fullimage = base::take(_image);
|
||||
|
||||
if (!_filepath.isEmpty()) {
|
||||
QFileInfo info(_filepath);
|
||||
auto info = _filepath.isEmpty() ? QFileInfo() : QFileInfo(_filepath);
|
||||
if (info.exists()) {
|
||||
if (info.isDir()) {
|
||||
_result->filesize = -1;
|
||||
return;
|
||||
|
|
|
@ -235,7 +235,7 @@ typedef QSharedPointer<FileLoadResult> FileLoadResultPtr;
|
|||
|
||||
class FileLoadTask : public Task {
|
||||
public:
|
||||
FileLoadTask(const QString &filepath, SendMediaType type, const FileLoadTo &to, const QString &caption);
|
||||
FileLoadTask(const QString &filepath, const QImage &image, SendMediaType type, const FileLoadTo &to, const QString &caption);
|
||||
FileLoadTask(const QByteArray &content, const QImage &image, SendMediaType type, const FileLoadTo &to, const QString &caption);
|
||||
FileLoadTask(const QByteArray &voice, int32 duration, const VoiceWaveform &waveform, const FileLoadTo &to, const QString &caption);
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
|||
#include <openssl/md5.h>
|
||||
#include <openssl/rand.h>
|
||||
#include "zlib.h"
|
||||
#include "lang.h"
|
||||
|
||||
#include "mtproto/rsa_public_key.h"
|
||||
|
||||
|
@ -869,7 +870,8 @@ void ConnectionPrivate::tryToSend() {
|
|||
MTPInitConnection<mtpRequest> initWrapperImpl, *initWrapper = &initWrapperImpl;
|
||||
int32 initSize = 0, initSizeInInts = 0;
|
||||
if (needsLayer) {
|
||||
initWrapperImpl = MTPInitConnection<mtpRequest>(MTP_int(ApiId), MTP_string(cApiDeviceModel()), MTP_string(cApiSystemVersion()), MTP_string(cApiAppVersion()), MTP_string(Sandbox::LangSystemISO()), mtpRequest());
|
||||
auto langCode = (cLang() == languageTest || cLang() == languageDefault) ? Sandbox::LangSystemISO() : str_const_toString(LanguageCodes[cLang()]);
|
||||
initWrapperImpl = MTPInitConnection<mtpRequest>(MTP_int(ApiId), MTP_string(cApiDeviceModel()), MTP_string(cApiSystemVersion()), MTP_string(cApiAppVersion()), MTP_string(langCode), mtpRequest());
|
||||
initSizeInInts = (initWrapper->innerLength() >> 2) + 2;
|
||||
initSize = initSizeInInts * sizeof(mtpPrime);
|
||||
}
|
||||
|
@ -1267,7 +1269,7 @@ void ConnectionPrivate::onOldConnection() {
|
|||
|
||||
void ConnectionPrivate::onPingSender() {
|
||||
if (_pingId) {
|
||||
if (_pingSendAt + (MTPPingSendAfter - MTPPingSendAfterAuto - 1) * 1000LL < getms(true)) {
|
||||
if (_pingSendAt + (MTPPingSendAfter - MTPPingSendAfterAuto - 1) * 1000LL < getms(true)) {
|
||||
LOG(("Could not send ping for MTPPingSendAfter seconds, restarting..."));
|
||||
return restart();
|
||||
} else {
|
||||
|
|
|
@ -1641,7 +1641,7 @@ void OverviewInner::mediaOverviewUpdated() {
|
|||
History::MediaOverview &o(_history->overview[_type]), *migratedOverview = _migrated ? &_migrated->overview[_type] : 0;
|
||||
int32 migrateCount = migratedIndexSkip();
|
||||
int32 l = _inSearch ? _searchResults.size() : (migrateCount + o.size()), tocheck = qMin(l, _itemsToBeLoaded);
|
||||
_items.reserve(withDates * tocheck); // day items
|
||||
_items.reserve((withDates ? 2 : 1) * tocheck); // day items
|
||||
|
||||
int32 top = 0, index = 0;
|
||||
bool allGood = true;
|
||||
|
@ -1775,7 +1775,7 @@ void OverviewInner::repaintItem(const HistoryItem *msg) {
|
|||
|
||||
int32 migrateindex = migratedIndexSkip();
|
||||
MsgId msgid = msg->id;
|
||||
if (history->overviewHasMsgId(_type, msgid) && (history == _history || migrateindex > 0)) {
|
||||
if ((history == _history || migrateindex > 0) && (_inSearch || history->overviewHasMsgId(_type, msgid))) {
|
||||
if (_type == OverviewPhotos || _type == OverviewVideos) {
|
||||
if (history == _migrated) msgid = -msgid;
|
||||
for (int32 i = 0, l = _items.size(); i != l; ++i) {
|
||||
|
|
|
@ -132,7 +132,7 @@ profileMemberPhotoPosition: point(12px, 6px);
|
|||
profileMemberNamePosition: point(68px, 11px);
|
||||
profileMemberNameFg: windowBoldFg;
|
||||
profileMemberStatusPosition: point(68px, 31px);
|
||||
profileMemberAdminIcon: icon {{ "profile_admin_star", windowBgActive, point(4px, 3px) }};
|
||||
profileMemberAdminIcon: icon {{ "profile_admin_star", profileAdminStartFg, point(4px, 3px) }};
|
||||
profileLimitReachedLabel: FlatLabel(defaultFlatLabel) {
|
||||
width: 180px;
|
||||
margin: margins(profileMemberPaddingLeft, 9px, profileMemberPaddingLeft, 6px);
|
||||
|
|
Loading…
Reference in New Issue