Support all required deep links.

This commit is contained in:
John Preston
2026-01-09 17:12:54 +04:00
parent 808a9e6fb9
commit 1e5a93249c
49 changed files with 1247 additions and 293 deletions
@@ -712,6 +712,8 @@ template <typename Flags>
return checkView;
};
auto highlightWidget = QPointer<Ui::RpWidget>();
const auto highlightFlags = descriptor.highlightFlags;
for (const auto &nestedWithLabel : descriptor.labels) {
Assert(!nestedWithLabel.nested.empty());
@@ -723,16 +725,18 @@ template <typename Flags>
: object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>{ nullptr };
const auto verticalLayout = wrap ? wrap->entity() : container.get();
auto innerChecks = std::vector<not_null<Ui::AbstractCheckView*>>();
auto sectionFlags = Flags();
for (const auto &entry : nestedWithLabel.nested) {
const auto c = addCheckbox(verticalLayout, isInner, entry);
if (isInner) {
innerChecks.push_back(c);
sectionFlags |= entry.flags;
}
}
if (wrap) {
const auto raw = wrap.data();
raw->hide(anim::type::instant);
AddInnerToggle(
const auto toggle = AddInnerToggle(
container,
st,
innerChecks,
@@ -740,6 +744,9 @@ template <typename Flags>
*nestedWithLabel.nestingLabel,
std::nullopt,
{ nestedWithLabel.nested.front().icon });
if (highlightFlags && (sectionFlags & highlightFlags)) {
highlightWidget = toggle;
}
container->add(std::move(wrap));
container->widthValue(
) | rpl::on_next([=](int w) {
@@ -754,9 +761,10 @@ template <typename Flags>
}
return {
nullptr,
value,
state->anyChanges.events() | rpl::map(value)
.widget = nullptr,
.value = value,
.changes = state->anyChanges.events() | rpl::map(value),
.highlightWidget = highlightWidget,
};
}
@@ -1143,7 +1151,7 @@ void ShowEditPeerPermissionsBox(
Ui::AddSubsectionTitle(
inner,
tr::lng_rights_default_restrictions_header());
auto [checkboxes, getRestrictions, changes] = CreateEditRestrictions(
auto [checkboxes, getRestrictions, changes, highlightWidget] = CreateEditRestrictions(
inner,
restrictions,
disabledMessages,
@@ -1461,10 +1469,12 @@ ChatAdminRights AdminRightsForOwnershipTransfer(
EditFlagsControl<PowerSaving::Flags> CreateEditPowerSaving(
QWidget *parent,
PowerSaving::Flags flags,
rpl::producer<QString> forceDisabledMessage) {
rpl::producer<QString> forceDisabledMessage,
PowerSaving::Flags highlightFlags) {
auto widget = object_ptr<Ui::VerticalLayout>(parent);
auto descriptor = Settings::PowerSavingLabels();
descriptor.forceDisabledMessage = std::move(forceDisabledMessage);
descriptor.highlightFlags = highlightFlags;
auto result = CreateEditFlags(
widget.data(),
flags,