Slightly improved style of buttons and icons in Folders settings.
This commit is contained in:
parent
b04aaba8d0
commit
3b45a120e6
|
@ -253,8 +253,6 @@ settingsAccentColorSize: 24px;
|
||||||
settingsAccentColorSkip: 4px;
|
settingsAccentColorSkip: 4px;
|
||||||
settingsAccentColorLine: 3px;
|
settingsAccentColorLine: 3px;
|
||||||
|
|
||||||
settingsFilterIconSkip: 68px;
|
|
||||||
settingsFilterIconLeft: 17px;
|
|
||||||
settingsFilterDividerLabel: FlatLabel(boxDividerLabel) {
|
settingsFilterDividerLabel: FlatLabel(boxDividerLabel) {
|
||||||
minWidth: 258px;
|
minWidth: 258px;
|
||||||
maxHeight: 0px;
|
maxHeight: 0px;
|
||||||
|
|
|
@ -275,7 +275,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
|
|
||||||
const auto left = (_state == State::Suggested)
|
const auto left = (_state == State::Suggested)
|
||||||
? st::settingsSubsectionTitlePadding.left()
|
? st::settingsSubsectionTitlePadding.left()
|
||||||
: st::settingsFilterIconSkip;
|
: st::settingsButtonActive.padding.left();
|
||||||
const auto buttonsLeft = std::min(
|
const auto buttonsLeft = std::min(
|
||||||
_add.x(),
|
_add.x(),
|
||||||
std::min(_remove.x(), _restore.x()));
|
std::min(_remove.x(), _restore.x()));
|
||||||
|
@ -299,14 +299,24 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
|
|
||||||
if (_state != State::Suggested) {
|
if (_state != State::Suggested) {
|
||||||
const auto icon = Ui::LookupFilterIcon(_icon).normal;
|
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(
|
icon->paint(
|
||||||
p,
|
p,
|
||||||
st::settingsFilterIconLeft,
|
0,
|
||||||
(height() - icon->height()) / 2,
|
0,
|
||||||
width(),
|
width(),
|
||||||
(over
|
(over
|
||||||
? st::dialogsUnreadBgMutedOver
|
? st::activeButtonBgOver
|
||||||
: st::dialogsUnreadBgMuted)->c);
|
: st::activeButtonBg)->c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,7 +423,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
container,
|
container,
|
||||||
tr::lng_filters_create(),
|
tr::lng_filters_create(),
|
||||||
st::settingsButtonActive,
|
st::settingsButtonActive,
|
||||||
{ &st::settingsIconFolders, kIconLightBlue }
|
{ &st::settingsIconAdd, 0, IconType::Round, &st::windowBgActive }
|
||||||
)->setClickedCallback([=] {
|
)->setClickedCallback([=] {
|
||||||
if (showLimitReached()) {
|
if (showLimitReached()) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue