feat: Edit displayname and attribution for sticker packs
This commit is contained in:
parent
87ca3c1f1f
commit
489402be91
2 changed files with 27 additions and 2 deletions
|
|
@ -171,6 +171,28 @@ class EmotesSettingsController extends State<EmotesSettings> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void submitDisplaynameAction() {
|
||||||
|
if (readonly) return;
|
||||||
|
packDisplayNameController.text = packDisplayNameController.text.trim();
|
||||||
|
final input = packDisplayNameController.text;
|
||||||
|
|
||||||
|
setState(() {
|
||||||
|
pack!.pack.displayName = input;
|
||||||
|
showSave = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void submitAttributionAction() {
|
||||||
|
if (readonly) return;
|
||||||
|
packAttributionController.text = packAttributionController.text.trim();
|
||||||
|
final input = packAttributionController.text;
|
||||||
|
|
||||||
|
setState(() {
|
||||||
|
pack!.pack.attribution = input;
|
||||||
|
showSave = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void submitImageAction(
|
void submitImageAction(
|
||||||
String oldImageCode,
|
String oldImageCode,
|
||||||
ImagePackImageContent image,
|
ImagePackImageContent image,
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,8 @@ class EmotesSettingsView extends StatelessWidget {
|
||||||
child: TextField(
|
child: TextField(
|
||||||
maxLength: 256,
|
maxLength: 256,
|
||||||
controller: controller.packDisplayNameController,
|
controller: controller.packDisplayNameController,
|
||||||
readOnly: true, //controller.readonly,
|
readOnly: controller.readonly,
|
||||||
|
onSubmitted: (_) => controller.submitDisplaynameAction(),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
counter: const SizedBox.shrink(),
|
counter: const SizedBox.shrink(),
|
||||||
hintText: controller.stateKey,
|
hintText: controller.stateKey,
|
||||||
|
|
@ -173,7 +174,8 @@ class EmotesSettingsView extends StatelessWidget {
|
||||||
child: TextField(
|
child: TextField(
|
||||||
maxLength: 256,
|
maxLength: 256,
|
||||||
controller: controller.packAttributionController,
|
controller: controller.packAttributionController,
|
||||||
readOnly: true, //controller.readonly,
|
readOnly: controller.readonly,
|
||||||
|
onSubmitted: (_) => controller.submitAttributionAction(),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
counter: const SizedBox.shrink(),
|
counter: const SizedBox.shrink(),
|
||||||
labelText: L10n.of(context).attribution,
|
labelText: L10n.of(context).attribution,
|
||||||
|
|
@ -360,6 +362,7 @@ class _EmoteImage extends StatelessWidget {
|
||||||
width: size,
|
width: size,
|
||||||
height: size,
|
height: size,
|
||||||
isThumbnail: true,
|
isThumbnail: true,
|
||||||
|
animated: true,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue