mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
parent
f9173ea849
commit
4074a558e7
11 changed files with 90 additions and 90 deletions
|
@ -206,12 +206,30 @@ dialogsSearchForNarrowFilters: IconButton(dialogsMenuToggle) {
|
||||||
}
|
}
|
||||||
dialogsSearchFromPadding: margins(10px, 10px, 10px, 10px);
|
dialogsSearchFromPadding: margins(10px, 10px, 10px, 10px);
|
||||||
|
|
||||||
dialogsFilter: FlatInput(defaultFlatInput) {
|
dialogsFilter: InputField(defaultInputField) {
|
||||||
font: font(fsize);
|
textBg: filterInputInactiveBg;
|
||||||
|
textBgActive: filterInputActiveBg;
|
||||||
|
textMargins: margins(12px, 7px, 30px, 3px);
|
||||||
|
|
||||||
width: 240px;
|
placeholderFg: placeholderFg;
|
||||||
height: 32px;
|
placeholderFgActive: placeholderFgActive;
|
||||||
textMrg: margins(12px, 3px, 30px, 3px);
|
placeholderFgError: placeholderFgActive;
|
||||||
|
placeholderMargins: margins(2px, 0px, 2px, 0px);
|
||||||
|
placeholderScale: 0.;
|
||||||
|
placeholderShift: -50px;
|
||||||
|
placeholderFont: normalFont;
|
||||||
|
|
||||||
|
borderFg: filterInputInactiveBg;
|
||||||
|
borderFgActive: filterInputBorderFg;
|
||||||
|
borderFgError: activeLineFgError;
|
||||||
|
|
||||||
|
border: 2px;
|
||||||
|
borderActive: 2px;
|
||||||
|
borderRadius: roundRadiusSmall;
|
||||||
|
|
||||||
|
font: normalFont;
|
||||||
|
|
||||||
|
heightMin: 32px;
|
||||||
}
|
}
|
||||||
dialogsCancelSearchInPeer: IconButton(dialogsMenuToggle) {
|
dialogsCancelSearchInPeer: IconButton(dialogsMenuToggle) {
|
||||||
icon: icon {{ "dialogs/dialogs_cancel_search", dialogsMenuIconFg }};
|
icon: icon {{ "dialogs/dialogs_cancel_search", dialogsMenuIconFg }};
|
||||||
|
|
|
@ -290,16 +290,16 @@ Widget::Widget(
|
||||||
Ui::PostponeCall(this, [=] { listScrollUpdated(); });
|
Ui::PostponeCall(this, [=] { listScrollUpdated(); });
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
QObject::connect(_filter, &Ui::FlatInput::cancelled, [=] {
|
QObject::connect(_filter, &Ui::InputField::cancelled, [=] {
|
||||||
escape();
|
escape();
|
||||||
});
|
});
|
||||||
QObject::connect(_filter, &Ui::FlatInput::changed, [=] {
|
QObject::connect(_filter, &Ui::InputField::changed, [=] {
|
||||||
applyFilterUpdate();
|
applyFilterUpdate();
|
||||||
});
|
});
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
_filter,
|
_filter->rawTextEdit().get(),
|
||||||
&Ui::FlatInput::cursorPositionChanged,
|
&QTextEdit::cursorPositionChanged,
|
||||||
[=](int from, int to) { filterCursorMoved(from, to); });
|
[=] { filterCursorMoved(); });
|
||||||
|
|
||||||
if (!Core::UpdaterDisabled()) {
|
if (!Core::UpdaterDisabled()) {
|
||||||
Core::UpdateChecker checker;
|
Core::UpdateChecker checker;
|
||||||
|
@ -647,7 +647,7 @@ void Widget::updateControlsVisibility(bool fast) {
|
||||||
} else {
|
} else {
|
||||||
if (hasFocus()) {
|
if (hasFocus()) {
|
||||||
_filter->setFocus();
|
_filter->setFocus();
|
||||||
_filter->finishAnimations();
|
_filter->finishAnimating();
|
||||||
}
|
}
|
||||||
updateLockUnlockVisibility();
|
updateLockUnlockVisibility();
|
||||||
updateJumpToDateVisibility(fast);
|
updateJumpToDateVisibility(fast);
|
||||||
|
@ -1159,7 +1159,6 @@ void Widget::searchMessages(
|
||||||
setSearchInChat(inChat);
|
setSearchInChat(inChat);
|
||||||
}
|
}
|
||||||
_filter->setText(query);
|
_filter->setText(query);
|
||||||
_filter->updatePlaceholder();
|
|
||||||
applyFilterUpdate(true);
|
applyFilterUpdate(true);
|
||||||
_searchTimer.cancel();
|
_searchTimer.cancel();
|
||||||
searchMessages();
|
searchMessages();
|
||||||
|
@ -1649,29 +1648,35 @@ void Widget::showSearchFrom() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::filterCursorMoved(int from, int to) {
|
void Widget::filterCursorMoved() {
|
||||||
if (to < 0) to = _filter->cursorPosition();
|
const auto to = _filter->textCursor().position();
|
||||||
QString t = _filter->getLastText();
|
const auto text = _filter->getLastText();
|
||||||
QStringView r;
|
auto hashtag = QStringView();
|
||||||
for (int start = to; start > 0;) {
|
for (int start = to; start > 0;) {
|
||||||
--start;
|
--start;
|
||||||
if (t.size() <= start) break;
|
if (text.size() <= start) {
|
||||||
if (t.at(start) == '#') {
|
break;
|
||||||
r = base::StringViewMid(t, start, to - start);
|
}
|
||||||
|
const auto ch = text[start];
|
||||||
|
if (ch == '#') {
|
||||||
|
hashtag = base::StringViewMid(text, start, to - start);
|
||||||
|
break;
|
||||||
|
} else if (!ch.isLetterOrNumber() && ch != '_') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!t.at(start).isLetterOrNumber() && t.at(start) != '_') break;
|
|
||||||
}
|
}
|
||||||
_inner->onHashtagFilterUpdate(r);
|
_inner->onHashtagFilterUpdate(hashtag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::completeHashtag(QString tag) {
|
void Widget::completeHashtag(QString tag) {
|
||||||
QString t = _filter->getLastText(), r;
|
const auto t = _filter->getLastText();;
|
||||||
int cur = _filter->cursorPosition();
|
auto cur = _filter->textCursor().position();
|
||||||
|
auto hashtag = QString();
|
||||||
for (int start = cur; start > 0;) {
|
for (int start = cur; start > 0;) {
|
||||||
--start;
|
--start;
|
||||||
if (t.size() <= start) break;
|
if (t.size() <= start) {
|
||||||
if (t.at(start) == '#') {
|
break;
|
||||||
|
} else if (t.at(start) == '#') {
|
||||||
if (cur == start + 1
|
if (cur == start + 1
|
||||||
|| base::StringViewMid(t, start + 1, cur - start - 1)
|
|| base::StringViewMid(t, start + 1, cur - start - 1)
|
||||||
== base::StringViewMid(tag, 0, cur - start - 1)) {
|
== base::StringViewMid(tag, 0, cur - start - 1)) {
|
||||||
|
@ -1679,15 +1684,16 @@ void Widget::completeHashtag(QString tag) {
|
||||||
if (t.at(cur) != tag.at(cur - start - 1)) break;
|
if (t.at(cur) != tag.at(cur - start - 1)) break;
|
||||||
}
|
}
|
||||||
if (cur - start - 1 == tag.size() && cur < t.size() && t.at(cur) == ' ') ++cur;
|
if (cur - start - 1 == tag.size() && cur < t.size() && t.at(cur) == ' ') ++cur;
|
||||||
r = t.mid(0, start + 1) + tag + ' ' + t.mid(cur);
|
hashtag = t.mid(0, start + 1) + tag + ' ' + t.mid(cur);
|
||||||
_filter->setText(r);
|
_filter->setText(hashtag);
|
||||||
_filter->setCursorPosition(start + 1 + tag.size() + 1);
|
_filter->setCursorPosition(start + 1 + tag.size() + 1);
|
||||||
applyFilterUpdate(true);
|
applyFilterUpdate(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
} else if (!t.at(start).isLetterOrNumber() && t.at(start) != '_') {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (!t.at(start).isLetterOrNumber() && t.at(start) != '_') break;
|
|
||||||
}
|
}
|
||||||
_filter->setText(t.mid(0, cur) + '#' + tag + ' ' + t.mid(cur));
|
_filter->setText(t.mid(0, cur) + '#' + tag + ' ' + t.mid(cur));
|
||||||
_filter->setCursorPosition(cur + 1 + tag.size() + 1);
|
_filter->setCursorPosition(cur + 1 + tag.size() + 1);
|
||||||
|
@ -1744,11 +1750,11 @@ void Widget::updateSearchFromVisibility(bool fast) {
|
||||||
visible,
|
visible,
|
||||||
fast ? anim::type::instant : anim::type::normal);
|
fast ? anim::type::instant : anim::type::normal);
|
||||||
if (changed) {
|
if (changed) {
|
||||||
auto margins = st::dialogsFilter.textMrg;
|
auto additional = QMargins();
|
||||||
if (visible) {
|
if (visible) {
|
||||||
margins.setRight(margins.right() + _chooseFromUser->width());
|
additional.setRight(_chooseFromUser->width());
|
||||||
}
|
}
|
||||||
_filter->setTextMrg(margins);
|
_filter->setAdditionalMargins(additional);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1973,7 +1979,6 @@ bool Widget::cancelSearch() {
|
||||||
}
|
}
|
||||||
_inner->clearFilter();
|
_inner->clearFilter();
|
||||||
_filter->clear();
|
_filter->clear();
|
||||||
_filter->updatePlaceholder();
|
|
||||||
applyFilterUpdate();
|
applyFilterUpdate();
|
||||||
return clearing;
|
return clearing;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ class IconButton;
|
||||||
class PopupMenu;
|
class PopupMenu;
|
||||||
class DropdownMenu;
|
class DropdownMenu;
|
||||||
class FlatButton;
|
class FlatButton;
|
||||||
class FlatInput;
|
class InputField;
|
||||||
class CrossButton;
|
class CrossButton;
|
||||||
class DownloadBar;
|
class DownloadBar;
|
||||||
template <typename Widget>
|
template <typename Widget>
|
||||||
|
@ -119,7 +119,7 @@ private:
|
||||||
void chosenRow(const ChosenRow &row);
|
void chosenRow(const ChosenRow &row);
|
||||||
void listScrollUpdated();
|
void listScrollUpdated();
|
||||||
void cancelSearchInChat();
|
void cancelSearchInChat();
|
||||||
void filterCursorMoved(int from = -1, int to = -1);
|
void filterCursorMoved();
|
||||||
void completeHashtag(QString tag);
|
void completeHashtag(QString tag);
|
||||||
|
|
||||||
bool searchMessages(bool searchCache = false);
|
bool searchMessages(bool searchCache = false);
|
||||||
|
@ -191,7 +191,7 @@ private:
|
||||||
object_ptr<HistoryView::TopBarWidget> _folderTopBar = { nullptr } ;
|
object_ptr<HistoryView::TopBarWidget> _folderTopBar = { nullptr } ;
|
||||||
object_ptr<Ui::IconButton> _mainMenuToggle;
|
object_ptr<Ui::IconButton> _mainMenuToggle;
|
||||||
object_ptr<Ui::IconButton> _searchForNarrowFilters;
|
object_ptr<Ui::IconButton> _searchForNarrowFilters;
|
||||||
object_ptr<Ui::FlatInput> _filter;
|
object_ptr<Ui::InputField> _filter;
|
||||||
object_ptr<Ui::FadeWrapScaled<Ui::IconButton>> _chooseFromUser;
|
object_ptr<Ui::FadeWrapScaled<Ui::IconButton>> _chooseFromUser;
|
||||||
object_ptr<Ui::FadeWrapScaled<Ui::IconButton>> _jumpToDate;
|
object_ptr<Ui::FadeWrapScaled<Ui::IconButton>> _jumpToDate;
|
||||||
object_ptr<Ui::CrossButton> _cancelSearch;
|
object_ptr<Ui::CrossButton> _cancelSearch;
|
||||||
|
|
|
@ -75,7 +75,7 @@ private:
|
||||||
|
|
||||||
not_null<Window::SessionController*> _controller;
|
not_null<Window::SessionController*> _controller;
|
||||||
not_null<ChannelData*> _channel;
|
not_null<ChannelData*> _channel;
|
||||||
object_ptr<Ui::FlatInput> _field;
|
object_ptr<Ui::InputField> _field;
|
||||||
object_ptr<Profile::BackButton> _backButton;
|
object_ptr<Profile::BackButton> _backButton;
|
||||||
object_ptr<Ui::IconButton> _search;
|
object_ptr<Ui::IconButton> _search;
|
||||||
object_ptr<Ui::CrossButton> _cancel;
|
object_ptr<Ui::CrossButton> _cancel;
|
||||||
|
@ -110,7 +110,7 @@ FixedBar::FixedBar(
|
||||||
not_null<ChannelData*> channel) : TWidget(parent)
|
not_null<ChannelData*> channel) : TWidget(parent)
|
||||||
, _controller(controller)
|
, _controller(controller)
|
||||||
, _channel(channel)
|
, _channel(channel)
|
||||||
, _field(this, st::historyAdminLogSearchField, tr::lng_dlg_filter())
|
, _field(this, st::defaultMultiSelectSearchField, tr::lng_dlg_filter())
|
||||||
, _backButton(
|
, _backButton(
|
||||||
this,
|
this,
|
||||||
&controller->session(),
|
&controller->session(),
|
||||||
|
@ -125,9 +125,9 @@ FixedBar::FixedBar(
|
||||||
_cancel->setClickedCallback([=] { cancelSearch(); });
|
_cancel->setClickedCallback([=] { cancelSearch(); });
|
||||||
_field->hide();
|
_field->hide();
|
||||||
_filter->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
|
_filter->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
|
||||||
connect(_field, &Ui::FlatInput::cancelled, [=] { cancelSearch(); });
|
connect(_field, &Ui::InputField::cancelled, [=] { cancelSearch(); });
|
||||||
connect(_field, &Ui::FlatInput::changed, [=] { searchUpdated(); });
|
connect(_field, &Ui::InputField::changed, [=] { searchUpdated(); });
|
||||||
connect(_field, &Ui::FlatInput::submitted, [=] { applySearch(); });
|
connect(_field, &Ui::InputField::submitted, [=] { applySearch(); });
|
||||||
_searchTimer.setCallback([=] { applySearch(); });
|
_searchTimer.setCallback([=] { applySearch(); });
|
||||||
|
|
||||||
_cancel->hide(anim::type::instant);
|
_cancel->hide(anim::type::instant);
|
||||||
|
@ -184,8 +184,7 @@ void FixedBar::searchAnimationCallback() {
|
||||||
void FixedBar::cancelSearch() {
|
void FixedBar::cancelSearch() {
|
||||||
if (_searchShown) {
|
if (_searchShown) {
|
||||||
if (!_field->getLastText().isEmpty()) {
|
if (!_field->getLastText().isEmpty()) {
|
||||||
_field->setText(QString());
|
_field->clear();
|
||||||
_field->updatePlaceholder();
|
|
||||||
_field->setFocus();
|
_field->setFocus();
|
||||||
applySearch();
|
applySearch();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -748,12 +748,8 @@ topBarConnectingAnimation: InfiniteRadialAnimation(defaultInfiniteRadialAnimatio
|
||||||
|
|
||||||
infoFeedLeaveIconMargins: margins(10px, 12px, 20px, 10px);
|
infoFeedLeaveIconMargins: margins(10px, 12px, 20px, 10px);
|
||||||
|
|
||||||
inviteLinkField: FlatInput(defaultFlatInput) {
|
inviteLinkFieldHeight: 44px;
|
||||||
font: font(fsize);
|
inviteLinkFieldMargin: margins(14px, 12px, 36px, 9px);
|
||||||
|
|
||||||
height: 44px;
|
|
||||||
textMrg: margins(14px, 12px, 36px, 9px);
|
|
||||||
}
|
|
||||||
inviteLinkThreeDotsIcon: icon {{ "info/edit/dotsmini", dialogsMenuIconFg }};
|
inviteLinkThreeDotsIcon: icon {{ "info/edit/dotsmini", dialogsMenuIconFg }};
|
||||||
inviteLinkThreeDotsIconOver: icon {{ "info/edit/dotsmini", dialogsMenuIconFgOver }};
|
inviteLinkThreeDotsIconOver: icon {{ "info/edit/dotsmini", dialogsMenuIconFgOver }};
|
||||||
inviteLinkThreeDots: IconButton(defaultIconButton) {
|
inviteLinkThreeDots: IconButton(defaultIconButton) {
|
||||||
|
|
|
@ -148,15 +148,6 @@ linksDateMargin: margins(0px, 15px, 0px, 2px);
|
||||||
linksPhotoSize: 46px;
|
linksPhotoSize: 46px;
|
||||||
linksPhotoPadding: 12px;
|
linksPhotoPadding: 12px;
|
||||||
|
|
||||||
overviewFilter: FlatInput(defaultFlatInput) {
|
|
||||||
font: font(fsize);
|
|
||||||
icon: fieldSearchIcon;
|
|
||||||
|
|
||||||
width: 240px;
|
|
||||||
height: 32px;
|
|
||||||
textMrg: margins(32px, 3px, 32px, 3px);
|
|
||||||
}
|
|
||||||
|
|
||||||
overviewVideoStatusMargin: 3px;
|
overviewVideoStatusMargin: 3px;
|
||||||
overviewVideoStatusPadding: point(6px, 0px);
|
overviewVideoStatusPadding: point(6px, 0px);
|
||||||
overviewVideoStatusRadius: 4px;
|
overviewVideoStatusRadius: 4px;
|
||||||
|
|
|
@ -847,21 +847,6 @@ historyVideoMessageProgressOpacity: 0.72;
|
||||||
|
|
||||||
historyAdminLogEmptyWidth: 260px;
|
historyAdminLogEmptyWidth: 260px;
|
||||||
historyAdminLogEmptyPadding: margins(10px, 12px, 10px, 12px);
|
historyAdminLogEmptyPadding: margins(10px, 12px, 10px, 12px);
|
||||||
historyAdminLogSearchField: FlatInput(defaultFlatInput) {
|
|
||||||
textColor: windowFg;
|
|
||||||
bgColor: topBarBg;
|
|
||||||
bgActive: topBarBg;
|
|
||||||
|
|
||||||
font: font(fsize);
|
|
||||||
|
|
||||||
borderWidth: 0px;
|
|
||||||
borderColor: topBarBg;
|
|
||||||
borderActive: topBarBg;
|
|
||||||
|
|
||||||
width: 100px;
|
|
||||||
height: 32px;
|
|
||||||
textMrg: margins(0px, 0px, 0px, 0px);
|
|
||||||
}
|
|
||||||
historyAdminLogCancelSearch: CrossButton {
|
historyAdminLogCancelSearch: CrossButton {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 54px;
|
height: 54px;
|
||||||
|
|
|
@ -297,7 +297,7 @@ void ChooseThemeController::paintEntry(QPainter &p, const Entry &entry) {
|
||||||
if (entry.chosen) {
|
if (entry.chosen) {
|
||||||
auto hq = PainterHighQualityEnabler(p);
|
auto hq = PainterHighQualityEnabler(p);
|
||||||
auto pen = st::activeLineFg->p;
|
auto pen = st::activeLineFg->p;
|
||||||
const auto width = st::defaultFlatInput.borderWidth;
|
const auto width = st::defaultInputField.borderActive;
|
||||||
pen.setWidth(width);
|
pen.setWidth(width);
|
||||||
p.setPen(pen);
|
p.setPen(pen);
|
||||||
const auto add = st::lineWidth + width;
|
const auto add = st::lineWidth + width;
|
||||||
|
|
|
@ -21,7 +21,7 @@ InviteLinkLabel::InviteLinkLabel(
|
||||||
rpl::producer<QString> text,
|
rpl::producer<QString> text,
|
||||||
Fn<base::unique_qptr<PopupMenu>()> createMenu)
|
Fn<base::unique_qptr<PopupMenu>()> createMenu)
|
||||||
: _outer(std::in_place, parent) {
|
: _outer(std::in_place, parent) {
|
||||||
_outer->resize(_outer->width(), st::inviteLinkField.height);
|
_outer->resize(_outer->width(), st::inviteLinkFieldHeight);
|
||||||
const auto label = CreateChild<FlatLabel>(
|
const auto label = CreateChild<FlatLabel>(
|
||||||
_outer.get(),
|
_outer.get(),
|
||||||
std::move(text),
|
std::move(text),
|
||||||
|
@ -34,7 +34,7 @@ InviteLinkLabel::InviteLinkLabel(
|
||||||
|
|
||||||
_outer->widthValue(
|
_outer->widthValue(
|
||||||
) | rpl::start_with_next([=](int width) {
|
) | rpl::start_with_next([=](int width) {
|
||||||
const auto margin = st::inviteLinkField.textMrg;
|
const auto margin = st::inviteLinkFieldMargin;
|
||||||
label->resizeToWidth(width - margin.left() - margin.right());
|
label->resizeToWidth(width - margin.left() - margin.right());
|
||||||
label->moveToLeft(margin.left(), margin.top());
|
label->moveToLeft(margin.left(), margin.top());
|
||||||
button->moveToRight(0, 0);
|
button->moveToRight(0, 0);
|
||||||
|
@ -44,7 +44,7 @@ InviteLinkLabel::InviteLinkLabel(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
auto p = QPainter(_outer.get());
|
auto p = QPainter(_outer.get());
|
||||||
p.setPen(Qt::NoPen);
|
p.setPen(Qt::NoPen);
|
||||||
p.setBrush(st::inviteLinkField.bgColor);
|
p.setBrush(st::filterInputInactiveBg);
|
||||||
{
|
{
|
||||||
PainterHighQualityEnabler hq(p);
|
PainterHighQualityEnabler hq(p);
|
||||||
p.drawRoundedRect(
|
p.drawRoundedRect(
|
||||||
|
|
|
@ -626,28 +626,34 @@ void Generator::paintDialogs() {
|
||||||
auto filterRight = st::dialogsFilterSkip + st::dialogsFilterPadding.x();
|
auto filterRight = st::dialogsFilterSkip + st::dialogsFilterPadding.x();
|
||||||
auto filterWidth = _dialogs.x() + _dialogs.width() - filterLeft - filterRight;
|
auto filterWidth = _dialogs.x() + _dialogs.width() - filterLeft - filterRight;
|
||||||
auto filterAreaHeight = st::topBarHeight;
|
auto filterAreaHeight = st::topBarHeight;
|
||||||
auto filterTop = _dialogs.y() + (filterAreaHeight - st::dialogsFilter.height) / 2;
|
auto filterTop = _dialogs.y() + (filterAreaHeight - st::dialogsFilter.heightMin) / 2;
|
||||||
auto filter = QRect(filterLeft, filterTop, filterWidth, st::dialogsFilter.height);
|
auto filter = QRect(filterLeft, filterTop, filterWidth, st::dialogsFilter.heightMin);
|
||||||
|
|
||||||
auto pen = st::dialogsFilter.borderColor[_palette]->p;
|
auto pen = st::dialogsFilter.borderFg[_palette]->p;
|
||||||
pen.setWidth(st::dialogsFilter.borderWidth);
|
pen.setWidth(st::dialogsFilter.border);
|
||||||
_p->setPen(pen);
|
_p->setPen(pen);
|
||||||
_p->setBrush(st::dialogsFilter.bgColor[_palette]);
|
_p->setBrush(st::dialogsFilter.textBg[_palette]);
|
||||||
{
|
{
|
||||||
PainterHighQualityEnabler hq(*_p);
|
PainterHighQualityEnabler hq(*_p);
|
||||||
_p->drawRoundedRect(QRectF(filter).marginsRemoved(QMarginsF(st::dialogsFilter.borderWidth / 2., st::dialogsFilter.borderWidth / 2., st::dialogsFilter.borderWidth / 2., st::dialogsFilter.borderWidth / 2.)), st::roundRadiusSmall - (st::dialogsFilter.borderWidth / 2.), st::roundRadiusSmall - (st::dialogsFilter.borderWidth / 2.));
|
const auto radius = st::dialogsFilter.borderRadius
|
||||||
}
|
- (st::dialogsFilter.border / 2.);
|
||||||
|
_p->drawRoundedRect(
|
||||||
if (!st::dialogsFilter.icon.empty()) {
|
QRectF(filter).marginsRemoved(
|
||||||
st::dialogsFilter.icon[_palette].paint(*_p, filter.x(), filter.y(), _rect.width());
|
QMarginsF(
|
||||||
|
st::dialogsFilter.border / 2.,
|
||||||
|
st::dialogsFilter.border / 2.,
|
||||||
|
st::dialogsFilter.border / 2.,
|
||||||
|
st::dialogsFilter.border / 2.)),
|
||||||
|
radius,
|
||||||
|
radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
_p->save();
|
_p->save();
|
||||||
_p->setClipRect(filter);
|
_p->setClipRect(filter);
|
||||||
auto phRect = QRect(filter.x() + st::dialogsFilter.textMrg.left() + st::dialogsFilter.phPos.x(), filter.y() + st::dialogsFilter.textMrg.top() + st::dialogsFilter.phPos.y(), filter.width() - st::dialogsFilter.textMrg.left() - st::dialogsFilter.textMrg.right(), filter.height() - st::dialogsFilter.textMrg.top() - st::dialogsFilter.textMrg.bottom());;
|
auto phRect = QRect(filter.x() + st::dialogsFilter.textMargins.left() + st::dialogsFilter.placeholderMargins.left(), filter.y() + st::dialogsFilter.textMargins.top() + st::dialogsFilter.placeholderMargins.top(), filter.width() - st::dialogsFilter.textMargins.left() - st::dialogsFilter.textMargins.right(), filter.height() - st::dialogsFilter.textMargins.top() - st::dialogsFilter.textMargins.bottom());
|
||||||
_p->setFont(st::dialogsFilter.font);
|
_p->setFont(st::dialogsFilter.font);
|
||||||
_p->setPen(st::dialogsFilter.phColor[_palette]);
|
_p->setPen(st::dialogsFilter.placeholderFg[_palette]);
|
||||||
_p->drawText(phRect, tr::lng_dlg_filter(tr::now), QTextOption(st::dialogsFilter.phAlign));
|
_p->drawText(phRect, tr::lng_dlg_filter(tr::now), QTextOption(st::dialogsFilter.placeholderAlign));
|
||||||
_p->restore();
|
_p->restore();
|
||||||
_p->setClipping(false);
|
_p->setClipping(false);
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit d8b1f46715e5fcaf781b76ecbc386cbe31492287
|
Subproject commit 4ba3000a288772752fcf9b41a618ce5df5a185a5
|
Loading…
Add table
Reference in a new issue