Skip to content

Commit

Permalink
Improve template dialog and home page
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Dec 18, 2024
1 parent da0fcc2 commit 646588c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 52 deletions.
16 changes: 0 additions & 16 deletions api/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.6"
dart_mappable:
dependency: transitive
description:
name: dart_mappable
sha256: f69a961ae8589724ebb542e588f228ae844c5f78028899cbe2cc718977c1b382
url: "https://pub.dev"
source: hosted
version: "4.3.0"
dart_style:
dependency: transitive
description:
Expand Down Expand Up @@ -591,14 +583,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.2"
type_plus:
dependency: transitive
description:
name: type_plus
sha256: d5d1019471f0d38b91603adb9b5fd4ce7ab903c879d2fbf1a3f80a630a03fcc9
url: "https://pub.dev"
source: hosted
version: "2.1.1"
typed_data:
dependency: transitive
description:
Expand Down
26 changes: 12 additions & 14 deletions app/lib/dialogs/template.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,14 @@ class _TemplateDialogState extends State<TemplateDialog> {
);
},
),
...widget.bloc == null
? []
: [
IconButton(
onPressed: () => _showCreateDialog(widget.bloc!),
tooltip: AppLocalizations.of(context).create,
icon: const PhosphorIcon(PhosphorIconsLight.floppyDisk),
)
],
],
actions: [
if (widget.bloc == null)
ElevatedButton.icon(
onPressed: () => _showCreateDialog(widget.bloc!),
label: Text(AppLocalizations.of(context).create),
icon: const PhosphorIcon(PhosphorIconsLight.floppyDisk),
)
],
content: FutureBuilder<List<NoteData>>(
future: _templatesFuture,
Expand Down Expand Up @@ -381,7 +380,7 @@ class _TemplateItem extends StatelessWidget {
? AspectRatio(
aspectRatio: kThumbnailRatio,
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
borderRadius: BorderRadius.circular(8),
child: Image.memory(
thumbnail,
fit: BoxFit.cover,
Expand All @@ -394,10 +393,9 @@ class _TemplateItem extends StatelessWidget {
initialValue: metadata.name,
subtitle: Text(metadata.description),
leading: SizedBox(
height: 64,
width: 96,
width: 112,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Checkbox(
value: selected,
Expand All @@ -409,7 +407,7 @@ class _TemplateItem extends StatelessWidget {
}
},
),
const SizedBox(width: 8),
const SizedBox(width: 2),
Flexible(child: leading),
],
),
Expand Down
5 changes: 4 additions & 1 deletion app/lib/views/files/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ class FilesViewState extends State<FilesView> {
);
}
}),
const SizedBox(height: 8),
BlocBuilder<SettingsCubit, ButterflySettings>(
buildWhen: (previous, current) => previous.starred != current.starred,
builder: (context, settings) =>
Expand All @@ -617,7 +618,8 @@ class FilesViewState extends State<FilesView> {
return const Center(child: CircularProgressIndicator());
}
if (!snapshot.hasData) {
return Text(AppLocalizations.of(context).noElements);
return Center(
child: Text(AppLocalizations.of(context).noElements));
}
final entity = snapshot.data;
if (entity is! FileSystemDirectory<NoteData>) {
Expand Down Expand Up @@ -688,6 +690,7 @@ class FilesViewState extends State<FilesView> {
);
}),
),
const SizedBox(height: 32),
]),
);
}
Expand Down
34 changes: 17 additions & 17 deletions app/lib/views/navigator/areas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,23 @@ class _AreasViewState extends State<AreasView> {
? area.rect.overlaps(viewportRect)
: current.name == area.name,
actions: [
...buildGeneralAreaContextMenu(
bloc,
area,
context.read<SettingsCubit>(),
state.renderers
.where(
(e) => e.area == area)
.map((e) => e.transform(
position: -area.position
.toOffset(),
relative: true))
.map((e) => e?.element)
.nonNulls
.toList(),
pop: false)(context)
.map((e) => buildMenuItem(
context, e, false, false)),
MenuItemButton(
leadingIcon: const PhosphorIcon(
PhosphorIconsLight.trash),
Expand All @@ -209,23 +226,6 @@ class _AreasViewState extends State<AreasView> {
AppLocalizations.of(context)
.delete),
),
...buildGeneralAreaContextMenu(
bloc,
area,
context.read<SettingsCubit>(),
state.renderers
.where(
(e) => e.area == area)
.map((e) => e.transform(
position: -area.position
.toOffset(),
relative: true))
.map((e) => e?.element)
.nonNulls
.toList(),
pop: false)(context)
.map((e) => buildMenuItem(
context, e, false, false))
],
);
});
Expand Down
8 changes: 4 additions & 4 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,10 @@ packages:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: "9b78450b89f059e96c9ebb355fa6b3df1d6b330436e0b885fb49594c41721398"
sha256: "615a505aef59b151b46bbeef55b36ce2b6ed299d160c51d84281946f0aa0ce0e"
url: "https://pub.dev"
source: hosted
version: "2.0.23"
version: "2.0.24"
flutter_secure_storage:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1225,10 +1225,10 @@ packages:
dependency: "direct main"
description:
name: shared_preferences
sha256: "95f9997ca1fb9799d494d0cb2a780fd7be075818d59f00c43832ed112b158a82"
sha256: "3c7e73920c694a436afaf65ab60ce3453d91f84208d761fbd83fc21182134d93"
url: "https://pub.dev"
source: hosted
version: "2.3.3"
version: "2.3.4"
shared_preferences_android:
dependency: transitive
description:
Expand Down
3 changes: 3 additions & 0 deletions metadata/en-US/changelogs/125.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
* Add area options to context menu in area navigator page
* Move create button to the top right of the template dialog
* Improve mobile color picker
* Align no elements text to the center
* Fix spacing in home page
* Fix baking not working correctly when zooming in
* Fix docker image ([#769](https://github.com/LinwoodDev/Butterfly/pull/769))

Expand Down

0 comments on commit 646588c

Please sign in to comment.