mirror of https://github.com/procxx/kepka.git
Fixed build for Windows with c++latest.
This commit is contained in:
parent
5f5d5629f8
commit
b4fbff0b6c
|
@ -435,7 +435,9 @@ void EmojiKeywords::LangPack::applyDifference(
|
||||||
LangPackData &&result) {
|
LangPackData &&result) {
|
||||||
applyData(std::move(result));
|
applyData(std::move(result));
|
||||||
});
|
});
|
||||||
crl::async([=, callback = std::move(callback)]() mutable {
|
crl::async([=,
|
||||||
|
copy = std::move(copy),
|
||||||
|
callback = std::move(callback)]() mutable {
|
||||||
ApplyDifference(copy, keywords, version);
|
ApplyDifference(copy, keywords, version);
|
||||||
WriteLocalCache(id, copy);
|
WriteLocalCache(id, copy);
|
||||||
crl::on_main([
|
crl::on_main([
|
||||||
|
|
|
@ -45,7 +45,6 @@ enum {
|
||||||
|
|
||||||
StickerMaxSize = 2048, // 2048x2048 is a max image size for sticker
|
StickerMaxSize = 2048, // 2048x2048 is a max image size for sticker
|
||||||
|
|
||||||
MaxZoomLevel = 7, // x8
|
|
||||||
ZoomToScreenLevel = 1024, // just constant
|
ZoomToScreenLevel = 1024, // just constant
|
||||||
|
|
||||||
PreloadHeightsCount = 3, // when 3 screens to scroll left make a preload request
|
PreloadHeightsCount = 3, // when 3 screens to scroll left make a preload request
|
||||||
|
|
|
@ -68,6 +68,7 @@ namespace View {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr auto kPreloadCount = 4;
|
constexpr auto kPreloadCount = 4;
|
||||||
|
constexpr auto kMaxZoomLevel = 7; // x8
|
||||||
|
|
||||||
constexpr auto kOverlayLoaderPriority = 2;
|
constexpr auto kOverlayLoaderPriority = 2;
|
||||||
|
|
||||||
|
@ -897,13 +898,13 @@ bool OverlayWidget::radialAnimationCallback(crl::time now) {
|
||||||
void OverlayWidget::zoomIn() {
|
void OverlayWidget::zoomIn() {
|
||||||
int32 newZoom = _zoom;
|
int32 newZoom = _zoom;
|
||||||
if (newZoom == ZoomToScreenLevel) {
|
if (newZoom == ZoomToScreenLevel) {
|
||||||
if (qCeil(_zoomToScreen) <= MaxZoomLevel) {
|
if (qCeil(_zoomToScreen) <= kMaxZoomLevel) {
|
||||||
newZoom = qCeil(_zoomToScreen);
|
newZoom = qCeil(_zoomToScreen);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (newZoom < _zoomToScreen && (newZoom + 1 > _zoomToScreen || (_zoomToScreen > MaxZoomLevel && newZoom == MaxZoomLevel))) {
|
if (newZoom < _zoomToScreen && (newZoom + 1 > _zoomToScreen || (_zoomToScreen > kMaxZoomLevel && newZoom == kMaxZoomLevel))) {
|
||||||
newZoom = ZoomToScreenLevel;
|
newZoom = ZoomToScreenLevel;
|
||||||
} else if (newZoom < MaxZoomLevel) {
|
} else if (newZoom < kMaxZoomLevel) {
|
||||||
++newZoom;
|
++newZoom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -913,13 +914,13 @@ void OverlayWidget::zoomIn() {
|
||||||
void OverlayWidget::zoomOut() {
|
void OverlayWidget::zoomOut() {
|
||||||
int32 newZoom = _zoom;
|
int32 newZoom = _zoom;
|
||||||
if (newZoom == ZoomToScreenLevel) {
|
if (newZoom == ZoomToScreenLevel) {
|
||||||
if (qFloor(_zoomToScreen) >= -MaxZoomLevel) {
|
if (qFloor(_zoomToScreen) >= -kMaxZoomLevel) {
|
||||||
newZoom = qFloor(_zoomToScreen);
|
newZoom = qFloor(_zoomToScreen);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (newZoom > _zoomToScreen && (newZoom - 1 < _zoomToScreen || (_zoomToScreen < -MaxZoomLevel && newZoom == -MaxZoomLevel))) {
|
if (newZoom > _zoomToScreen && (newZoom - 1 < _zoomToScreen || (_zoomToScreen < -kMaxZoomLevel && newZoom == -kMaxZoomLevel))) {
|
||||||
newZoom = ZoomToScreenLevel;
|
newZoom = ZoomToScreenLevel;
|
||||||
} else if (newZoom > -MaxZoomLevel) {
|
} else if (newZoom > -kMaxZoomLevel) {
|
||||||
--newZoom;
|
--newZoom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -929,7 +930,7 @@ void OverlayWidget::zoomOut() {
|
||||||
void OverlayWidget::zoomReset() {
|
void OverlayWidget::zoomReset() {
|
||||||
int32 newZoom = _zoom;
|
int32 newZoom = _zoom;
|
||||||
if (_zoom == 0) {
|
if (_zoom == 0) {
|
||||||
if (qFloor(_zoomToScreen) == qCeil(_zoomToScreen) && qRound(_zoomToScreen) >= -MaxZoomLevel && qRound(_zoomToScreen) <= MaxZoomLevel) {
|
if (qFloor(_zoomToScreen) == qCeil(_zoomToScreen) && qRound(_zoomToScreen) >= -kMaxZoomLevel && qRound(_zoomToScreen) <= kMaxZoomLevel) {
|
||||||
newZoom = qRound(_zoomToScreen);
|
newZoom = qRound(_zoomToScreen);
|
||||||
} else {
|
} else {
|
||||||
newZoom = ZoomToScreenLevel;
|
newZoom = ZoomToScreenLevel;
|
||||||
|
|
|
@ -61,7 +61,7 @@ void Calls::sectionSaveChanges(FnMut<void()> done) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Calls::setupContent(not_null<Window::SessionController*> controller) {
|
void Calls::setupContent(not_null<Window::SessionController*> controller) {
|
||||||
using namespace tgvoip;
|
using VoIP = tgvoip::VoIPController;
|
||||||
|
|
||||||
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
||||||
const auto getId = [](const auto &device) {
|
const auto getId = [](const auto &device) {
|
||||||
|
@ -75,7 +75,7 @@ void Calls::setupContent(not_null<Window::SessionController*> controller) {
|
||||||
if (Global::CallOutputDeviceID() == qsl("default")) {
|
if (Global::CallOutputDeviceID() == qsl("default")) {
|
||||||
return tr::lng_settings_call_device_default(tr::now);
|
return tr::lng_settings_call_device_default(tr::now);
|
||||||
}
|
}
|
||||||
const auto &list = VoIPController::EnumerateAudioOutputs();
|
const auto &list = VoIP::EnumerateAudioOutputs();
|
||||||
const auto i = ranges::find(
|
const auto i = ranges::find(
|
||||||
list,
|
list,
|
||||||
Global::CallOutputDeviceID(),
|
Global::CallOutputDeviceID(),
|
||||||
|
@ -89,7 +89,7 @@ void Calls::setupContent(not_null<Window::SessionController*> controller) {
|
||||||
if (Global::CallInputDeviceID() == qsl("default")) {
|
if (Global::CallInputDeviceID() == qsl("default")) {
|
||||||
return tr::lng_settings_call_device_default(tr::now);
|
return tr::lng_settings_call_device_default(tr::now);
|
||||||
}
|
}
|
||||||
const auto &list = VoIPController::EnumerateAudioInputs();
|
const auto &list = VoIP::EnumerateAudioInputs();
|
||||||
const auto i = ranges::find(
|
const auto i = ranges::find(
|
||||||
list,
|
list,
|
||||||
Global::CallInputDeviceID(),
|
Global::CallInputDeviceID(),
|
||||||
|
@ -111,7 +111,7 @@ void Calls::setupContent(not_null<Window::SessionController*> controller) {
|
||||||
),
|
),
|
||||||
st::settingsButton
|
st::settingsButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
const auto &devices = VoIPController::EnumerateAudioOutputs();
|
const auto &devices = VoIP::EnumerateAudioOutputs();
|
||||||
const auto options = ranges::view::concat(
|
const auto options = ranges::view::concat(
|
||||||
ranges::view::single(tr::lng_settings_call_device_default(tr::now)),
|
ranges::view::single(tr::lng_settings_call_device_default(tr::now)),
|
||||||
devices | ranges::view::transform(getName)
|
devices | ranges::view::transform(getName)
|
||||||
|
@ -186,7 +186,7 @@ void Calls::setupContent(not_null<Window::SessionController*> controller) {
|
||||||
),
|
),
|
||||||
st::settingsButton
|
st::settingsButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
const auto &devices = VoIPController::EnumerateAudioInputs();
|
const auto &devices = VoIP::EnumerateAudioInputs();
|
||||||
const auto options = ranges::view::concat(
|
const auto options = ranges::view::concat(
|
||||||
ranges::view::single(tr::lng_settings_call_device_default(tr::now)),
|
ranges::view::single(tr::lng_settings_call_device_default(tr::now)),
|
||||||
devices | ranges::view::transform(getName)
|
devices | ranges::view::transform(getName)
|
||||||
|
|
Loading…
Reference in New Issue