From 436f616fc20a329206fe91248f94fc6adc153ca8 Mon Sep 17 00:00:00 2001 From: Tomoyuki Aota Date: Sat, 19 Oct 2024 11:35:48 +0900 Subject: [PATCH 1/8] Put the details of the information for "By Shooting Time" in . --- src/app/app.module.ts | 2 ++ .../dir-tree-view-sort.service.ts | 4 +-- ...iew-sort-shooting-time-info.component.html | 21 ++++++++++------ ...iew-sort-shooting-time-info.component.scss | 25 +++++++++++++------ ...-view-sort-shooting-time-info.component.ts | 4 +-- 5 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index da03abeb..c8b120df 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -5,6 +5,7 @@ import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatExpansionModule } from '@angular/material/expansion'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatDialogModule } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; @@ -94,6 +95,7 @@ export function HttpLoaderFactory(http: HttpClient) { MatButtonModule, MatCheckboxModule, MatDialogModule, + MatExpansionModule, MatFormFieldModule, MatIconModule, MatInputModule, diff --git a/src/app/directory-tree-view/dir-tree-view-sort/dir-tree-view-sort.service.ts b/src/app/directory-tree-view/dir-tree-view-sort/dir-tree-view-sort.service.ts index 07e11f35..4a7b5954 100644 --- a/src/app/directory-tree-view/dir-tree-view-sort/dir-tree-view-sort.service.ts +++ b/src/app/directory-tree-view/dir-tree-view-sort/dir-tree-view-sort.service.ts @@ -148,8 +148,8 @@ export class DirTreeViewSortService { public showShootingTimeInfoDialog() { this.dialog.open(DirTreeViewSortShootingTimeInfoComponent, { - width: '600px', - height: '490px', + width: '800px', + height: '350px', panelClass: 'custom-dialog-container', disableClose: false, autoFocus: false, diff --git a/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.html b/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.html index f95144dd..85fdbc24 100644 --- a/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.html +++ b/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.html @@ -7,15 +7,22 @@ Note that folders are sorted by their names since there is no concept of "Shooting Time" of folders. -
-
-

Below are details for reference:

+ + + + @if (panelOpenState()) { + Below are details for reference: + } @else { + Click here to read details... + } + +

DateTimeOriginal in EXIF is the most trustworthy information about the time when the photo was taken.

DateTimeOriginal is written in most JPEG/HEIF/TIFF files by most cameras, but sometime it is missing.

-

The modified time always exists for files, and the modified time is often the time when the photo was taken, - so the modified time is used when DateTimeOriginal is not available.

-

Also, files other than JPEG/HEIF/TIFF do not have EXIF in the first place, so the modified time is used for such files.

-
+

The modified time of the file is often the time when the photo was taken, + so the modified time is used as an alternative when DateTimeOriginal is missing.

+

Also, files other than JPEG/HEIF/TIFF do not have EXIF in the first place, so the modified time is always used for such files.

+
+ + @if (detailsOpenState()) { +
+

Below are details for reference:

+

DateTimeOriginal in EXIF is the most trustworthy information about the time when the photo was taken.

+

DateTimeOriginal is written in most JPEG/HEIF/TIFF files by most cameras, but sometime it is missing.

+

The modified time of the file is often the time when the photo was taken, + so the modified time is used as an alternative when DateTimeOriginal is missing.

+

Also, files other than JPEG/HEIF/TIFF do not have EXIF in the first place, so the modified time is always used for such files.

+
+ } + + - diff --git a/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.scss b/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.scss index 643ee919..8248db7e 100644 --- a/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.scss +++ b/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.scss @@ -1,35 +1,37 @@ :host { box-sizing: border-box; - - $dialog-width: 840px; // Need to be the same value used in DirTreeViewSortService::showShootingTimeInfoDialog function - $scroll-bar-area-width: 20px; // The area for the scrollbar to appear without corrupting the layout - width: calc($dialog-width - $scroll-bar-area-width); - height: 100%; - padding: 20px 30px; display: grid; - grid: "message" 1fr - "close-button" auto - /auto; + grid: "dialog-header" auto + "dialog-body" 1fr + "dialog-footer" auto + /1fr; justify-items: center; - .message { grid-area: message; } - .close-button { grid-area: close-button; } + + .dialog-header { grid-area: dialog-header; } + .dialog-body { grid-area: dialog-body; } + .dialog-footer { grid-area: dialog-footer; } } -// Copied from using DevTools -@mixin mat-expansion-panel-like-style { - box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); - border-radius: 4px; +.dialog-header { + width: 100%; + box-sizing: border-box; + padding: 10px 20px; + border-bottom: 1px solid #7f7f7f; + background-color: #eeeeee; + font-size: 20px; } -.message { - margin: 10px 0 20px 0; +.dialog-body { + width: 100%; + box-sizing: border-box; + + overflow: auto; + padding: 24px; .message-main { margin-bottom: 30px; - padding: 24px; // Align with the padding of the content within - @include mat-expansion-panel-like-style; li { margin-bottom: 10px; @@ -41,12 +43,37 @@ } .message-details { + margin-top: 20px; + p { - margin: 5px 0; + margin: 10px 0; } } } +.expand-button-content { + display: flex; + gap: 5px; + align-items: center; + font-weight: normal; // Restore "font-weight: 500" given by mat-button to the default value +} + +.expanded-expand-icon { + transform: rotate(180deg); +} + +.dialog-footer { + width: 100%; + box-sizing: border-box; + padding: 10px 20px; + border-top: 1px solid #7f7f7f; + background-color: #eeeeee; + display: flex; + justify-content: end; +} + .close-button { width: 80px; + background-color: #7f7f7f; + color: whitesmoke; } diff --git a/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.ts b/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.ts index 20f45a45..84cef848 100644 --- a/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.ts +++ b/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.ts @@ -6,5 +6,5 @@ import { Component, signal } from '@angular/core'; styleUrl: './dir-tree-view-sort-shooting-time-info.component.scss' }) export class DirTreeViewSortShootingTimeInfoComponent { - public readonly panelOpenState = signal(false); + public readonly detailsOpenState = signal(false); } From 656541773f8131b748f31ca9185ee8488454b04c Mon Sep 17 00:00:00 2001 From: Tomoyuki Aota Date: Sat, 19 Oct 2024 17:46:38 +0900 Subject: [PATCH 6/8] Update comment. --- .../dir-tree-view-sort-shooting-time-info.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.scss b/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.scss index 8248db7e..614ad664 100644 --- a/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.scss +++ b/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.scss @@ -55,7 +55,7 @@ display: flex; gap: 5px; align-items: center; - font-weight: normal; // Restore "font-weight: 500" given by mat-button to the default value + font-weight: normal; // Restore "font-weight: 500" given by mat-button to the browser's default value } .expanded-expand-icon { From 5ee94ee850f7ea5fe064605ffcad5a32e9a657f0 Mon Sep 17 00:00:00 2001 From: Tomoyuki Aota Date: Sat, 19 Oct 2024 18:33:36 +0900 Subject: [PATCH 7/8] Update Close button color. Update the width of the details button. Refactoring for SCSS file. --- ...-view-sort-shooting-time-info.component.html | 4 ++-- ...-view-sort-shooting-time-info.component.scss | 17 ++++++----------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.html b/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.html index 66bdf192..966b6e49 100644 --- a/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.html +++ b/src/app/directory-tree-view/dir-tree-view-sort/shooting-time-info/dir-tree-view-sort-shooting-time-info.component.html @@ -11,8 +11,8 @@ Note that folders are sorted by their names since there is no concept of "Shooting Time" of folders. -