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(
|
||||
String oldImageCode,
|
||||
ImagePackImageContent image,
|
||||
|
|
|
|||
|
|
@ -159,7 +159,8 @@ class EmotesSettingsView extends StatelessWidget {
|
|||
child: TextField(
|
||||
maxLength: 256,
|
||||
controller: controller.packDisplayNameController,
|
||||
readOnly: true, //controller.readonly,
|
||||
readOnly: controller.readonly,
|
||||
onSubmitted: (_) => controller.submitDisplaynameAction(),
|
||||
decoration: InputDecoration(
|
||||
counter: const SizedBox.shrink(),
|
||||
hintText: controller.stateKey,
|
||||
|
|
@ -173,7 +174,8 @@ class EmotesSettingsView extends StatelessWidget {
|
|||
child: TextField(
|
||||
maxLength: 256,
|
||||
controller: controller.packAttributionController,
|
||||
readOnly: true, //controller.readonly,
|
||||
readOnly: controller.readonly,
|
||||
onSubmitted: (_) => controller.submitAttributionAction(),
|
||||
decoration: InputDecoration(
|
||||
counter: const SizedBox.shrink(),
|
||||
labelText: L10n.of(context).attribution,
|
||||
|
|
@ -360,6 +362,7 @@ class _EmoteImage extends StatelessWidget {
|
|||
width: size,
|
||||
height: size,
|
||||
isThumbnail: true,
|
||||
animated: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue