mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-25 04:38:23 +00:00
Fix build with GCC.
This commit is contained in:
parent
4582d2d0d5
commit
8f9e394dd0
@ -192,7 +192,7 @@ void Widget::SpeedButton::contextMenuEvent(QContextMenuEvent *e) {
|
||||
if (text.isEmpty()) {
|
||||
text = QString::number(speed);
|
||||
}
|
||||
const auto action = _menu->addAction(
|
||||
_menu->addAction(
|
||||
text,
|
||||
[=] { setPlaybackSpeed(speed); },
|
||||
(speed == currentSpeed) ? &st::mediaPlayerMenuCheck : nullptr);
|
||||
|
@ -302,11 +302,11 @@ void ChatTheme::adjustPalette(const ChatThemeDescriptor &descriptor) {
|
||||
}
|
||||
return result;
|
||||
};
|
||||
const auto singleWithBg = [&](const QColor &c) {
|
||||
return withBg([&](const QColor &with) {
|
||||
return CountContrast(c, with);
|
||||
});
|
||||
};
|
||||
//const auto singleWithBg = [&](const QColor &c) {
|
||||
// return withBg([&](const QColor &with) {
|
||||
// return CountContrast(c, with);
|
||||
// });
|
||||
//};
|
||||
if (withBg(minimal) < kMinAcceptableContrast) {
|
||||
const auto white = QColor(255, 255, 255);
|
||||
const auto black = QColor(0, 0, 0);
|
||||
@ -875,7 +875,6 @@ ChatThemeBackground PrepareBackgroundImage(
|
||||
: QImage();
|
||||
if (data.isPattern && !prepared.isNull()) {
|
||||
if (data.colors.size() < 2) {
|
||||
const auto gradientRotation = 0; // No gradient here.
|
||||
prepared = PreparePatternImage(
|
||||
std::move(prepared),
|
||||
data.colors,
|
||||
|
@ -122,7 +122,6 @@ void CountryInput::mousePressEvent(QMouseEvent *e) {
|
||||
}
|
||||
|
||||
const auto &list = Countries::Instance().list();
|
||||
auto index = 0;
|
||||
const auto infoIt = ranges::find(
|
||||
list,
|
||||
entry.iso2,
|
||||
|
@ -991,23 +991,15 @@ void MainMenu::refreshBackground() {
|
||||
const auto fill = QSize(st::mainMenuWidth, st::mainMenuCoverHeight);
|
||||
const auto intensityText = IntensityOfColor(st::mainMenuCoverFg->c);
|
||||
const auto background = Window::Theme::Background();
|
||||
const auto &paper = background->paper();
|
||||
const auto &prepared = background->prepared();
|
||||
|
||||
const auto rects = Ui::ComputeChatBackgroundRects(
|
||||
fill,
|
||||
prepared.size());
|
||||
|
||||
auto backgroundImage = /*paper.isPattern()
|
||||
? Ui::GenerateBackgroundImage(
|
||||
fill * cIntRetinaFactor(),
|
||||
paper.backgroundColors(),
|
||||
paper.gradientRotation(),
|
||||
paper.patternOpacity(),
|
||||
[&](QPainter &p) { p.drawImage(rects.to, prepared, rects.from); })
|
||||
: */QImage(
|
||||
fill * cIntRetinaFactor(),
|
||||
QImage::Format_ARGB32_Premultiplied);
|
||||
auto backgroundImage = QImage(
|
||||
fill * cIntRetinaFactor(),
|
||||
QImage::Format_ARGB32_Premultiplied);
|
||||
QPainter p(&backgroundImage);
|
||||
|
||||
const auto drawShadow = [](QPainter &p) {
|
||||
@ -1021,21 +1013,8 @@ void MainMenu::refreshBackground() {
|
||||
: Qt::black);
|
||||
};
|
||||
|
||||
// Solid color.
|
||||
//if (const auto color = background->colorForFill()) {
|
||||
// const auto intensity = IntensityOfColor(*color);
|
||||
// p.fillRect(QRect(QPoint(), fill), *color);
|
||||
// if (std::abs(intensity - intensityText) < kMinDiffIntensity) {
|
||||
// drawShadow(p);
|
||||
// }
|
||||
// _background = backgroundImage;
|
||||
// return;
|
||||
//}
|
||||
|
||||
// Background image.
|
||||
//if (!paper.isPattern()) {
|
||||
p.drawImage(rects.to, prepared, rects.from);
|
||||
//}
|
||||
p.drawImage(rects.to, prepared, rects.from);
|
||||
|
||||
// Cut off the part of the background that is under text.
|
||||
const QRect underText(
|
||||
|
Loading…
Reference in New Issue
Block a user