Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
Reorganize and rename image assets (#712)
Browse files Browse the repository at this point in the history
- organize image assets into subdirs named after pages to make it clear
  where each image is used
- use more generic and flavor-friendly asset names that don't assume
  the content (e.g. "mascot" -> "logo") of the vanilla image assets

Ref: #700
Ref: ubuntu-mate/ubuntu-mate-installer#1
  • Loading branch information
jpnurmi committed Mar 3, 2022
1 parent d76d9f7 commit 8c56c95
Show file tree
Hide file tree
Showing 49 changed files with 30 additions and 20 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/ubuntu_desktop_installer/lib/installer.dart
Expand Up @@ -178,7 +178,7 @@ class _UbuntuDesktopInstallerLoadingPage extends StatelessWidget {
const SizedBox(width: 20),
Expanded(
child: SvgPicture.asset(
'assets/mascot_white.svg',
'assets/welcome/logo.svg',
height: height / 4,
color: Theme.of(context).primaryColor,
),
Expand Down
Expand Up @@ -29,7 +29,7 @@ class ChooseYourLookPage extends StatelessWidget {
children: [
_ThemeOptionCard(
width: width / 3,
assetName: 'assets/Theme_thumbnails-Light.png',
assetName: 'assets/choose_your_look/light-theme.png',
selected: Theme.of(context).brightness == Brightness.light,
onTap: () {
settings.applyTheme(Brightness.light);
Expand All @@ -41,7 +41,7 @@ class ChooseYourLookPage extends StatelessWidget {
),
_ThemeOptionCard(
width: width / 3,
assetName: 'assets/Theme_thumbnails-Dark.png',
assetName: 'assets/choose_your_look/dark-theme.png',
selected: Theme.of(context).brightness == Brightness.dark,
onTap: () {
settings.applyTheme(Brightness.dark);
Expand Down
Expand Up @@ -42,7 +42,7 @@ class InstallationCompletePage extends StatelessWidget {
child: const CircleAvatar(
radius: 80,
backgroundImage: AssetImage(
'assets/version.png',
'assets/installation_complete/logo.png',
),
),
),
Expand Down
Expand Up @@ -78,7 +78,7 @@ class InstallationSlidesModel extends ChangeNotifier with SystemShutdown {
/// loading slide images
Future<void> precacheSlideImages(BuildContext context) {
final assets = _resolveAssetsDirectory();
return Directory('$assets/assets/slides')
return Directory('$assets/assets/installation_slides')
.list(recursive: true)
.forEach((slide) {
if (slide is File) {
Expand Down
Expand Up @@ -93,7 +93,7 @@ class _SelectGuidedStoragePageState extends State<SelectGuidedStoragePage> {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
SvgPicture.asset(
'assets/cof_orange_hex.svg',
'assets/select_guided_storage/ubuntu.svg',
width: 48,
height: 48,
),
Expand Down
Expand Up @@ -40,7 +40,8 @@ class TryOrInstallPageState extends State<TryOrInstallPage> {
Expanded(
child: OptionCard(
selected: model.option == Option.repairUbuntu,
image: FlavorImage.asset('assets/repair-wrench.png'),
image:
FlavorImage.asset('assets/try_or_install/repair-wrench.png'),
title: Text(lang.repairInstallation),
body: Text(lang.repairInstallationDescription),
onSelected: () => model.selectOption(Option.repairUbuntu),
Expand All @@ -50,7 +51,8 @@ class TryOrInstallPageState extends State<TryOrInstallPage> {
Expanded(
child: OptionCard(
selected: model.option == Option.tryUbuntu,
image: FlavorImage.asset('assets/steering-wheel.png'),
image:
FlavorImage.asset('assets/try_or_install/steering-wheel.png'),
title: Text(lang.tryUbuntu(flavor.name)),
body: Text(lang.tryUbuntuDescription(flavor.name)),
onSelected: () => model.selectOption(Option.tryUbuntu),
Expand All @@ -60,7 +62,7 @@ class TryOrInstallPageState extends State<TryOrInstallPage> {
Expanded(
child: OptionCard(
selected: model.option == Option.installUbuntu,
image: FlavorImage.asset('assets/hard-drive.png'),
image: FlavorImage.asset('assets/try_or_install/hard-drive.png'),
title: Text(lang.installUbuntu(flavor.name)),
body: Text(lang.installUbuntuDescription(flavor.name)),
onSelected: () => model.selectOption(Option.installUbuntu),
Expand Down
Expand Up @@ -39,7 +39,7 @@ class TurnOffBitLockerPage extends StatelessWidget {
onLinkTap: (url, _, __, ___) => launchUrl(url!),
),
const SizedBox(height: 60),
SvgPicture.asset('assets/qrbitlocker.svg')
SvgPicture.asset('assets/turn_off_bitlocker/qr-code.svg')
],
),
actions: [
Expand Down
Expand Up @@ -44,7 +44,7 @@ class TurnOffRSTPage extends StatelessWidget {
),
const SizedBox(height: 60),
SvgPicture.asset(
'assets/rst.svg',
'assets/turn_off_rst/qr-code.svg',
color: Theme.of(context).textTheme.bodyText1!.color,
),
],
Expand Down
Expand Up @@ -87,7 +87,7 @@ class _WelcomePageState extends State<WelcomePage> {
const SizedBox(width: 20),
Expanded(
child: SvgPicture.asset(
'assets/mascot_white.svg',
'assets/welcome/logo.svg',
height: height / 4,
color: Theme.of(context).primaryColor,
),
Expand Down
Expand Up @@ -13,9 +13,10 @@ const _kInsets = EdgeInsets.fromLTRB(72, 56, 48, 24);
const _kSmallSpacing = 8.0;
const _kLargeSpacing = 16.0;

String _slideAsset(String name) => 'assets/slides/$name.png';
String _slideIcon(String name) => 'assets/slides/icons/$name.png';
String _slideScreenshot(String name) => 'assets/slides/screenshots/$name.png';
String _slideAsset(String name) => 'assets/installation_slides/$name.png';
String _slideIcon(String name) => 'assets/installation_slides/icons/$name.png';
String _slideScreenshot(String name) =>
'assets/installation_slides/screenshots/$name.png';

/// The list of default installation slides.
final defaultSlides = <Slide>[
Expand Down
13 changes: 10 additions & 3 deletions packages/ubuntu_desktop_installer/pubspec.yaml
Expand Up @@ -66,6 +66,13 @@ flutter:
uses-material-design: true
assets:
- assets/
- assets/slides/
- assets/slides/icons/
- assets/slides/screenshots/
- assets/choose_your_look/
- assets/installation_complete/
- assets/installation_slides/
- assets/installation_slides/icons/
- assets/installation_slides/screenshots/
- assets/select_guided_storage/
- assets/try_or_install/
- assets/turn_off_bitlocker/
- assets/turn_off_rst/
- assets/welcome/
Expand Up @@ -24,15 +24,15 @@ void main() {

final lightOptionCard = find.widgetWithImage(
YaruSelectableContainer,
AssetImage('assets/Theme_thumbnails-Light.png'),
AssetImage('assets/choose_your_look/light-theme.png'),
);
expect(lightOptionCard, findsOneWidget);
await tester.tap(lightOptionCard);
verify(settings.applyTheme(Brightness.light));

final darkOptionCard = find.widgetWithImage(
YaruSelectableContainer,
AssetImage('assets/Theme_thumbnails-Dark.png'),
AssetImage('assets/choose_your_look/dark-theme.png'),
);
expect(darkOptionCard, findsOneWidget);
await tester.tap(darkOptionCard);
Expand Down

0 comments on commit 8c56c95

Please sign in to comment.