Replaced icons in manage group / channel.

This commit is contained in:
23rd 2022-04-24 01:03:04 +03:00 committed by John Preston
parent 31cd841b75
commit 4a4cc766c2
32 changed files with 126 additions and 132 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 768 B

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 957 B

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 B

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1,023 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 B

After

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 891 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -1976,7 +1976,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_try_other_contact" = "Try someone else"; "lng_try_other_contact" = "Try someone else";
"lng_create_group_link" = "Link"; "lng_create_group_link" = "Link";
"lng_create_group_invite_link" = "Invite link"; "lng_create_group_invite_link" = "Invite link";
"lng_create_group_description" = "Description (optional)"; "lng_create_group_description" = "Add description...";
"lng_drag_images_here" = "Drop images here"; "lng_drag_images_here" = "Drop images here";
"lng_drag_photos_here" = "Drop photos here"; "lng_drag_photos_here" = "Drop photos here";

View file

@ -510,7 +510,8 @@ not_null<Ui::SlideWrap<Ui::RpWidget>*> EditAdminBox::setupTransferButton(
: tr::lng_rights_transfer_channel)(), : tr::lng_rights_transfer_channel)(),
rpl::single(QString()), rpl::single(QString()),
[=] { transferOwnership(); }, [=] { transferOwnership(); },
st::peerPermissionsButton)); st::peerPermissionsButton,
{}));
return wrap; return wrap;
} }

View file

@ -37,9 +37,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/admin_log/history_admin_log_section.h" #include "history/admin_log/history_admin_log_section.h"
#include "info/profile/info_profile_values.h" #include "info/profile/info_profile_values.h"
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "mainwidget.h"
#include "mainwindow.h"
#include "mtproto/sender.h" #include "mtproto/sender.h"
#include "settings/settings_common.h"
#include "ui/rp_widget.h" #include "ui/rp_widget.h"
#include "ui/special_buttons.h" #include "ui/special_buttons.h"
#include "ui/toast/toast.h" #include "ui/toast/toast.h"
@ -53,22 +52,22 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/wrap/vertical_layout.h" #include "ui/wrap/vertical_layout.h"
#include "window/window_session_controller.h" #include "window/window_session_controller.h"
#include "info/profile/info_profile_icon.h" #include "info/profile/info_profile_icon.h"
#include "apiwrap.h"
#include "api/api_invite_links.h" #include "api/api_invite_links.h"
#include "facades.h" #include "facades.h" // Ui::showChatsList
#include "styles/style_layers.h" #include "styles/style_layers.h"
#include "styles/style_boxes.h" #include "styles/style_boxes.h"
#include "styles/style_info.h" #include "styles/style_info.h"
#include "styles/style_settings.h"
namespace { namespace {
auto ToPositiveNumberString() { [[nodiscard]] auto ToPositiveNumberString() {
return rpl::map([](int count) { return rpl::map([](int count) {
return count ? QString::number(count) : QString(); return count ? QString::number(count) : QString();
}); });
} }
auto ToPositiveNumberStringRestrictions() { [[nodiscard]] auto ToPositiveNumberStringRestrictions() {
return rpl::map([](int count) { return rpl::map([](int count) {
return QString::number(count) return QString::number(count)
+ QString("/") + QString("/")
@ -94,40 +93,29 @@ void AddButtonWithCount(
rpl::producer<QString> &&text, rpl::producer<QString> &&text,
rpl::producer<QString> &&count, rpl::producer<QString> &&count,
Fn<void()> callback, Fn<void()> callback,
const style::icon &icon) { Settings::IconDescriptor &&descriptor) {
parent->add(EditPeerInfoBox::CreateButton( parent->add(EditPeerInfoBox::CreateButton(
parent, parent,
std::move(text), std::move(text),
std::move(count), std::move(count),
std::move(callback), std::move(callback),
st::manageGroupButton, st::manageGroupButton,
&icon)); std::move(descriptor)));
} }
object_ptr<Ui::SettingsButton> CreateButtonWithText( not_null<Ui::SettingsButton*> AddButtonWithText(
not_null<QWidget*> parent, not_null<Ui::VerticalLayout*> parent,
rpl::producer<QString> &&text, rpl::producer<QString> &&text,
rpl::producer<QString> &&label, rpl::producer<QString> &&label,
Fn<void()> callback) { Fn<void()> callback,
return EditPeerInfoBox::CreateButton( Settings::IconDescriptor &&descriptor) {
return parent->add(EditPeerInfoBox::CreateButton(
parent, parent,
std::move(text), std::move(text),
std::move(label), std::move(label),
std::move(callback), std::move(callback),
st::manageGroupTopButtonWithText, st::manageGroupTopButtonWithText,
nullptr); std::move(descriptor)));
}
Ui::SettingsButton *AddButtonWithText(
not_null<Ui::VerticalLayout*> parent,
rpl::producer<QString> &&text,
rpl::producer<QString> &&label,
Fn<void()> callback) {
return parent->add(CreateButtonWithText(
parent,
std::move(text),
std::move(label),
std::move(callback)));
} }
void AddButtonDelete( void AddButtonDelete(
@ -140,7 +128,7 @@ void AddButtonDelete(
rpl::single(QString()), rpl::single(QString()),
std::move(callback), std::move(callback),
st::manageDeleteGroupButton, st::manageDeleteGroupButton,
nullptr)); {}));
} }
void SaveDefaultRestrictions( void SaveDefaultRestrictions(
@ -262,7 +250,7 @@ public:
not_null<Ui::BoxContent*> box, not_null<Ui::BoxContent*> box,
not_null<PeerData*> peer); not_null<PeerData*> peer);
object_ptr<Ui::VerticalLayout> createContent(); [[nodiscard]] object_ptr<Ui::VerticalLayout> createContent();
void setFocus(); void setFocus();
private: private:
@ -284,12 +272,12 @@ private:
std::optional<ChannelData*> linkedChat; std::optional<ChannelData*> linkedChat;
}; };
object_ptr<Ui::RpWidget> createPhotoAndTitleEdit(); [[nodiscard]] object_ptr<Ui::RpWidget> createPhotoAndTitleEdit();
object_ptr<Ui::RpWidget> createTitleEdit(); [[nodiscard]] object_ptr<Ui::RpWidget> createTitleEdit();
object_ptr<Ui::RpWidget> createPhotoEdit(); [[nodiscard]] object_ptr<Ui::RpWidget> createPhotoEdit();
object_ptr<Ui::RpWidget> createDescriptionEdit(); [[nodiscard]] object_ptr<Ui::RpWidget> createDescriptionEdit();
object_ptr<Ui::RpWidget> createManageGroupButtons(); [[nodiscard]] object_ptr<Ui::RpWidget> createManageGroupButtons();
object_ptr<Ui::RpWidget> createStickersEdit(); [[nodiscard]] object_ptr<Ui::RpWidget> createStickersEdit();
[[nodiscard]] bool canEditInformation() const; [[nodiscard]] bool canEditInformation() const;
[[nodiscard]] bool canEditReactions() const; [[nodiscard]] bool canEditReactions() const;
@ -310,14 +298,14 @@ private:
void deleteWithConfirmation(); void deleteWithConfirmation();
void deleteChannel(); void deleteChannel();
std::optional<Saving> validate() const; [[nodiscard]] std::optional<Saving> validate() const;
bool validateUsername(Saving &to) const; [[nodiscard]] bool validateUsername(Saving &to) const;
bool validateLinkedChat(Saving &to) const; [[nodiscard]] bool validateLinkedChat(Saving &to) const;
bool validateTitle(Saving &to) const; [[nodiscard]] bool validateTitle(Saving &to) const;
bool validateDescription(Saving &to) const; [[nodiscard]] bool validateDescription(Saving &to) const;
bool validateHistoryVisibility(Saving &to) const; [[nodiscard]] bool validateHistoryVisibility(Saving &to) const;
bool validateSignatures(Saving &to) const; [[nodiscard]] bool validateSignatures(Saving &to) const;
bool validateForwards(Saving &to) const; [[nodiscard]] bool validateForwards(Saving &to) const;
void save(); void save();
void saveUsername(); void saveUsername();
@ -522,7 +510,8 @@ object_ptr<Ui::RpWidget> Controller::createDescriptionEdit() {
result->entity()->setInstantReplaces(Ui::InstantReplaces::Default()); result->entity()->setInstantReplaces(Ui::InstantReplaces::Default());
result->entity()->setInstantReplacesEnabled( result->entity()->setInstantReplacesEnabled(
Core::App().settings().replaceEmojiValue()); Core::App().settings().replaceEmojiValue());
result->entity()->setSubmitSettings(Core::App().settings().sendSubmitWay()); result->entity()->setSubmitSettings(
Core::App().settings().sendSubmitWay());
Ui::Emoji::SuggestionsController::Init( Ui::Emoji::SuggestionsController::Init(
_wrap->window(), _wrap->window(),
result->entity(), result->entity(),
@ -739,7 +728,8 @@ void Controller::fillPrivacyTypeButton() {
? tr::lng_manage_private_group_title ? tr::lng_manage_private_group_title
: tr::lng_manage_private_peer_title)(); : tr::lng_manage_private_peer_title)();
}) | rpl::flatten_latest(), }) | rpl::flatten_latest(),
[=] { showEditPeerTypeBox(); }); [=] { showEditPeerTypeBox(); },
{ &st::infoIconGroupType, Settings::kIconLightBlue });
_privacyTypeUpdates.fire_copy(*_privacySavedValue); _privacyTypeUpdates.fire_copy(*_privacySavedValue);
} }
@ -781,7 +771,8 @@ void Controller::fillLinkedChatButton() {
_controls.buttonsLayout, _controls.buttonsLayout,
std::move(text), std::move(text),
std::move(label), std::move(label),
[=] { showEditLinkedChatBox(); }); [=] { showEditLinkedChatBox(); },
{ &st::settingsIconChat, Settings::kIconGreen });
_linkedChatUpdates.fire_copy(*_linkedChatSavedValue); _linkedChatUpdates.fire_copy(*_linkedChatSavedValue);
} }
// //
@ -803,13 +794,16 @@ void Controller::fillSignaturesButton() {
Expects(_controls.buttonsLayout != nullptr); Expects(_controls.buttonsLayout != nullptr);
const auto channel = _peer->asChannel(); const auto channel = _peer->asChannel();
if (!channel) return; if (!channel) {
return;
}
AddButtonWithText( AddButtonWithText(
_controls.buttonsLayout, _controls.buttonsLayout,
tr::lng_edit_sign_messages(), tr::lng_edit_sign_messages(),
rpl::single(QString()), rpl::single(QString()),
[=] {} [] {},
{ &st::infoIconSignature, Settings::kIconLightBlue }
)->toggleOn(rpl::single(channel->addsSignature()) )->toggleOn(rpl::single(channel->addsSignature())
)->toggledValue( )->toggledValue(
) | rpl::start_with_next([=](bool toggled) { ) | rpl::start_with_next([=](bool toggled) {
@ -859,7 +853,8 @@ void Controller::fillHistoryVisibilityButton() {
? tr::lng_manage_history_visibility_shown ? tr::lng_manage_history_visibility_shown
: tr::lng_manage_history_visibility_hidden)(); : tr::lng_manage_history_visibility_hidden)();
}) | rpl::flatten_latest(), }) | rpl::flatten_latest(),
buttonCallback); buttonCallback,
{ &st::settingsIconChat, Settings::kIconGreen });
updateHistoryVisibility->fire_copy(*_historyVisibilitySavedValue); updateHistoryVisibility->fire_copy(*_historyVisibilitySavedValue);
@ -970,6 +965,40 @@ void Controller::fillManageSection() {
st::editPeerTopButtonsLayoutSkipCustomBottom); st::editPeerTopButtonsLayoutSkipCustomBottom);
} }
if (canEditReactions()) {
const auto session = &_peer->session();
auto reactionsCount = Info::Profile::MigratedOrMeValue(
_peer
) | rpl::map(
Info::Profile::AllowedReactionsCountValue
) | rpl::flatten_latest();
auto fullCount = Info::Profile::FullReactionsCountValue(session);
auto label = rpl::combine(
std::move(reactionsCount),
std::move(fullCount)
) | rpl::map([=](int allowed, int total) {
return allowed
? QString::number(allowed) + " / " + QString::number(total)
: tr::lng_manage_peer_reactions_off(tr::now);
});
const auto done = [=](const std::vector<QString> &chosen) {
SaveAllowedReactions(_peer, chosen);
};
AddButtonWithCount(
_controls.buttonsLayout,
tr::lng_manage_peer_reactions(),
std::move(label),
[=] {
_navigation->parentController()->show(Box(
EditAllowedReactionsBox,
!_peer->isBroadcast(),
session->data().reactions().list(
Data::Reactions::Type::Active),
*Data::PeerAllowedReactions(_peer),
done));
},
{ &st::infoIconReactions, Settings::kIconRed });
}
if (canEditPermissions) { if (canEditPermissions) {
AddButtonWithCount( AddButtonWithCount(
_controls.buttonsLayout, _controls.buttonsLayout,
@ -981,7 +1010,7 @@ void Controller::fillManageSection() {
) | rpl::flatten_latest( ) | rpl::flatten_latest(
) | ToPositiveNumberStringRestrictions(), ) | ToPositiveNumberStringRestrictions(),
[=] { ShowEditPermissions(_navigation, _peer); }, [=] { ShowEditPermissions(_navigation, _peer); },
st::infoIconPermissions); { &st::settingsIconKey, Settings::kIconGreen });
} }
if (canEditInviteLinks) { if (canEditInviteLinks) {
auto count = Info::Profile::MigratedOrMeValue( auto count = Info::Profile::MigratedOrMeValue(
@ -1017,7 +1046,7 @@ void Controller::fillManageSection() {
0), 0),
Ui::LayerOption::KeepOther); Ui::LayerOption::KeepOther);
}, },
st::infoIconInviteLinks); { &st::infoIconInviteLinks, Settings::kIconLightOrange });
if (_privacySavedValue) { if (_privacySavedValue) {
_privacyTypeUpdates.events_starting_with_copy( _privacyTypeUpdates.events_starting_with_copy(
@ -1029,40 +1058,6 @@ void Controller::fillManageSection() {
}, wrap->lifetime()); }, wrap->lifetime());
} }
} }
if (canEditReactions()) {
const auto session = &_peer->session();
auto reactionsCount = Info::Profile::MigratedOrMeValue(
_peer
) | rpl::map(
Info::Profile::AllowedReactionsCountValue
) | rpl::flatten_latest();
auto fullCount = Info::Profile::FullReactionsCountValue(session);
auto label = rpl::combine(
std::move(reactionsCount),
std::move(fullCount)
) | rpl::map([=](int allowed, int total) {
return allowed
? QString::number(allowed) + " / " + QString::number(total)
: tr::lng_manage_peer_reactions_off(tr::now);
});
const auto done = [=](const std::vector<QString> &chosen) {
SaveAllowedReactions(_peer, chosen);
};
AddButtonWithCount(
_controls.buttonsLayout,
tr::lng_manage_peer_reactions(),
std::move(label),
[=] {
_navigation->parentController()->show(Box(
EditAllowedReactionsBox,
!_peer->isBroadcast(),
session->data().reactions().list(
Data::Reactions::Type::Active),
*Data::PeerAllowedReactions(_peer),
done));
},
st::infoIconReactions);
}
if (canViewAdmins) { if (canViewAdmins) {
AddButtonWithCount( AddButtonWithCount(
_controls.buttonsLayout, _controls.buttonsLayout,
@ -1079,12 +1074,14 @@ void Controller::fillManageSection() {
_peer, _peer,
ParticipantsBoxController::Role::Admins); ParticipantsBoxController::Role::Admins);
}, },
st::infoIconAdministrators); { &st::infoIconAdministrators, Settings::kIconLightBlue });
} }
if (canViewMembers) { if (canViewMembers) {
AddButtonWithCount( AddButtonWithCount(
_controls.buttonsLayout, _controls.buttonsLayout,
(_isGroup ? tr::lng_manage_peer_members() : tr::lng_manage_peer_subscribers()), (_isGroup
? tr::lng_manage_peer_members()
: tr::lng_manage_peer_subscribers()),
Info::Profile::MigratedOrMeValue( Info::Profile::MigratedOrMeValue(
_peer _peer
) | rpl::map( ) | rpl::map(
@ -1097,7 +1094,7 @@ void Controller::fillManageSection() {
_peer, _peer,
ParticipantsBoxController::Role::Members); ParticipantsBoxController::Role::Members);
}, },
st::infoIconMembers); { &st::settingsIconGroup, Settings::kIconDarkBlue });
} }
fillPendingRequestsButton(); fillPendingRequestsButton();
@ -1114,7 +1111,7 @@ void Controller::fillManageSection() {
_peer, _peer,
ParticipantsBoxController::Role::Kicked); ParticipantsBoxController::Role::Kicked);
}, },
st::infoIconBlacklist); { &st::settingsIconMinus, Settings::kIconRed });
} }
if (hasRecentActions) { if (hasRecentActions) {
auto callback = [=] { auto callback = [=] {
@ -1126,7 +1123,7 @@ void Controller::fillManageSection() {
tr::lng_manage_peer_recent_actions(), tr::lng_manage_peer_recent_actions(),
rpl::single(QString()), //Empty count. rpl::single(QString()), //Empty count.
std::move(callback), std::move(callback),
st::infoIconRecentActions); { &st::infoIconRecentActions, Settings::kIconPurple });
} }
if (canEditStickers || canDeleteChannel) { if (canEditStickers || canDeleteChannel) {
@ -1168,7 +1165,7 @@ void Controller::fillPendingRequestsButton() {
: tr::lng_manage_peer_requests_channel()), : tr::lng_manage_peer_requests_channel()),
rpl::duplicate(pendingRequestsCount) | ToPositiveNumberString(), rpl::duplicate(pendingRequestsCount) | ToPositiveNumberString(),
[=] { RequestsBoxController::Start(_navigation, _peer); }, [=] { RequestsBoxController::Start(_navigation, _peer); },
st::infoIconRequests); { &st::infoIconRequests, Settings::kIconRed });
std::move( std::move(
pendingRequestsCount pendingRequestsCount
) | rpl::start_with_next([=](int count) { ) | rpl::start_with_next([=](int count) {
@ -1670,18 +1667,18 @@ object_ptr<Ui::SettingsButton> EditPeerInfoBox::CreateButton(
rpl::producer<QString> &&count, rpl::producer<QString> &&count,
Fn<void()> callback, Fn<void()> callback,
const style::SettingsCountButton &st, const style::SettingsCountButton &st,
const style::icon *icon) { Settings::IconDescriptor &&descriptor) {
auto result = object_ptr<Ui::SettingsButton>( auto result = object_ptr<Ui::SettingsButton>(
parent, parent,
rpl::duplicate(text), rpl::duplicate(text),
st.button); st.button);
const auto button = result.data(); const auto button = result.data();
button->addClickHandler(callback); button->addClickHandler(callback);
if (icon) { if (descriptor) {
Ui::CreateChild<Info::Profile::FloatingIcon>( AddButtonIcon(
button, button,
*icon, st.button,
st.iconPosition); std::move(descriptor));
} }
auto labelText = rpl::combine( auto labelText = rpl::combine(

View file

@ -7,8 +7,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/ */
#pragma once #pragma once
#include <rpl/event_stream.h> #include "ui/layers/box_content.h"
#include "boxes/abstract_box.h"
namespace Settings {
struct IconDescriptor;
} // namespace Settings
namespace style { namespace style {
struct SettingsCountButton; struct SettingsCountButton;
@ -42,7 +45,7 @@ public:
rpl::producer<QString> &&count, rpl::producer<QString> &&count,
Fn<void()> callback, Fn<void()> callback,
const style::SettingsCountButton &st, const style::SettingsCountButton &st,
const style::icon *icon = nullptr); Settings::IconDescriptor &&descriptor);
protected: protected:
void prepare() override; void prepare() override;

View file

@ -28,6 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "main/main_session.h" #include "main/main_session.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "apiwrap.h" #include "apiwrap.h"
#include "settings/settings_common.h"
#include "styles/style_layers.h" #include "styles/style_layers.h"
#include "styles/style_boxes.h" #include "styles/style_boxes.h"
#include "styles/style_info.h" #include "styles/style_info.h"
@ -612,7 +613,8 @@ void EditPeerPermissionsBox::addSuggestGigagroup(
AboutGigagroupCallback( AboutGigagroupCallback(
_peer->asChannel(), _peer->asChannel(),
_navigation->parentController()), _navigation->parentController()),
st::peerPermissionsButton)); st::peerPermissionsButton,
{}));
container->add( container->add(
object_ptr<Ui::DividerLabel>( object_ptr<Ui::DividerLabel>(
@ -645,7 +647,8 @@ void EditPeerPermissionsBox::addBannedButtons(
_peer, _peer,
ParticipantsBoxController::Role::Restricted); ParticipantsBoxController::Role::Restricted);
}, },
st::peerPermissionsButton)); st::peerPermissionsButton,
{}));
if (channel) { if (channel) {
container->add(EditPeerInfoBox::CreateButton( container->add(EditPeerInfoBox::CreateButton(
container, container,
@ -658,7 +661,8 @@ void EditPeerPermissionsBox::addBannedButtons(
_peer, _peer,
ParticipantsBoxController::Role::Kicked); ParticipantsBoxController::Role::Kicked);
}, },
st::peerPermissionsButton)); st::peerPermissionsButton,
{}));
} }
} }

View file

@ -7,8 +7,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/ */
#include "boxes/peers/edit_peer_type_box.h" #include "boxes/peers/edit_peer_type_box.h"
#include "apiwrap.h"
#include "api/api_invite_links.h"
#include "main/main_session.h" #include "main/main_session.h"
#include "boxes/add_contact_box.h" #include "boxes/add_contact_box.h"
#include "ui/boxes/confirm_box.h" #include "ui/boxes/confirm_box.h"
@ -19,7 +17,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/peers/edit_peer_invite_link.h" #include "boxes/peers/edit_peer_invite_link.h"
#include "boxes/peers/edit_peer_invite_links.h" #include "boxes/peers/edit_peer_invite_links.h"
#include "chat_helpers/emoji_suggestions_widget.h" #include "chat_helpers/emoji_suggestions_widget.h"
#include "core/application.h"
#include "data/data_channel.h" #include "data/data_channel.h"
#include "data/data_chat.h" #include "data/data_chat.h"
#include "data/data_peer.h" #include "data/data_peer.h"
@ -27,7 +24,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_changes.h" #include "data/data_changes.h"
#include "info/profile/info_profile_values.h" #include "info/profile/info_profile_values.h"
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "mainwindow.h"
#include "mtproto/sender.h" #include "mtproto/sender.h"
#include "ui/rp_widget.h" #include "ui/rp_widget.h"
#include "ui/special_buttons.h" #include "ui/special_buttons.h"
@ -35,7 +31,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/checkbox.h" #include "ui/widgets/checkbox.h"
#include "ui/widgets/input_fields.h" #include "ui/widgets/input_fields.h"
#include "ui/widgets/labels.h" #include "ui/widgets/labels.h"
#include "ui/widgets/popup_menu.h"
#include "ui/widgets/box_content_divider.h" #include "ui/widgets/box_content_divider.h"
#include "ui/wrap/padding_wrap.h" #include "ui/wrap/padding_wrap.h"
#include "ui/wrap/slide_wrap.h" #include "ui/wrap/slide_wrap.h"
@ -48,11 +43,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_info.h" #include "styles/style_info.h"
#include "styles/style_settings.h" #include "styles/style_settings.h"
#include <QtGui/QGuiApplication>
#include <QtGui/QClipboard>
#include <rpl/flatten_latest.h>
namespace { namespace {
class Controller : public base::has_weak_ptr { class Controller : public base::has_weak_ptr {
@ -209,21 +199,22 @@ void Controller::createContent() {
Ui::LayerOption::KeepOther); Ui::LayerOption::KeepOther);
}, },
st::manageGroupButton, st::manageGroupButton,
&st::infoIconInviteLinks)); { &st::infoIconInviteLinks, Settings::kIconLightOrange }));
AddSkip(_wrap.get()); AddSkip(_wrap.get());
AddDividerText(_wrap.get(), tr::lng_group_invite_manage_about()); AddDividerText(_wrap.get(), tr::lng_group_invite_manage_about());
if (!_linkOnly) { if (!_linkOnly) {
AddSkip(_wrap.get()); AddSkip(_wrap.get());
AddSubsectionTitle(_wrap.get(), tr::lng_manage_peer_no_forwards_title()); AddSubsectionTitle(
_wrap.get(),
tr::lng_manage_peer_no_forwards_title());
_controls.noForwards = _wrap->add(EditPeerInfoBox::CreateButton( _controls.noForwards = _wrap->add(EditPeerInfoBox::CreateButton(
_wrap.get(), _wrap.get(),
tr::lng_manage_peer_no_forwards(), tr::lng_manage_peer_no_forwards(),
rpl::single(QString()), rpl::single(QString()),
[=] {}, [] {},
st::manageGroupTopButtonWithText, st::peerPermissionsButton,
nullptr {}));
));
_controls.noForwards->toggleOn( _controls.noForwards->toggleOn(
rpl::single(_noForwardsSavedValue.value_or(false)) rpl::single(_noForwardsSavedValue.value_or(false))
)->toggledValue( )->toggledValue(

View file

@ -7,8 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/ */
#pragma once #pragma once
#include "boxes/abstract_box.h" #include "ui/layers/box_content.h"
#include "base/timer.h"
namespace style { namespace style {
struct SettingsCountButton; struct SettingsCountButton;

View file

@ -327,12 +327,12 @@ infoIconMediaLink: icon {{ "info/info_media_link", infoIconFg }};
infoIconMediaGroup: icon {{ "info/info_common_groups", infoIconFg }}; infoIconMediaGroup: icon {{ "info/info_common_groups", infoIconFg }};
infoIconMediaVoice: icon {{ "info/info_media_voice", infoIconFg }}; infoIconMediaVoice: icon {{ "info/info_media_voice", infoIconFg }};
infoIconMediaRound: icon {{ "info/info_media_round", infoIconFg }}; infoIconMediaRound: icon {{ "info/info_media_round", infoIconFg }};
infoIconRecentActions: icon {{ "info/edit/group_manage_actions", infoIconFg }}; infoIconRecentActions: icon {{ "info/edit/group_manage_actions", settingsIconFg }};
infoIconAdministrators: icon {{ "info/edit/group_manage_admins", infoIconFg }}; infoIconAdministrators: icon {{ "info/edit/group_manage_admins", settingsIconFg }};
infoIconBlacklist: icon {{ "info/info_blacklist", infoIconFg }}; infoIconInviteLinks: icon {{ "info/edit/group_manage_links", settingsIconFg }};
infoIconPermissions: icon {{ "info/edit/group_manage_permissions", infoIconFg }}; infoIconReactions: icon {{ "info/edit/group_manage_reactions", settingsIconFg }};
infoIconInviteLinks: icon {{ "info/edit/group_manage_links", infoIconFg }}; infoIconGroupType: icon {{ "info/edit/group_manage_type", settingsIconFg }};
infoIconReactions: icon {{ "info/edit/group_manage_reactions", infoIconFg }}; infoIconSignature: icon {{ "info/edit/channel_manage_signature", settingsIconFg }};
infoIconShare: icon {{ "info/info_share", infoIconFg }}; infoIconShare: icon {{ "info/info_share", infoIconFg }};
infoIconEdit: icon {{ "info/info_edit", infoIconFg }}; infoIconEdit: icon {{ "info/info_edit", infoIconFg }};
infoIconDelete: icon {{ "info/info_delete", infoIconFg }}; infoIconDelete: icon {{ "info/info_delete", infoIconFg }};
@ -544,23 +544,20 @@ managePeerButton: SettingsCountButton {
peerPermissionsButton: SettingsCountButton(managePeerButton) { peerPermissionsButton: SettingsCountButton(managePeerButton) {
button: SettingsButton(infoProfileButton) { button: SettingsButton(infoProfileButton) {
padding: margins(24px, 12px, 24px, 10px); padding: margins(22px, 12px, 24px, 10px);
} }
iconPosition: point(24px, 5px); iconPosition: point(24px, 5px);
} }
manageGroupButton: SettingsCountButton(managePeerButton) { manageGroupButton: SettingsCountButton(managePeerButton) {
button: SettingsButton(infoProfileButton) { button: SettingsButton(infoProfileButton) {
padding: margins(72px, 10px, 24px, 8px); padding: margins(60px, 10px, 24px, 8px);
} }
labelPosition: point(22px, 12px); labelPosition: point(22px, 12px);
iconPosition: point(20px, 4px); iconPosition: point(20px, 4px);
} }
manageGroupTopButtonWithText: SettingsCountButton(manageGroupButton) { manageGroupTopButtonWithText: SettingsCountButton(manageGroupButton) {
button: SettingsButton(infoProfileButton) {
padding: margins(22px, 10px, 24px, 8px);
}
labelPosition: point(22px, 10px); labelPosition: point(22px, 10px);
iconPosition: point(0px, 0px); iconPosition: point(0px, 0px);
} }
@ -607,7 +604,9 @@ editPeerHistoryVisibilityTopSkip: 8px;
editPeerPhotoMargins: margins(22px, 16px, 22px, 8px); editPeerPhotoMargins: margins(22px, 16px, 22px, 8px);
editPeerTitle: defaultInputField; editPeerTitle: defaultInputField;
editPeerTitleMargins: margins(27px, 21px, 22px, 8px); editPeerTitleMargins: margins(27px, 21px, 22px, 8px);
editPeerDescription: newGroupDescription; editPeerDescription: InputField(newGroupDescription) {
borderFg: transparent;
}
editPeerDescriptionMargins: margins(22px, 5px, 22px, 16px); editPeerDescriptionMargins: margins(22px, 5px, 22px, 16px);
editPeerPrivaciesMargins: margins(15px, 7px, 22px, 0px); editPeerPrivaciesMargins: margins(15px, 7px, 22px, 0px);
editPeerPrivacyTopSkip: 10px; editPeerPrivacyTopSkip: 10px;