• R/O
  • SSH
  • HTTPS

scfiler: Commit


Commit MetaInfo

Revisão90 (tree)
Hora2009-05-19 01:17:58
Autoryuki_sc

Mensagem de Log

サムネイルモードとスペースで選択モードの組み合わせで動作がおかしかったのを修正

Mudança Sumário

Diff

--- SCFiler2/FileView.cs (revision 89)
+++ SCFiler2/FileView.cs (revision 90)
@@ -166,14 +166,6 @@
166166 this.previewPictureBox.Visible = false;
167167 this.viewMode = ViewMode.Normal;
168168 break;
169- //case ViewMode.ListInPreviewMode:
170- // this.listView.Visible = true;
171- // this.listView.Dock = DockStyle.Fill;
172- // this.listView.View = View.Details;
173- // this.previewPictureBox.Visible = false;
174- // this.viewMode = ViewMode.ListInPreviewMode;
175- // anotherView.setViewMode(ViewMode.PreviewInPreviewMode);
176- // break;
177169 case ViewMode.PreviewInPreviewMode:
178170 this.previewPictureBox.Visible = true;
179171 this.previewPictureBox.Dock = DockStyle.Fill;
@@ -689,10 +681,10 @@
689681 /// <param name="sender"></param>
690682 /// <param name="e"></param>
691683 private void fileListView_KeyDown(object sender, KeyEventArgs e) {
692- if (this.listView.View == View.LargeIcon && (e.KeyCode == Keys.Left || e.KeyCode == Keys.Right) &&
693- !e.Shift && !e.Control && !e.Alt) {
694- return;
695- }
684+ //if (this.listView.View == View.LargeIcon && (e.KeyCode == Keys.Left || e.KeyCode == Keys.Right) &&
685+ // !e.Shift && !e.Control && !e.Alt) {
686+ // return;
687+ //}
696688
697689 //ListViewコントローラの優先処理
698690 ListViewController.Result result = currentListViewController.KeyProcessingBeforeKeyCommand(e);
--- SCFiler2/EasySelectListViewController.cs (revision 89)
+++ SCFiler2/EasySelectListViewController.cs (revision 90)
@@ -35,7 +35,7 @@
3535 exchangeListAtThumbnailView.Add(Keys.PageDown, "^{PGDN}");
3636 exchangeListAtThumbnailView.Add(Keys.Home, "^{HOME}");
3737 exchangeListAtThumbnailView.Add(Keys.End, "^{END}");
38- exchangeListAtThumbnailView.Add(Keys.Space, "^( {DOWN})");
38+ exchangeListAtThumbnailView.Add(Keys.Space, "^ ");
3939 }
4040
4141 public override void Initialize() {
@@ -44,13 +44,17 @@
4444 allItemSearcher.Add(ItemSearcher.SearchType.Basic, new BasicItemSearcher(this, targetListView));
4545 allItemSearcher.Add(ItemSearcher.SearchType.Prefix, new PrefixItemSearcher(this, targetListView));
4646
47- this.exchangeList = (this.parentView.ViewMode == ViewMode.ThumbnailMode) ? exchangeListAtThumbnailView : exchangeListAtDetailView;
48-
4947 //現在のアイテムを選択状態にして一つ下に移動する
50- if (this.targetListView.FocusedItem.Selected) {
51- SendKeys.Send(exchangeListAtDetailView[Keys.Down]);
48+ if (this.parentView.ViewMode == ViewMode.ThumbnailMode) {
49+ if (!this.targetListView.FocusedItem.Selected) {
50+ this.targetListView.FocusedItem.Selected = true;
51+ }
5252 } else {
53- SendKeys.Send(exchangeListAtDetailView[Keys.Space]);
53+ if (this.targetListView.FocusedItem.Selected) {
54+ SendKeys.Send(exchangeListAtDetailView[Keys.Down]);
55+ } else {
56+ SendKeys.Send(exchangeListAtDetailView[Keys.Space]);
57+ }
5458 }
5559
5660 }
@@ -77,6 +81,8 @@
7781 }
7882
7983 override public Result KeyProcessingBeforeKeyCommand(KeyEventArgs keyEvent) {
84+ this.exchangeList = (this.parentView.ViewMode == ViewMode.ThumbnailMode) ? exchangeListAtThumbnailView : exchangeListAtDetailView;
85+
8086 if (this.exchangeList.ContainsKey(keyEvent.KeyCode) && keyEvent.Control) {
8187 return Result.DelegateToOriginalControl;
8288 }
@@ -104,7 +110,7 @@
104110 }
105111
106112 //上下左右キーなどはキーイベントを変換して発行する(コントロールオリジナルの制御を生かしてキーのみ入れ替える)
107- if (this.targetListView.Items.Count != 0 && !keyEvent.Shift && !keyEvent.Control && !keyEvent.Alt && exchangeListAtDetailView.ContainsKey(keyEvent.KeyCode)) {
113+ if (this.targetListView.Items.Count != 0 && !keyEvent.Shift && !keyEvent.Control && !keyEvent.Alt && exchangeList.ContainsKey(keyEvent.KeyCode)) {
108114 SendKeys.Send(exchangeList[keyEvent.KeyCode]);
109115 return Result.EventHandled;
110116 }
--- SCFiler2/ImageUtil.cs (nonexistent)
+++ SCFiler2/ImageUtil.cs (revision 90)
@@ -0,0 +1,48 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Text;
4+using System.Drawing;
5+using System.Drawing.Imaging;
6+using SCFiler2.ItemInterface;
7+using SusiePlugin.Util;
8+
9+namespace SCFiler2.Util {
10+ internal class ImageUtil {
11+ static private List<string> supportExtensions = new List<string>();
12+ static private Susie susie = new Susie();
13+
14+ /// <summary>
15+ /// 拡張子のファイルがOSが最初から(Susieプラグインなしで)読み込める形式
16+ /// </summary>
17+ /// <param name="extension">調べる拡張子</param>
18+ /// <returns>対応しているならtrue</returns>
19+ static private bool isSupportedByOS(string extension) {
20+ return supportExtensions.Contains(extension);
21+ }
22+
23+ //スタティックイニシャライザ
24+ static ImageUtil() {
25+ ImageCodecInfo[] codecs = ImageCodecInfo.GetImageDecoders();
26+ foreach (ImageCodecInfo info in codecs) {
27+ string[] ext = info.FilenameExtension.Split(';');
28+ supportExtensions.AddRange(ext);
29+ }
30+ }
31+
32+ /// <summary>
33+ /// itemが表す画像ファイルを読み込む
34+ /// 拡張子が正しくないファイルの場合はOutOfMemoryExceptionがでるかもしれないが本メソッドは対応しないので、呼び出し元で対応
35+ /// </summary>
36+ /// <param name="item"></param>
37+ /// <returns>Imageインスタンス。読み込めない場合はnull</returns>
38+ static public Image getImage(IFilerItem item) {
39+ Bitmap image = susie.GetPicture(item.FullName);
40+
41+ //Susieで表示できないときはWindowsの標準デコーダで表示を試みる
42+ if (image == null) {
43+ image = (Bitmap)Bitmap.FromFile(item.FullName);
44+ }
45+ return image;
46+ }
47+ }
48+}
Show on old repository browser