forked from firka/firka
Gyermek védelem 🏳️🌈🏳️⚧️
This commit is contained in:
@@ -19,6 +19,7 @@ const classAvgOnGraph = 1006;
|
||||
const leftHandedMode = 1007;
|
||||
const language = 1008;
|
||||
const appIcon = 1009;
|
||||
const child_protection = 1010;
|
||||
|
||||
bool always() {
|
||||
return true;
|
||||
@@ -131,6 +132,13 @@ class SettingsStore {
|
||||
"settings_padding": SettingsPadding(0, 24, always),
|
||||
"icon_preview": SettingsAppIconPreview(0, always),
|
||||
"settings_padding2": SettingsPadding(0, 24, always),
|
||||
"child_protection": SettingsBoolean(
|
||||
child_protection,
|
||||
FirkaIconType.majesticons,
|
||||
Majesticon.shieldSolid,
|
||||
l10n.s_ci_child_protection,
|
||||
true,
|
||||
never),
|
||||
"icon_picker": SettingsAppIconPicker(
|
||||
0,
|
||||
"original",
|
||||
@@ -169,6 +177,16 @@ class SettingsStore {
|
||||
"gay",
|
||||
"lesb",
|
||||
"bi"
|
||||
],
|
||||
l10n.s_ci_icon_g6: [
|
||||
"lgbtq_f",
|
||||
"lgbtqp_f",
|
||||
"trans_f",
|
||||
"enby_f",
|
||||
"ace_f",
|
||||
"gay_f",
|
||||
"lesb_f",
|
||||
"bi_f"
|
||||
]
|
||||
},
|
||||
always),
|
||||
|
||||
Submodule firka/lib/l10n updated: 52abcba808...24104a853f
@@ -54,11 +54,12 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
}
|
||||
|
||||
List<Widget> createWidgetTree(
|
||||
Iterable<SettingsItem> items, SettingsStore settings) {
|
||||
Iterable<SettingsItem> items, SettingsStore settings,
|
||||
{bool forceRender = false}) {
|
||||
var widgets = List<Widget>.empty(growable: true);
|
||||
|
||||
for (var item in items) {
|
||||
if (!item.visibilityProvider()) continue;
|
||||
if (!forceRender && !item.visibilityProvider()) continue;
|
||||
if (item is SettingsGroup) {
|
||||
widgets.addAll(createWidgetTree(item.children.values, settings));
|
||||
|
||||
@@ -271,6 +272,19 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
List<Widget> pWidgets = [];
|
||||
|
||||
for (var group in item.iconGroups.keys) {
|
||||
if (widget.data.settings
|
||||
.group("settings")
|
||||
.subGroup("customization")
|
||||
.subGroup("icon_picker")
|
||||
.boolean("child_protection")) {
|
||||
if (group == widget.data.l10n.s_ci_icon_g5) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (group == widget.data.l10n.s_ci_icon_g6) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
List<Widget> groupIcons = [];
|
||||
for (var icon in item.iconGroups[group]!) {
|
||||
var active = icon == activeIcon;
|
||||
@@ -328,6 +342,23 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
style:
|
||||
appStyle.fonts.H_14px.apply(color: appStyle.colors.textPrimary),
|
||||
));
|
||||
|
||||
if (group == widget.data.l10n.s_ci_icon_g5 ||
|
||||
group == widget.data.l10n.s_ci_icon_g6) {
|
||||
var settingsWidgets = createWidgetTree([
|
||||
widget.data.settings
|
||||
.group("settings")
|
||||
.subGroup("customization")
|
||||
.subGroup("icon_picker")["child_protection"]
|
||||
as SettingsBoolean
|
||||
], settings, forceRender: true);
|
||||
|
||||
pWidgets.add(SizedBox(height: 12));
|
||||
for (var w in settingsWidgets) {
|
||||
pWidgets.add(w);
|
||||
}
|
||||
}
|
||||
|
||||
pWidgets.add(SizedBox(height: 12));
|
||||
pWidgets.add(SizedBox(
|
||||
height: (groupIcons.length / 4).ceil() * 100,
|
||||
|
||||
Reference in New Issue
Block a user