@@ -35,8 +35,6 @@ public sealed partial class FileStatusList : GitModuleControl
35
35
36
36
private static readonly TimeSpan SelectedIndexChangeThrottleDuration = TimeSpan . FromMilliseconds ( 50 ) ;
37
37
38
- [ CanBeNull ] private static ImageList _images ;
39
-
40
38
private readonly TranslationString _diffWithParent = new TranslationString ( "Diff with:" ) ;
41
39
public readonly TranslationString CombinedDiff = new TranslationString ( "Combined Diff" ) ;
42
40
@@ -58,14 +56,22 @@ public FileStatusList()
58
56
FilterVisible = false ;
59
57
60
58
SelectFirstItemOnSetItems = true ;
61
- FileStatusListView . MouseMove += FileStatusListView_MouseMove ;
62
- FileStatusListView . MouseDown += FileStatusListView_MouseDown ;
63
59
64
- const int rowHeight = 18 ;
60
+ FileStatusListView . SmallImageList = CreateImageList ( ) ;
61
+ FileStatusListView . LargeImageList = CreateImageList ( ) ;
62
+
63
+ HandleVisibility_NoFilesLabel_FilterComboBox ( filesPresent : true ) ;
64
+ Controls . SetChildIndex ( NoFiles , 0 ) ;
65
+ NoFiles . Font = new Font ( SystemFonts . MessageBoxFont , FontStyle . Italic ) ;
66
+
67
+ _fullPathResolver = new FullPathResolver ( ( ) => Module . WorkingDir ) ;
68
+ _revisionTester = new GitRevisionTester ( _fullPathResolver ) ;
65
69
66
- if ( _images == null )
70
+ ImageList CreateImageList ( )
67
71
{
68
- _images = new ImageList
72
+ const int rowHeight = 18 ;
73
+
74
+ return new ImageList
69
75
{
70
76
ImageSize = DpiUtil . Scale ( new Size ( 16 , rowHeight ) ) , // Scale ImageSize and images scale automatically
71
77
Images =
@@ -87,28 +93,18 @@ public FileStatusList()
87
93
ScaleHeight ( Images . FileStatusUnknown ) // 14
88
94
}
89
95
} ;
90
- }
91
-
92
- FileStatusListView . SmallImageList = _images ;
93
- FileStatusListView . LargeImageList = _images ;
94
96
95
- HandleVisibility_NoFilesLabel_FilterComboBox ( filesPresent : true ) ;
96
- Controls . SetChildIndex ( NoFiles , 0 ) ;
97
- NoFiles . Font = new Font ( SystemFonts . MessageBoxFont , FontStyle . Italic ) ;
98
-
99
- _fullPathResolver = new FullPathResolver ( ( ) => Module . WorkingDir ) ;
100
- _revisionTester = new GitRevisionTester ( _fullPathResolver ) ;
101
-
102
- Bitmap ScaleHeight ( Bitmap input )
103
- {
104
- Debug . Assert ( input . Height < rowHeight , "Can only increase row height" ) ;
105
- var scaled = new Bitmap ( input . Width , rowHeight , input . PixelFormat ) ;
106
- using ( var g = Graphics . FromImage ( scaled ) )
97
+ Bitmap ScaleHeight ( Bitmap input )
107
98
{
108
- g . DrawImageUnscaled ( input , 0 , ( rowHeight - input . Height ) / 2 ) ;
109
- }
99
+ Debug . Assert ( input . Height < rowHeight , "Can only increase row height" ) ;
100
+ var scaled = new Bitmap ( input . Width , rowHeight , input . PixelFormat ) ;
101
+ using ( var g = Graphics . FromImage ( scaled ) )
102
+ {
103
+ g . DrawImageUnscaled ( input , 0 , ( rowHeight - input . Height ) / 2 ) ;
104
+ }
110
105
111
- return scaled ;
106
+ return scaled ;
107
+ }
112
108
}
113
109
}
114
110
0 commit comments