mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Version 4.15.1: Fix build with GCC.
This commit is contained in:
parent
3d5092f7ad
commit
990ae11f62
10 changed files with 3 additions and 59 deletions
|
@ -425,14 +425,9 @@ Ui::BoostCounters ParseBoostCounters(
|
||||||
}
|
}
|
||||||
|
|
||||||
Ui::BoostFeatures LookupBoostFeatures(not_null<ChannelData*> channel) {
|
Ui::BoostFeatures LookupBoostFeatures(not_null<ChannelData*> channel) {
|
||||||
const auto group = channel->isMegagroup();
|
|
||||||
const auto appConfig = &channel->session().account().appConfig();
|
|
||||||
const auto get = [&](const QString &key, int fallback, bool ok = true) {
|
|
||||||
return ok ? appConfig->get<int>(key, fallback) : 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
auto nameColorsByLevel = base::flat_map<int, int>();
|
auto nameColorsByLevel = base::flat_map<int, int>();
|
||||||
auto linkStylesByLevel = base::flat_map<int, int>();
|
auto linkStylesByLevel = base::flat_map<int, int>();
|
||||||
|
const auto group = channel->isMegagroup();
|
||||||
const auto peerColors = &channel->session().api().peerColors();
|
const auto peerColors = &channel->session().api().peerColors();
|
||||||
const auto &list = group
|
const auto &list = group
|
||||||
? peerColors->requiredLevelsGroup()
|
? peerColors->requiredLevelsGroup()
|
||||||
|
|
|
@ -262,7 +262,6 @@ void ShortcutMessages::scheduleShortcutsReload() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShortcutMessages::apply(const MTPDupdateNewQuickReply &update) {
|
void ShortcutMessages::apply(const MTPDupdateNewQuickReply &update) {
|
||||||
const auto selfId = _session->userPeerId();
|
|
||||||
const auto &reply = update.vquick_reply();
|
const auto &reply = update.vquick_reply();
|
||||||
auto foundId = BusinessShortcutId();
|
auto foundId = BusinessShortcutId();
|
||||||
const auto shortcut = parseShortcut(reply);
|
const auto shortcut = parseShortcut(reply);
|
||||||
|
|
|
@ -244,10 +244,8 @@ void Contact::draw(Painter &p, const PaintContext &context) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto st = context.st;
|
const auto st = context.st;
|
||||||
const auto sti = context.imageStyle();
|
|
||||||
const auto stm = context.messageStyle();
|
const auto stm = context.messageStyle();
|
||||||
|
|
||||||
const auto bubble = st::msgPadding;
|
|
||||||
const auto full = Rect(currentSize());
|
const auto full = Rect(currentSize());
|
||||||
const auto outer = full - inBubblePadding();
|
const auto outer = full - inBubblePadding();
|
||||||
const auto inner = outer - innerMargin();
|
const auto inner = outer - innerMargin();
|
||||||
|
@ -438,7 +436,6 @@ TextState Contact::textState(QPoint point, StateRequest request) const {
|
||||||
|
|
||||||
if (_buttons.size() > 1) {
|
if (_buttons.size() > 1) {
|
||||||
const auto end = rect::bottom(inner) + _st.padding.bottom();
|
const auto end = rect::bottom(inner) + _st.padding.bottom();
|
||||||
const auto line = st::historyPageButtonLine;
|
|
||||||
const auto bWidth = inner.width() / float64(_buttons.size());
|
const auto bWidth = inner.width() / float64(_buttons.size());
|
||||||
const auto bHeight = rect::bottom(outer) - end;
|
const auto bHeight = rect::bottom(outer) - end;
|
||||||
for (auto i = 0; i < _buttons.size(); i++) {
|
for (auto i = 0; i < _buttons.size(); i++) {
|
||||||
|
|
|
@ -167,12 +167,7 @@ Ui::RpWidget *ContentWidget::doSetInnerWidget(
|
||||||
const auto bottom = top + height;
|
const auto bottom = top + height;
|
||||||
_innerDesiredHeight = desired;
|
_innerDesiredHeight = desired;
|
||||||
_innerWrap->setVisibleTopBottom(top, bottom);
|
_innerWrap->setVisibleTopBottom(top, bottom);
|
||||||
LOG(("TOP: %1, HEIGHT: %2, DESIRED: %3, TILL: %4").arg(top).arg(height).arg(desired).arg(std::max(desired - bottom, 0)));
|
|
||||||
_scrollTillBottomChanges.fire_copy(std::max(desired - bottom, 0));
|
_scrollTillBottomChanges.fire_copy(std::max(desired - bottom, 0));
|
||||||
//const auto bottom = _scroll->scrollTop() + _scroll->height();
|
|
||||||
//_innerDesiredHeight = desired;
|
|
||||||
//_innerWrap->setVisibleTopBottom(_scroll->scrollTop(), bottom);
|
|
||||||
//_scrollTillBottomChanges.fire_copy(std::max(desired - bottom, 0));
|
|
||||||
}, _innerWrap->lifetime());
|
}, _innerWrap->lifetime());
|
||||||
|
|
||||||
return _innerWrap->entity();
|
return _innerWrap->entity();
|
||||||
|
|
|
@ -138,7 +138,6 @@ void LayerWidget::setContentHeight(int height) {
|
||||||
if (_contentWrapHeight == height) {
|
if (_contentWrapHeight == height) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOG(("CONTENT WRAP HEIGHT: %1 -> %2").arg(_contentWrapHeight).arg(height));
|
|
||||||
_contentWrapHeight = height;
|
_contentWrapHeight = height;
|
||||||
if (_inResize) {
|
if (_inResize) {
|
||||||
_pendingResize = true;
|
_pendingResize = true;
|
||||||
|
@ -261,35 +260,6 @@ int LayerWidget::resizeGetHeight(int newWidth) {
|
||||||
auto attempts = 0;
|
auto attempts = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
_inResize = true;
|
_inResize = true;
|
||||||
{
|
|
||||||
const auto &parentSize = parentWidget()->size();
|
|
||||||
const auto windowWidth = parentSize.width();
|
|
||||||
const auto windowHeight = parentSize.height();
|
|
||||||
const auto newLeft = (windowWidth - newWidth) / 2;
|
|
||||||
const auto newTop = std::clamp(
|
|
||||||
windowHeight / 24,
|
|
||||||
st::infoLayerTopMinimal,
|
|
||||||
st::infoLayerTopMaximal);
|
|
||||||
const auto newBottom = newTop;
|
|
||||||
|
|
||||||
const auto bottomRadius = st::boxRadius;
|
|
||||||
const auto maxVisibleHeight = windowHeight - newTop;
|
|
||||||
// Top rounding is included in _contentWrapHeight.
|
|
||||||
auto desiredHeight = _contentWrapHeight + bottomRadius;
|
|
||||||
accumulate_min(desiredHeight, maxVisibleHeight - newBottom);
|
|
||||||
|
|
||||||
// First resize content to new width and get the new desired height.
|
|
||||||
const auto contentLeft = 0;
|
|
||||||
const auto contentTop = 0;
|
|
||||||
const auto contentBottom = bottomRadius;
|
|
||||||
const auto contentWidth = newWidth;
|
|
||||||
auto contentHeight = desiredHeight - contentTop - contentBottom;
|
|
||||||
LOG(("ATTEMPT %1: WIDTH %2, WRAP HEIGHT %3, SCROLL TILL BOTTOM: %4"
|
|
||||||
).arg(attempts + 1
|
|
||||||
).arg(newWidth
|
|
||||||
).arg(_contentWrapHeight
|
|
||||||
).arg(_contentWrap->scrollTillBottom(contentHeight)));
|
|
||||||
}
|
|
||||||
const auto newGeometry = countGeometry(newWidth);
|
const auto newGeometry = countGeometry(newWidth);
|
||||||
_inResize = false;
|
_inResize = false;
|
||||||
if (!_pendingResize) {
|
if (!_pendingResize) {
|
||||||
|
|
|
@ -479,7 +479,6 @@ void Chatbots::setupContent(
|
||||||
|
|
||||||
void Chatbots::save() {
|
void Chatbots::save() {
|
||||||
const auto show = controller()->uiShow();
|
const auto show = controller()->uiShow();
|
||||||
const auto session = &controller()->session();
|
|
||||||
const auto fail = [=](QString error) {
|
const auto fail = [=](QString error) {
|
||||||
if (error == u"BUSINESS_RECIPIENTS_EMPTY"_q) {
|
if (error == u"BUSINESS_RECIPIENTS_EMPTY"_q) {
|
||||||
show->showToast(tr::lng_greeting_recipients_empty(tr::now));
|
show->showToast(tr::lng_greeting_recipients_empty(tr::now));
|
||||||
|
|
|
@ -130,7 +130,6 @@ void QuickReplies::setupContent(
|
||||||
auto old = inner->count();
|
auto old = inner->count();
|
||||||
|
|
||||||
const auto &shortcuts = messages->shortcuts();
|
const auto &shortcuts = messages->shortcuts();
|
||||||
auto i = 0;
|
|
||||||
for (const auto &[_, shortcut]
|
for (const auto &[_, shortcut]
|
||||||
: shortcuts.list | ranges::views::reverse) {
|
: shortcuts.list | ranges::views::reverse) {
|
||||||
if (!shortcut.count) {
|
if (!shortcut.count) {
|
||||||
|
|
|
@ -171,7 +171,7 @@ void AddBusinessRecipientsSelector(
|
||||||
const auto all = current.allButExcluded || current.included.empty();
|
const auto all = current.allButExcluded || current.included.empty();
|
||||||
const auto group = std::make_shared<Ui::RadiobuttonGroup>(
|
const auto group = std::make_shared<Ui::RadiobuttonGroup>(
|
||||||
all ? kAllExcept : kSelectedOnly);
|
all ? kAllExcept : kSelectedOnly);
|
||||||
const auto everyone = container->add(
|
container->add(
|
||||||
object_ptr<Ui::Radiobutton>(
|
object_ptr<Ui::Radiobutton>(
|
||||||
container,
|
container,
|
||||||
group,
|
group,
|
||||||
|
@ -179,7 +179,7 @@ void AddBusinessRecipientsSelector(
|
||||||
tr::lng_chatbots_all_except(tr::now),
|
tr::lng_chatbots_all_except(tr::now),
|
||||||
st::settingsChatbotsAccess),
|
st::settingsChatbotsAccess),
|
||||||
st::settingsChatbotsAccessMargins);
|
st::settingsChatbotsAccessMargins);
|
||||||
const auto selected = container->add(
|
container->add(
|
||||||
object_ptr<Ui::Radiobutton>(
|
object_ptr<Ui::Radiobutton>(
|
||||||
container,
|
container,
|
||||||
group,
|
group,
|
||||||
|
|
|
@ -181,7 +181,6 @@ private:
|
||||||
void processScroll();
|
void processScroll();
|
||||||
void updateInnerVisibleArea();
|
void updateInnerVisibleArea();
|
||||||
|
|
||||||
void pushReplyReturn(not_null<HistoryItem*> item);
|
|
||||||
void checkReplyReturns();
|
void checkReplyReturns();
|
||||||
void confirmDeleteSelected();
|
void confirmDeleteSelected();
|
||||||
void clearSelected();
|
void clearSelected();
|
||||||
|
@ -565,7 +564,6 @@ bool ShortcutMessages::paintOuter(
|
||||||
not_null<QWidget*> outer,
|
not_null<QWidget*> outer,
|
||||||
int maxVisibleHeight,
|
int maxVisibleHeight,
|
||||||
QRect clip) {
|
QRect clip) {
|
||||||
const auto window = outer->window()->height();
|
|
||||||
Window::SectionWidget::PaintBackground(
|
Window::SectionWidget::PaintBackground(
|
||||||
_theme.get(),
|
_theme.get(),
|
||||||
outer,
|
outer,
|
||||||
|
@ -1092,12 +1090,6 @@ bool ShortcutMessages::cornerButtonsHas(CornerButtonType type) {
|
||||||
return (type == CornerButtonType::Down);
|
return (type == CornerButtonType::Down);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShortcutMessages::pushReplyReturn(not_null<HistoryItem*> item) {
|
|
||||||
if (item->shortcutId() == _shortcutId.current()) {
|
|
||||||
_cornerButtons.pushReplyReturn(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShortcutMessages::checkReplyReturns() {
|
void ShortcutMessages::checkReplyReturns() {
|
||||||
const auto currentTop = _scroll->scrollTop();
|
const auto currentTop = _scroll->scrollTop();
|
||||||
const auto shortcutId = _shortcutId.current();
|
const auto shortcutId = _shortcutId.current();
|
||||||
|
|
|
@ -60,7 +60,6 @@ private:
|
||||||
const auto abs = std::abs(data.utcOffset);
|
const auto abs = std::abs(data.utcOffset);
|
||||||
const auto hours = abs / 3600;
|
const auto hours = abs / 3600;
|
||||||
const auto minutes = (abs % 3600) / 60;
|
const auto minutes = (abs % 3600) / 60;
|
||||||
const auto seconds = abs % 60;
|
|
||||||
const auto sign = (data.utcOffset < 0) ? '-' : '+';
|
const auto sign = (data.utcOffset < 0) ? '-' : '+';
|
||||||
const auto prefix = u"(UTC"_q
|
const auto prefix = u"(UTC"_q
|
||||||
+ sign
|
+ sign
|
||||||
|
@ -366,7 +365,6 @@ void EditDayBox(
|
||||||
const auto from = std::max(
|
const auto from = std::max(
|
||||||
std::min(last + 30 * 60, kDay - 30 * 60),
|
std::min(last + 30 * 60, kDay - 30 * 60),
|
||||||
last + 60);
|
last + 60);
|
||||||
const auto till = std::min(from + 4 * 3600, kDay + 30 * 60);
|
|
||||||
now.list.push_back({ from, from + 4 * 3600 });
|
now.list.push_back({ from, from + 4 * 3600 });
|
||||||
}
|
}
|
||||||
state->data = std::move(now);
|
state->data = std::move(now);
|
||||||
|
|
Loading…
Add table
Reference in a new issue