Skip to content

Commit cdf481f

Browse files
committed
fix: ページの並び順でフォルダーと圧縮ファイルの区別がされていない不具合修正 (#1868)
1 parent e38dd76 commit cdf481f

8 files changed

Lines changed: 23 additions & 9 deletions

File tree

NeeView/BookOperation/BookOperation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,13 @@ public void ToggleMediaPlay()
238238
public bool CanMoveToChildBook()
239239
{
240240
var page = Book?.CurrentPage;
241-
return page != null && page.PageType == PageType.Folder;
241+
return page != null && page.PageType.IsFolder();
242242
}
243243

244244
public void MoveToChildBook(object sender)
245245
{
246246
var page = Book?.CurrentPage;
247-
if (page != null && page.PageType == PageType.Folder)
247+
if (page != null && page.PageType.IsFolder())
248248
{
249249
_bookHub.RequestLoad(sender, page.ArchiveEntry.SystemPath, null, BookLoadOption.IsBook | BookLoadOption.SkipSamePlace, true);
250250
}

NeeView/Page/ArchivePageContent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public ArchivePageContent(ArchiveEntry archiveEntry, BookMemoryService? bookMemo
1313
{
1414
}
1515

16-
public override PageType PageType => PageType.Folder;
16+
public override PageType PageType => ArchiveEntry.IsDirectory ? PageType.Folder : PageType.Archive;
1717

1818
public override bool IsFileContent => true;
1919

NeeView/Page/PageContent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public PageContentState State
6464

6565
public virtual PageType PageType => PageType.File;
6666

67-
public virtual bool IsBook => PageType == PageType.Folder;
67+
public virtual bool IsBook => PageType.IsFolder();
6868

6969
public virtual bool IsFileContent => false;
7070

NeeView/Page/PageType.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@
33
public enum PageType
44
{
55
Folder,
6+
Archive,
67
File,
78
Empty,
89
}
10+
11+
public static class PageTypeExtensions
12+
{
13+
public static bool IsFolder(this PageType pageType)
14+
{
15+
return pageType == PageType.Folder || pageType == PageType.Archive;
16+
}
17+
}
918
}

NeeView/PageViewHistory/PageViewRecorder.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ private void WritePageViewedRecord(DateTime now)
6868
case PageType.Folder:
6969
_writeBuffer.Append("Folder");
7070
break;
71+
case PageType.Archive:
72+
_writeBuffer.Append("Archive");
73+
break;
7174
case PageType.File:
7275
_writeBuffer.Append("File");
7376
break;

NeeView/SidePanels/PageList/PageListBox.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ private void PageList_KeyDown(object? sender, KeyEventArgs e)
300300
else if (key == Key.Down)
301301
{
302302
// 選択ブックに移動
303-
if (page != null && page.PageType == PageType.Folder)
303+
if (page != null && page.PageType.IsFolder())
304304
{
305305
BookHub.Current.RequestLoad(this, page.ArchiveEntry.SystemPath, null, BookLoadOption.IsBook | BookLoadOption.SkipSamePlace, true);
306306
}
@@ -394,7 +394,7 @@ private void PageListItem_MouseLeftButtonUp(object? sender, MouseButtonEventArgs
394394
// 項目ダブルクリック
395395
private void PageListItem_MouseDoubleClick(object? sender, MouseButtonEventArgs e)
396396
{
397-
if ((sender as ListBoxItem)?.Content is Page page && page.PageType == PageType.Folder)
397+
if ((sender as ListBoxItem)?.Content is Page page && page.PageType.IsFolder())
398398
{
399399
BookHub.Current.RequestLoad(this, page.ArchiveEntry.SystemPath, null, BookLoadOption.IsBook | BookLoadOption.SkipSamePlace, true);
400400
e.Handled = true;
@@ -577,7 +577,7 @@ public class ArchivePageToVisibilityConverter : IValueConverter
577577
{
578578
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
579579
{
580-
return (value is Page page && page.PageType == PageType.Folder) ? Visibility.Visible : Visibility.Collapsed;
580+
return (value is Page page && page.PageType.IsFolder()) ? Visibility.Visible : Visibility.Collapsed;
581581
}
582582

583583
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
@@ -595,7 +595,7 @@ public class ArchivePageToFolderImageSourceConverter : IValueConverter
595595

596596
public object? Convert(object value, Type targetType, object parameter, CultureInfo culture)
597597
{
598-
if (value is Page page && page.PageType == PageType.Folder)
598+
if (value is Page page && page.PageType.IsFolder())
599599
{
600600
if (page.ArchiveEntry.IsDirectory)
601601
{

docs/en-us/changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ Context menu registration to Explorer is done in the settings window, just like
6161
- View: Fixed a bug (#1821) where a white line would sometimes appear on the edge when changing from full screen to maximized window.
6262
- Panel: Fixed HOME/END key behavior when panel thumbnails are displayed (#1817)
6363
- Bookmarks: Fixed a bug where renaming in the bookmark panel was sometimes not possible. Renaming in the bookmark panel no longer opens a book (#1811)
64-
- Page List: Fixed a bug where page list thumbnails sometimes did not load (#1816)
64+
- PageList: Fixed a bug where page list thumbnails sometimes did not load (#1816)
65+
- PageList: Fixed an issue where folders and compressed files were not distinguished (#1868)
6566
- History: Fixed a bug where history information was not updated when opening a book from history (#1818)
6667

6768

docs/ja-jp/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
- パネル:パネルサムネイル表示時のHOME/ENDキーの挙動を修正 (#1817)
6363
- ブックマーク:ブックマークパネルで名前変更できないことがある不具合修正。ブックマークパネルでは名前変更でブックを開かないようにした (#1811)
6464
- ページリスト:ページリストのサムネイルが読み込まれないことがある不具合修正 (#1816)
65+
- ページリスト:フォルダーと圧縮ファイルの区別がされていない不具合修正 (#1868)
6566
- 履歴:履歴からブックを開いた場合、履歴情報が更新されないことがある不具合修正 (#1818)
6667

6768

0 commit comments

Comments
 (0)