2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 06:55:58 +00:00

Show empty search results in emoji panel.

This commit is contained in:
John Preston
2023-02-09 12:55:44 +04:00
parent cbd9dd0c2c
commit 8f908ab9c0
8 changed files with 56 additions and 21 deletions

View File

@@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/layers/box_content.h"
#include "ui/image/image_prepare.h"
#include "ui/cached_round_corners.h"
#include "ui/painter.h"
#include "window/window_session_controller.h"
#include "main/main_session.h"
#include "main/main_session_settings.h"
@@ -1283,6 +1284,30 @@ void TabbedSelector::Inner::checkHideWithBox(QPointer<Ui::BoxContent> box) {
});
}
void TabbedSelector::Inner::paintEmptySearchResults(
Painter &p,
const style::icon &icon,
const QString &text) const {
const auto iconLeft = (width() - icon.width()) / 2;
const auto iconTop = std::max(
(height() / 3) - (icon.height() / 2),
st::normalFont->height);
icon.paint(p, iconLeft, iconTop, width());
const auto textWidth = st::normalFont->width(text);
const auto textTop = std::min(
iconTop + icon.height() - st::normalFont->height,
height() - 2 * st::normalFont->height);
p.setFont(st::normalFont);
p.setPen(st::windowSubTextFg);
p.drawTextLeft(
(width() - textWidth) / 2,
textTop,
width(),
text,
textWidth);
}
void TabbedSelector::Inner::visibleTopBottomUpdated(
int visibleTop,
int visibleBottom) {