Add create-from-choose-peer button icons.

This commit is contained in:
John Preston 2023-02-01 16:41:49 +04:00
parent 6957376a21
commit 1aeca7b486
8 changed files with 9 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/wrap/vertical_layout.h"
#include "window/window_session_controller.h"
#include "styles/style_boxes.h"
#include "styles/style_chat_helpers.h"
#include "styles/style_settings.h"
namespace {
@ -367,7 +368,7 @@ void ChoosePeerBoxController::prepareRestrictions() {
{ skip, 0, skip, st::membersMarginTop });
Settings::AddDivider(raw);
}
const auto make = [&](tr::phrase<> text) {
const auto make = [&](tr::phrase<> text, const style::icon &st) {
auto button = raw->add(
object_ptr<Ui::SettingsButton>(
raw,
@ -376,12 +377,12 @@ void ChoosePeerBoxController::prepareRestrictions() {
{ 0, st::membersMarginTop, 0, 0 });
const auto icon = Ui::CreateChild<Info::Profile::FloatingIcon>(
button,
st::inviteViaLinkIcon,
st,
QPoint());
button->heightValue(
) | rpl::start_with_next([=](int height) {
icon->moveToLeft(
st::inviteViaLinkIconPosition.x(),
st::choosePeerCreateIconLeft,
(height - st::inviteViaLinkIcon.height()) / 2);
}, icon->lifetime());
@ -399,9 +400,9 @@ void ChoosePeerBoxController::prepareRestrictions() {
return button;
};
if (_query.type == RequestPeerQuery::Type::Group) {
make(tr::lng_request_group_create);
make(tr::lng_request_group_create, st::choosePeerGroupIcon);
} else if (_query.type == RequestPeerQuery::Type::Broadcast) {
make(tr::lng_request_channel_create);
make(tr::lng_request_channel_create, st::choosePeerChannelIcon);
}
if (raw->count() > 0) {

View file

@ -419,3 +419,6 @@ reactPanelScroll: ScrollArea(emojiScroll) {
emojiSuggestionsFadeLeft: icon {{ "fade_horizontal-flip_horizontal", boxBg }};
emojiSuggestionsFadeRight: icon {{ "fade_horizontal", boxBg }};
choosePeerGroupIcon: icon {{ "info/edit/create_group", lightButtonFg }};
choosePeerChannelIcon: icon {{ "info/edit/create_channel", lightButtonFg }};
choosePeerCreateIconLeft: 25px;