modal menus design fixes
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2022-06-09 14:26:02 -07:00
parent c3848553d7
commit 8429907650
2 changed files with 104 additions and 79 deletions

View File

@ -257,58 +257,66 @@ class _ContactsViewState extends State<ContactsView> {
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded(
Spacer(), child: Tooltip(
Expanded( message: AppLocalizations.of(context)!.tooltipAddContact,
child: Tooltip( child: ElevatedButton(
message: AppLocalizations.of(context)!.tooltipAddContact, style: ElevatedButton.styleFrom(
child: ElevatedButton( minimumSize: Size.fromWidth(double.infinity),
child: Text(AppLocalizations.of(context)!.addContact, semanticsLabel: AppLocalizations.of(context)!.addContact), maximumSize: Size.fromWidth(400),
onPressed: () { shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
_pushAddContact(false); ),
}, child: Text(
))), AppLocalizations.of(context)!.addContact,
Spacer() semanticsLabel: AppLocalizations.of(context)!.addContact,
]), textAlign: TextAlign.center,
),
onPressed: () {
_pushAddContact(false);
},
))),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded(
Spacer(), child: Tooltip(
Expanded( message: groupsEnabled ? AppLocalizations.of(context)!.addServerTooltip : AppLocalizations.of(context)!.thisFeatureRequiresGroupExpermientsToBeEnabled,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: Size.fromWidth(double.infinity),
maximumSize: Size.fromWidth(400),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
),
child: Text(AppLocalizations.of(context)!.addServerTitle, semanticsLabel: AppLocalizations.of(context)!.addServerTitle, textAlign: TextAlign.center),
onPressed: groupsEnabled
? () {
_pushAddContact(false);
}
: null,
)),
),
SizedBox(
height: 20,
),
Expanded(
child: Tooltip( child: Tooltip(
message: groupsEnabled ? AppLocalizations.of(context)!.addServerTooltip : AppLocalizations.of(context)!.thisFeatureRequiresGroupExpermientsToBeEnabled, message: groupsEnabled ? AppLocalizations.of(context)!.createGroupTitle : AppLocalizations.of(context)!.thisFeatureRequiresGroupExpermientsToBeEnabled,
child: ElevatedButton( child: ElevatedButton(
child: Text(AppLocalizations.of(context)!.addServerTitle, semanticsLabel: AppLocalizations.of(context)!.addServerTitle), style: ElevatedButton.styleFrom(
minimumSize: Size.fromWidth(double.infinity),
maximumSize: Size.fromWidth(400),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
),
child: Text(AppLocalizations.of(context)!.createGroupTitle, semanticsLabel: AppLocalizations.of(context)!.createGroupTitle, textAlign: TextAlign.center),
onPressed: groupsEnabled onPressed: groupsEnabled
? () { ? () {
_pushAddContact(false); _pushAddContact(true);
} }
: null, : null,
)), ))),
),
Spacer()
]),
SizedBox(
height: 20,
),
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
Spacer(),
Expanded(
child: Tooltip(
message: groupsEnabled ? AppLocalizations.of(context)!.createGroupTitle : AppLocalizations.of(context)!.thisFeatureRequiresGroupExpermientsToBeEnabled,
child: ElevatedButton(
child: Text(AppLocalizations.of(context)!.createGroupTitle, semanticsLabel: AppLocalizations.of(context)!.createGroupTitle),
onPressed: groupsEnabled
? () {
_pushAddContact(true);
}
: null,
))),
Spacer()
]),
], ],
))), ))),
))); )));

View File

@ -194,49 +194,66 @@ class _ProfileMgrViewState extends State<ProfileMgrView> {
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
Spacer(),
Expanded(
child: ElevatedButton(
child: Text(AppLocalizations.of(context)!.addProfileTitle, semanticsLabel: AppLocalizations.of(context)!.addProfileTitle),
onPressed: () {
_pushAddProfile(context);
},
)),
Spacer()
]),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded(
Spacer(), child: ElevatedButton(
Expanded( style: ElevatedButton.styleFrom(
child: Tooltip( minimumSize: Size(double.infinity, 20),
message: AppLocalizations.of(context)!.importProfileTooltip, maximumSize: Size(400, 20),
child: ElevatedButton( shape: RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
child: Text(AppLocalizations.of(context)!.importProfile, semanticsLabel: AppLocalizations.of(context)!.importProfile), ),
onPressed: () { child: Text(
// 10GB profiles should be enough for anyone? AppLocalizations.of(context)!.addProfileTitle,
showFilePicker(context, MaxGeneralFileSharingSize, (file) { semanticsLabel: AppLocalizations.of(context)!.addProfileTitle,
showPasswordDialog(context, AppLocalizations.of(context)!.importProfile, AppLocalizations.of(context)!.importProfile, (password) { style: TextStyle(fontWeight: FontWeight.bold),
Navigator.popUntil(context, (route) => route.isFirst); ),
Provider.of<FlwtchState>(context, listen: false).cwtch.ImportProfile(file.path, password).then((value) { onPressed: () {
if (value == "") { _pushAddProfile(context);
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.successfullyImportedProfile.replaceFirst("%profile", file.path))); },
ScaffoldMessenger.of(context).showSnackBar(snackBar); )),
} else { SizedBox(
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.failedToImportProfile)); height: 20,
ScaffoldMessenger.of(context).showSnackBar(snackBar); ),
} Expanded(
}); child: Tooltip(
message: AppLocalizations.of(context)!.importProfileTooltip,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: Size(double.infinity, 20),
maximumSize: Size(400, 20),
shape: RoundedRectangleBorder(
side: BorderSide(color: Provider.of<Settings>(context).theme.defaultButtonActiveColor, width: 2.0),
borderRadius: BorderRadius.horizontal(left: Radius.circular(180), right: Radius.circular(180))),
primary: Provider.of<Settings>(context).theme.backgroundMainColor,
),
child:
Text(AppLocalizations.of(context)!.importProfile, semanticsLabel: AppLocalizations.of(context)!.importProfile, style: TextStyle(fontWeight: FontWeight.bold)),
onPressed: () {
// 10GB profiles should be enough for anyone?
showFilePicker(context, MaxGeneralFileSharingSize, (file) {
showPasswordDialog(context, AppLocalizations.of(context)!.importProfile, AppLocalizations.of(context)!.importProfile, (password) {
Navigator.popUntil(context, (route) => route.isFirst);
Provider.of<FlwtchState>(context, listen: false).cwtch.ImportProfile(file.path, password).then((value) {
if (value == "") {
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.successfullyImportedProfile.replaceFirst("%profile", file.path)));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
} else {
final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.failedToImportProfile));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
}
}); });
}, () {}, () {}); });
}, }, () {}, () {});
))), },
Spacer() ))),
]), SizedBox(
height: 20,
),
], ],
))), ))),
))); )));