Skip to content

Commit 3c658e3

Browse files
committed
Extracted app icon text, fixed issues
Tweaked sizes and meta tags based unpon ipad testing. Fixed reduced sizes not being cleaned up.
1 parent 55b6a78 commit 3c658e3

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

app/Settings/AppSettingsStore.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function storeFromUpdateRequest(Request $request, string $category)
2525

2626
protected function updateAppIcon(Request $request): void
2727
{
28-
$sizes = [128, 64, 32];
28+
$sizes = [180, 128, 64, 32];
2929

3030
// Update icon image if set
3131
if ($request->hasFile('app_icon')) {
@@ -35,6 +35,7 @@ protected function updateAppIcon(Request $request): void
3535
setting()->put('app-icon', $image->url);
3636

3737
foreach ($sizes as $size) {
38+
$this->destroyExistingSettingImage('app-icon-' . $size);
3839
$icon = $this->imageRepo->saveNew($iconFile, 'system', 0, $size, $size);
3940
setting()->put('app-icon-' . $size, $icon->url);
4041
}

app/Uploads/ImageRepo.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ public function getEntityFiltered(
123123
public function saveNew(UploadedFile $uploadFile, string $type, int $uploadedTo = 0, int $resizeWidth = null, int $resizeHeight = null, bool $keepRatio = true): Image
124124
{
125125
$image = $this->imageService->saveNewFromUpload($uploadFile, $type, $uploadedTo, $resizeWidth, $resizeHeight, $keepRatio);
126-
$this->loadThumbs($image);
126+
127+
if ($type !== 'system') {
128+
$this->loadThumbs($image);
129+
}
127130

128131
return $image;
129132
}

resources/lang/en/settings.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
'app_custom_html_disabled_notice' => 'Custom HTML head content is disabled on this settings page to ensure any breaking changes can be reverted.',
3535
'app_logo' => 'Application Logo',
3636
'app_logo_desc' => 'This is used in the application header bar, among other areas. This image should be 86px in height. Large images will be scaled down.',
37+
'app_icon' => 'Application Icon',
38+
'app_icon_desc' => 'This icon is used for browser tabs and shortcut icons. This should be a 256px square PNG image.',
3739
'app_primary_color' => 'Application Primary Color',
3840
'app_primary_color_desc' => 'Sets the primary color for the application including the banner, buttons, and links.',
3941
'app_homepage' => 'Application Homepage',

resources/views/layouts/base.blade.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ class="{{ setting()->getForCurrentUser('dark-mode-enabled') ? 'dark-mode ' : ''
66
<title>{{ isset($pageTitle) ? $pageTitle . ' | ' : '' }}{{ setting('app-name') }}</title>
77

88
<!-- Meta -->
9+
<meta charset="utf-8">
910
<meta name="viewport" content="width=device-width">
1011
<meta name="token" content="{{ csrf_token() }}">
1112
<meta name="base-url" content="{{ url('/') }}">
12-
<meta charset="utf-8">
13+
<meta name="theme-color" content="{{ setting('app-color') }}"/>
1314

1415
<!-- Social Cards Meta -->
1516
<meta property="og:title" content="{{ isset($pageTitle) ? $pageTitle . ' | ' : '' }}{{ setting('app-name') }}">
@@ -21,10 +22,12 @@ class="{{ setting()->getForCurrentUser('dark-mode-enabled') ? 'dark-mode ' : ''
2122
<link rel="stylesheet" media="print" href="{{ versioned_asset('dist/print-styles.css') }}">
2223

2324
<!-- Icons -->
24-
<link rel="icon" type="image/png" sizes="256x256" href="{{ setting('app-icon') ?? url('/icon.png') }}">
25-
<link rel="icon" type="image/png" sizes="128x128" href="{{ setting('app-icon-128') ?? url('/icon-128.png') }}">
26-
<link rel="icon" type="image/png" sizes="64x64" href="{{ setting('app-icon-64') ?? url('/icon-64.png') }}">
27-
<link rel="icon" type="image/png" sizes="32x32" href="{{ setting('app-icon-32') ?? url('/icon-32.png') }}">
25+
<link rel="icon" type="image/png" sizes="256x256" href="{{ setting('app-icon') ?: url('/icon.png') }}">
26+
<link rel="icon" type="image/png" sizes="180x180" href="{{ setting('app-icon-180') ?: url('/icon-180.png') }}">
27+
<link rel="apple-touch-icon" sizes="180x180" href="{{ setting('app-icon-180') ?: url('/icon-180.png') }}">
28+
<link rel="icon" type="image/png" sizes="128x128" href="{{ setting('app-icon-128') ?: url('/icon-128.png') }}">
29+
<link rel="icon" type="image/png" sizes="64x64" href="{{ setting('app-icon-64') ?: url('/icon-64.png') }}">
30+
<link rel="icon" type="image/png" sizes="32x32" href="{{ setting('app-icon-32') ?: url('/icon-32.png') }}">
2831

2932
@yield('head')
3033

resources/views/settings/customization.blade.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,8 @@
5555

5656
<div class="grid half gap-xl">
5757
<div>
58-
<label class="setting-list-label">{{ 'Application Icon' }}</label>
59-
<p class="small">
60-
This icon is used for browser tabs and shortcut icons.
61-
This should be a 256px square PNG image.
62-
</p>
58+
<label class="setting-list-label">{{ trans('settings.app_icon') }}</label>
59+
<p class="small">{{ trans('settings.app_icon_desc') }}</p>
6360
</div>
6461
<div class="pt-xs">
6562
@include('form.image-picker', [

0 commit comments

Comments
 (0)