diff --git a/Telegram/SourceFiles/media/player/media_player_widget.cpp b/Telegram/SourceFiles/media/player/media_player_widget.cpp index 5cb2d2687..86c9dce6e 100644 --- a/Telegram/SourceFiles/media/player/media_player_widget.cpp +++ b/Telegram/SourceFiles/media/player/media_player_widget.cpp @@ -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); diff --git a/Telegram/SourceFiles/ui/chat/chat_theme.cpp b/Telegram/SourceFiles/ui/chat/chat_theme.cpp index c8733eaf8..868c9a9a4 100644 --- a/Telegram/SourceFiles/ui/chat/chat_theme.cpp +++ b/Telegram/SourceFiles/ui/chat/chat_theme.cpp @@ -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, diff --git a/Telegram/SourceFiles/ui/countryinput.cpp b/Telegram/SourceFiles/ui/countryinput.cpp index be8fbabfb..2fe0f51a4 100644 --- a/Telegram/SourceFiles/ui/countryinput.cpp +++ b/Telegram/SourceFiles/ui/countryinput.cpp @@ -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, diff --git a/Telegram/SourceFiles/window/window_main_menu.cpp b/Telegram/SourceFiles/window/window_main_menu.cpp index 015089253..c4c080db1 100644 --- a/Telegram/SourceFiles/window/window_main_menu.cpp +++ b/Telegram/SourceFiles/window/window_main_menu.cpp @@ -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(