Slightly improved style of buttons and icons in Folders settings.

This commit is contained in:
23rd 2022-05-03 19:37:47 +03:00
parent b04aaba8d0
commit 3b45a120e6
2 changed files with 16 additions and 8 deletions

View File

@ -253,8 +253,6 @@ settingsAccentColorSize: 24px;
settingsAccentColorSkip: 4px;
settingsAccentColorLine: 3px;
settingsFilterIconSkip: 68px;
settingsFilterIconLeft: 17px;
settingsFilterDividerLabel: FlatLabel(boxDividerLabel) {
minWidth: 258px;
maxHeight: 0px;

View File

@ -275,7 +275,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
const auto left = (_state == State::Suggested)
? st::settingsSubsectionTitlePadding.left()
: st::settingsFilterIconSkip;
: st::settingsButtonActive.padding.left();
const auto buttonsLeft = std::min(
_add.x(),
std::min(_remove.x(), _restore.x()));
@ -299,14 +299,24 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
if (_state != State::Suggested) {
const auto icon = Ui::LookupFilterIcon(_icon).normal;
// For now.
const auto iconWidth = icon->width() - style::ConvertScale(9);
const auto scale = st::settingsIconAdd.width() / float64(iconWidth);
p.translate(
st::settingsButtonActive.iconLeft,
(height() - icon->height() * scale) / 2);
p.translate(-iconWidth / 2, -iconWidth / 2);
p.scale(scale, scale);
p.translate(iconWidth / 2, iconWidth / 2);
icon->paint(
p,
st::settingsFilterIconLeft,
(height() - icon->height()) / 2,
0,
0,
width(),
(over
? st::dialogsUnreadBgMutedOver
: st::dialogsUnreadBgMuted)->c);
? st::activeButtonBgOver
: st::activeButtonBg)->c);
}
}
@ -413,7 +423,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
container,
tr::lng_filters_create(),
st::settingsButtonActive,
{ &st::settingsIconFolders, kIconLightBlue }
{ &st::settingsIconAdd, 0, IconType::Round, &st::windowBgActive }
)->setClickedCallback([=] {
if (showLimitReached()) {
return;