mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Merge tag 'v6.5.1' into dev
This commit is contained in:
@@ -714,6 +714,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());
|
||||
|
||||
@@ -725,16 +727,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,
|
||||
@@ -742,6 +746,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) {
|
||||
@@ -756,9 +763,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,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1145,7 +1153,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,
|
||||
@@ -1312,7 +1320,7 @@ Fn<void()> AboutGigagroupCallback(
|
||||
box->setTitle(tr::lng_gigagroup_convert_title());
|
||||
const auto addFeature = [&](rpl::producer<QString> text) {
|
||||
using namespace rpl::mappers;
|
||||
const auto prefix = QString::fromUtf8("\xE2\x80\xA2 ");
|
||||
const auto prefix = Ui::kQBullet + ' ';
|
||||
box->addRow(
|
||||
object_ptr<Ui::FlatLabel>(
|
||||
box,
|
||||
@@ -1463,10 +1471,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,
|
||||
|
||||
Reference in New Issue
Block a user