Add filter icons to Settings -> Folders.
Before Width: | Height: | Size: 528 B After Width: | Height: | Size: 528 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 503 B After Width: | Height: | Size: 503 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 454 B After Width: | Height: | Size: 454 B |
Before Width: | Height: | Size: 913 B After Width: | Height: | Size: 913 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 699 B After Width: | Height: | Size: 699 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 508 B |
Before Width: | Height: | Size: 984 B After Width: | Height: | Size: 984 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 573 B After Width: | Height: | Size: 573 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 672 B After Width: | Height: | Size: 672 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 189 B After Width: | Height: | Size: 308 B |
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 546 B |
Before Width: | Height: | Size: 485 B After Width: | Height: | Size: 823 B |
Before Width: | Height: | Size: 213 B After Width: | Height: | Size: 399 B |
Before Width: | Height: | Size: 390 B After Width: | Height: | Size: 767 B |
Before Width: | Height: | Size: 844 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 168 B |
Before Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 439 B |
|
@ -41,8 +41,8 @@ stickersRemove: IconButton(defaultIconButton) {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|
||||||
icon: icon {{ "stickers_remove", menuIconFg }};
|
icon: icon {{ "info_media_delete", menuIconFg }};
|
||||||
iconOver: icon {{ "stickers_remove", menuIconFgOver }};
|
iconOver: icon {{ "info_media_delete", menuIconFgOver }};
|
||||||
|
|
||||||
rippleAreaSize: 40px;
|
rippleAreaSize: 40px;
|
||||||
rippleAreaPosition: point(0px, 0px);
|
rippleAreaPosition: point(0px, 0px);
|
||||||
|
|
|
@ -169,7 +169,7 @@ infoTopBarForward: IconButton(infoTopBarBack) {
|
||||||
width: 46px;
|
width: 46px;
|
||||||
icon: icon {{ "info_media_forward", boxTitleCloseFg }};
|
icon: icon {{ "info_media_forward", boxTitleCloseFg }};
|
||||||
iconOver: icon {{ "info_media_forward", boxTitleCloseFgOver }};
|
iconOver: icon {{ "info_media_forward", boxTitleCloseFgOver }};
|
||||||
iconPosition: point(6px, -1px);
|
iconPosition: point(10px, -1px);
|
||||||
rippleAreaPosition: point(1px, 6px);
|
rippleAreaPosition: point(1px, 6px);
|
||||||
}
|
}
|
||||||
infoTopBarDelete: IconButton(infoTopBarForward) {
|
infoTopBarDelete: IconButton(infoTopBarForward) {
|
||||||
|
@ -245,7 +245,7 @@ infoLayerTopBarForward: IconButton(infoLayerTopBarBack) {
|
||||||
width: 45px;
|
width: 45px;
|
||||||
icon: icon {{ "info_media_forward", boxTitleCloseFg }};
|
icon: icon {{ "info_media_forward", boxTitleCloseFg }};
|
||||||
iconOver: icon {{ "info_media_forward", boxTitleCloseFgOver }};
|
iconOver: icon {{ "info_media_forward", boxTitleCloseFgOver }};
|
||||||
iconPosition: point(6px, -1px);
|
iconPosition: point(11px, -1px);
|
||||||
rippleAreaPosition: point(1px, 6px);
|
rippleAreaPosition: point(1px, 6px);
|
||||||
}
|
}
|
||||||
infoLayerTopBarDelete: IconButton(infoLayerTopBarForward) {
|
infoLayerTopBarDelete: IconButton(infoLayerTopBarForward) {
|
||||||
|
|
|
@ -217,6 +217,9 @@ settingsAccentColorSize: 24px;
|
||||||
settingsAccentColorSkip: 4px;
|
settingsAccentColorSkip: 4px;
|
||||||
settingsAccentColorLine: 3px;
|
settingsAccentColorLine: 3px;
|
||||||
|
|
||||||
|
settingsFilterIconSkip: 68px;
|
||||||
|
settingsFilterIconLeft: 17px;
|
||||||
|
|
||||||
dictionariesSectionButton: SettingsButton(settingsUpdateToggle) {
|
dictionariesSectionButton: SettingsButton(settingsUpdateToggle) {
|
||||||
font: font(14px semibold);
|
font: font(14px semibold);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/text/text_utilities.h"
|
#include "ui/text/text_utilities.h"
|
||||||
#include "ui/wrap/slide_wrap.h"
|
#include "ui/wrap/slide_wrap.h"
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
|
#include "ui/filter_icons.h"
|
||||||
#include "settings/settings_common.h"
|
#include "settings/settings_common.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
|
@ -88,6 +89,7 @@ private:
|
||||||
|
|
||||||
Ui::Text::String _title;
|
Ui::Text::String _title;
|
||||||
QString _status;
|
QString _status;
|
||||||
|
Ui::FilterIcon _icon = Ui::FilterIcon();
|
||||||
|
|
||||||
State _state = State::Normal;
|
State _state = State::Normal;
|
||||||
|
|
||||||
|
@ -192,6 +194,7 @@ void FilterRowButton::updateData(const Data::ChatFilter &filter) {
|
||||||
|
|
||||||
_title.setText(st::contactsNameStyle, filter.title());
|
_title.setText(st::contactsNameStyle, filter.title());
|
||||||
_status = ComputeCountString(_session, filter, true);
|
_status = ComputeCountString(_session, filter, true);
|
||||||
|
_icon = Ui::ComputeFilterIcon(filter);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,6 +216,7 @@ void FilterRowButton::setup(
|
||||||
|
|
||||||
_title.setText(st::contactsNameStyle, filter.title());
|
_title.setText(st::contactsNameStyle, filter.title());
|
||||||
_status = status;
|
_status = status;
|
||||||
|
_icon = Ui::ComputeFilterIcon(filter);
|
||||||
|
|
||||||
setState(_state, true);
|
setState(_state, true);
|
||||||
|
|
||||||
|
@ -250,8 +254,9 @@ rpl::producer<> FilterRowButton::addRequests() const {
|
||||||
void FilterRowButton::paintEvent(QPaintEvent *e) {
|
void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
auto p = Painter(this);
|
auto p = Painter(this);
|
||||||
|
|
||||||
|
const auto over = isOver() || isDown();
|
||||||
if (_state == State::Normal) {
|
if (_state == State::Normal) {
|
||||||
if (isOver() || isDown()) {
|
if (over) {
|
||||||
p.fillRect(e->rect(), st::windowBgOver);
|
p.fillRect(e->rect(), st::windowBgOver);
|
||||||
}
|
}
|
||||||
RippleButton::paintRipple(p, 0, 0);
|
RippleButton::paintRipple(p, 0, 0);
|
||||||
|
@ -259,7 +264,9 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
p.setOpacity(st::stickersRowDisabledOpacity);
|
p.setOpacity(st::stickersRowDisabledOpacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto left = st::settingsSubsectionTitlePadding.left();
|
const auto left = (_state == State::Suggested)
|
||||||
|
? st::settingsSubsectionTitlePadding.left()
|
||||||
|
: st::settingsFilterIconSkip;
|
||||||
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()));
|
||||||
|
@ -280,6 +287,16 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
|
||||||
st::contactsPadding.top() + st::contactsStatusTop,
|
st::contactsPadding.top() + st::contactsStatusTop,
|
||||||
width(),
|
width(),
|
||||||
_status);
|
_status);
|
||||||
|
|
||||||
|
if (_state != State::Suggested) {
|
||||||
|
const auto icon = Ui::LookupFilterIcon(_icon).normal;
|
||||||
|
icon->paint(
|
||||||
|
p,
|
||||||
|
st::settingsFilterIconLeft,
|
||||||
|
(height() - icon->height()) / 2,
|
||||||
|
width(),
|
||||||
|
(over ? st::menuIconFgOver : st::menuIconFg)->c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] Fn<void()> SetupFoldersContent(
|
[[nodiscard]] Fn<void()> SetupFoldersContent(
|
||||||
|
|
|
@ -293,14 +293,14 @@ windwoFilterIconPanelPosition: point(-2px, -1px);
|
||||||
windowFilterIconSingle: size(44px, 42px);
|
windowFilterIconSingle: size(44px, 42px);
|
||||||
windowFilterIconPadding: margins(10px, 36px, 10px, 8px);
|
windowFilterIconPadding: margins(10px, 36px, 10px, 8px);
|
||||||
windowFilterIconHeaderPosition: point(18px, 14px);
|
windowFilterIconHeaderPosition: point(18px, 14px);
|
||||||
windowFilterTypeContacts: icon {{ "filters_type_contacts", historyPeerUserpicFg }};
|
windowFilterTypeContacts: icon {{ "filters/filters_type_contacts", historyPeerUserpicFg }};
|
||||||
windowFilterTypeNonContacts: icon {{ "filters_type_noncontacts", historyPeerUserpicFg }};
|
windowFilterTypeNonContacts: icon {{ "filters/filters_type_noncontacts", historyPeerUserpicFg }};
|
||||||
windowFilterTypeGroups: icon {{ "filters_type_groups", historyPeerUserpicFg }};
|
windowFilterTypeGroups: icon {{ "filters/filters_type_groups", historyPeerUserpicFg }};
|
||||||
windowFilterTypeChannels: icon {{ "filters_type_channels", historyPeerUserpicFg }};
|
windowFilterTypeChannels: icon {{ "filters/filters_type_channels", historyPeerUserpicFg }};
|
||||||
windowFilterTypeBots: icon {{ "filters_type_bots", historyPeerUserpicFg }};
|
windowFilterTypeBots: icon {{ "filters/filters_type_bots", historyPeerUserpicFg }};
|
||||||
windowFilterTypeNoMuted: icon {{ "filters_type_muted", historyPeerUserpicFg }};
|
windowFilterTypeNoMuted: icon {{ "filters/filters_type_muted", historyPeerUserpicFg }};
|
||||||
windowFilterTypeNoArchived: icon {{ "filters_type_archived", historyPeerUserpicFg }};
|
windowFilterTypeNoArchived: icon {{ "filters/filters_type_archived", historyPeerUserpicFg }};
|
||||||
windowFilterTypeNoRead: icon {{ "filters_type_read", historyPeerUserpicFg }};
|
windowFilterTypeNoRead: icon {{ "filters/filters_type_read", historyPeerUserpicFg }};
|
||||||
windowFilterChatsSectionSubtitle: FlatLabel(defaultFlatLabel) {
|
windowFilterChatsSectionSubtitle: FlatLabel(defaultFlatLabel) {
|
||||||
style: TextStyle(defaultTextStyle) {
|
style: TextStyle(defaultTextStyle) {
|
||||||
font: searchedBarFont;
|
font: searchedBarFont;
|
||||||
|
|