Skip to content

Commit

Permalink
Merge branch 'develop' into l10n_develop
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed May 19, 2024
2 parents 0f4ed03 + 5ff5d89 commit f8e3d71
Show file tree
Hide file tree
Showing 16 changed files with 440 additions and 485 deletions.
135 changes: 64 additions & 71 deletions app/lib/dialogs/background/dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,77 +30,70 @@ class BackgroundDialog extends StatelessWidget {
if (state is! DocumentLoadSuccess) return Container();
var background = state.page.backgrounds.firstOrNull;

return AlertDialog(
content: SizedBox(
width: 600,
height: 600,
child: DefaultTabController(
length: 2,
child: Column(
children: [
Header(
title: Text(AppLocalizations.of(context).background),
leading: const PhosphorIcon(PhosphorIconsLight.image),
actions: [
IconButton(
tooltip: AppLocalizations.of(context).help,
icon: const PhosphorIcon(
PhosphorIconsLight.sealQuestion),
onPressed: () => openHelp(['background']),
),
],
),
TabBar(
tabAlignment: TabAlignment.fill,
tabs: [
(
PhosphorIconsLight.globe,
AppLocalizations.of(context).general,
),
(
PhosphorIconsLight.gear,
AppLocalizations.of(context).properties,
),
]
.map((e) => HorizontalTab(
icon: PhosphorIcon(e.$1),
label: Text(e.$2),
))
.toList(),
),
const SizedBox(height: 8),
Expanded(
child: StatefulBuilder(builder: (context, setState) {
return TabBarView(
children: [
_GeneralBackgroundPropertiesView(
value: background,
onChanged: (value) =>
setState(() => background = value)),
if (background != null) ...[
background!.map(
texture: (e) =>
_TextureBackgroundPropertiesView(
value: e,
onChanged: (value) =>
setState(() => background = value)),
image: (e) => _ImageBackgroundPropertiesView(
value: e,
onChanged: (value) =>
setState(() => background = value)),
svg: (e) => _SvgBackgroundPropertiesView(
value: e,
onChanged: (value) =>
setState(() => background = value)),
),
] else
const SizedBox(),
],
);
}),
),
],
),
return ResponsiveAlertDialog(
constraints: const BoxConstraints(maxWidth: 600, maxHeight: 800),
title: Text(AppLocalizations.of(context).background),
leading: const PhosphorIcon(PhosphorIconsLight.image),
headerActions: [
IconButton(
tooltip: AppLocalizations.of(context).help,
icon: const PhosphorIcon(PhosphorIconsLight.sealQuestion),
onPressed: () => openHelp(['background']),
),
],
content: DefaultTabController(
length: 2,
child: Column(
children: [
TabBar(
tabAlignment: TabAlignment.fill,
tabs: [
(
PhosphorIconsLight.globe,
AppLocalizations.of(context).general,
),
(
PhosphorIconsLight.gear,
AppLocalizations.of(context).properties,
),
]
.map((e) => HorizontalTab(
icon: PhosphorIcon(e.$1),
label: Text(e.$2),
))
.toList(),
),
const SizedBox(height: 8),
Expanded(
child: StatefulBuilder(builder: (context, setState) {
return TabBarView(
children: [
_GeneralBackgroundPropertiesView(
value: background,
onChanged: (value) =>
setState(() => background = value)),
if (background != null) ...[
background!.map(
texture: (e) => _TextureBackgroundPropertiesView(
value: e,
onChanged: (value) =>
setState(() => background = value)),
image: (e) => _ImageBackgroundPropertiesView(
value: e,
onChanged: (value) =>
setState(() => background = value)),
svg: (e) => _SvgBackgroundPropertiesView(
value: e,
onChanged: (value) =>
setState(() => background = value)),
),
] else
const SizedBox(),
],
);
}),
),
],
),
),
actions: [
Expand Down
5 changes: 3 additions & 2 deletions app/lib/dialogs/export/general.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class _GeneralExportDialogState extends State<GeneralExportDialog> {
Widget build(BuildContext context) {
return Builder(builder: (context) {
return Dialog(
child: Container(
child: ConstrainedBox(
constraints: const BoxConstraints(maxHeight: 600, maxWidth: 1000),
child: Column(
children: [
Expand All @@ -166,7 +166,8 @@ class _GeneralExportDialogState extends State<GeneralExportDialog> {
children: [
Expanded(
child: LayoutBuilder(builder: (context, constraints) {
var isMobile = constraints.maxWidth < 600;
var isMobile =
constraints.maxWidth < LeapBreakpoints.compact;
if (isMobile) {
return ListView(
children: [
Expand Down
Loading

0 comments on commit f8e3d71

Please sign in to comment.