2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Fix compress images with drag-n-drop.

Fixes #8943.
This commit is contained in:
John Preston
2020-11-02 10:07:03 +03:00
parent 6660206e61
commit 39777f6149
2 changed files with 19 additions and 14 deletions

View File

@@ -924,6 +924,22 @@ void SendFilesBox::setInnerFocus() {
}
}
void SendFilesBox::saveSendWaySettings() {
auto way = _sendWay.current();
auto oldWay = Core::App().settings().sendFilesWay();
if (_groupFiles->isHidden()) {
way.setGroupFiles(oldWay.groupFiles());
}
if (_list.overrideSendImagesAsPhotos == way.sendImagesAsPhotos()
|| _sendImagesAsPhotos->isHidden()) {
way.setSendImagesAsPhotos(oldWay.sendImagesAsPhotos());
}
if (way != oldWay) {
Core::App().settings().setSendFilesWay(way);
Core::App().saveSettingsDelayed();
}
}
void SendFilesBox::send(
Api::SendOptions options,
bool ctrlShiftEnter) {
@@ -939,19 +955,7 @@ void SendFilesBox::send(
return;
}
auto way = _sendWay.current();
auto oldWay = Core::App().settings().sendFilesWay();
if (_groupFiles->isHidden()) {
way.setGroupFiles(oldWay.groupFiles());
}
if (_list.overrideSendImagesAsPhotos == way.sendImagesAsPhotos()
|| _sendImagesAsPhotos->isHidden()) {
way.setSendImagesAsPhotos(oldWay.sendImagesAsPhotos());
}
if (way != oldWay) {
Core::App().settings().setSendFilesWay(way);
Core::App().saveSettingsDelayed();
}
saveSendWaySettings();
for (auto &block : _blocks) {
block.applyAlbumOrder();
@@ -963,7 +967,7 @@ void SendFilesBox::send(
: TextWithTags();
_confirmedCallback(
std::move(_list),
way,
_sendWay.current(),
std::move(caption),
options,
ctrlShiftEnter);