Support dark theme in image history

This commit is contained in:
Jaex 2019-07-03 09:35:34 +03:00
parent b02f40b06d
commit 2676eddbf7
3 changed files with 44 additions and 9 deletions

View file

@ -28,6 +28,10 @@ protected override void Dispose(bool disposing)
/// </summary>
private void InitializeComponent()
{
Manina.Windows.Forms.ImageListView.ImageListViewColumnHeader ımageListViewColumnHeader1 = new Manina.Windows.Forms.ImageListView.ImageListViewColumnHeader(Manina.Windows.Forms.ColumnType.Name, "Name", 100, 0, true);
Manina.Windows.Forms.ImageListView.ImageListViewColumnHeader ımageListViewColumnHeader2 = new Manina.Windows.Forms.ImageListView.ImageListViewColumnHeader(Manina.Windows.Forms.ColumnType.FileSize, "Size", 100, 1, true);
Manina.Windows.Forms.ImageListView.ImageListViewColumnHeader ımageListViewColumnHeader3 = new Manina.Windows.Forms.ImageListView.ImageListViewColumnHeader(Manina.Windows.Forms.ColumnType.Dimensions, "Dimensions", 100, 2, true);
Manina.Windows.Forms.ImageListView.ImageListViewColumnHeader ımageListViewColumnHeader4 = new Manina.Windows.Forms.ImageListView.ImageListViewColumnHeader(Manina.Windows.Forms.ColumnType.FilePath, "Path", 100, 3, true);
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ImageHistoryForm));
this.tscMain = new System.Windows.Forms.ToolStripContainer();
this.ilvImages = new Manina.Windows.Forms.ImageListView();
@ -63,18 +67,37 @@ private void InitializeComponent()
this.ilvImages.AllowDuplicateFileNames = true;
this.ilvImages.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.ilvImages.CacheLimit = "100MB";
this.ilvImages.ColumnHeaderFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
ımageListViewColumnHeader1.Comparer = null;
ımageListViewColumnHeader1.DisplayIndex = 0;
ımageListViewColumnHeader1.Grouper = null;
ımageListViewColumnHeader1.Key = "";
ımageListViewColumnHeader1.Type = Manina.Windows.Forms.ColumnType.Name;
ımageListViewColumnHeader2.Comparer = null;
ımageListViewColumnHeader2.DisplayIndex = 1;
ımageListViewColumnHeader2.Grouper = null;
ımageListViewColumnHeader2.Key = "";
ımageListViewColumnHeader2.Type = Manina.Windows.Forms.ColumnType.FileSize;
ımageListViewColumnHeader3.Comparer = null;
ımageListViewColumnHeader3.DisplayIndex = 2;
ımageListViewColumnHeader3.Grouper = null;
ımageListViewColumnHeader3.Key = "";
ımageListViewColumnHeader3.Type = Manina.Windows.Forms.ColumnType.Dimensions;
ımageListViewColumnHeader4.Comparer = null;
ımageListViewColumnHeader4.DisplayIndex = 3;
ımageListViewColumnHeader4.Grouper = null;
ımageListViewColumnHeader4.Key = "";
ımageListViewColumnHeader4.Type = Manina.Windows.Forms.ColumnType.FilePath;
this.ilvImages.Columns.AddRange(new Manina.Windows.Forms.ImageListView.ImageListViewColumnHeader[] {
new Manina.Windows.Forms.ImageListView.ImageListViewColumnHeader(Manina.Windows.Forms.ColumnType.Name, "", 100, 0, true),
new Manina.Windows.Forms.ImageListView.ImageListViewColumnHeader(Manina.Windows.Forms.ColumnType.FileSize, "", 100, 1, true),
new Manina.Windows.Forms.ImageListView.ImageListViewColumnHeader(Manina.Windows.Forms.ColumnType.Dimensions, "", 100, 2, true),
new Manina.Windows.Forms.ImageListView.ImageListViewColumnHeader(Manina.Windows.Forms.ColumnType.FilePath, "", 100, 3, true)});
ımageListViewColumnHeader1,
ımageListViewColumnHeader2,
ımageListViewColumnHeader3,
ımageListViewColumnHeader4});
resources.ApplyResources(this.ilvImages, "ilvImages");
this.ilvImages.GroupHeaderFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold);
this.ilvImages.Name = "ilvImages";
this.ilvImages.PersistentCacheDirectory = "";
this.ilvImages.PersistentCacheSize = ((long)(100));
this.ilvImages.ThumbnailSize = new System.Drawing.Size(100, 100);
this.ilvImages.UseWIC = true;
this.ilvImages.ItemDoubleClick += new Manina.Windows.Forms.ItemDoubleClickEventHandler(this.ilvImages_ItemDoubleClick);
this.ilvImages.SelectionChanged += new System.EventHandler(this.ilvImages_SelectionChanged);
this.ilvImages.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ilvImages_KeyDown);
@ -100,8 +123,8 @@ private void InitializeComponent()
// tstbSearch
//
this.tstbSearch.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tstbSearch.Name = "tstbSearch";
resources.ApplyResources(this.tstbSearch, "tstbSearch");
this.tstbSearch.Name = "tstbSearch";
this.tstbSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tstbSearch_KeyDown);
//
// tsbSearch

View file

@ -56,6 +56,15 @@ public ImageHistoryForm(string historyPath, ImageHistorySettings settings, Actio
ilvImages.View = (View)Settings.ViewMode;
ilvImages.ThumbnailSize = Settings.ThumbnailSize;
if (ShareXResources.ExperimentalDarkTheme)
{
ilvImages.BorderStyle = BorderStyle.None;
ilvImages.Colors.BackColor = ShareXResources.DarkBackgroundVariantColor;
ilvImages.Colors.BorderColor = ShareXResources.DarkBorderColor;
ilvImages.Colors.ForeColor = ShareXResources.DarkTextColor;
ilvImages.Colors.SelectedForeColor = ShareXResources.DarkTextColor;
}
him = new HistoryItemManager(uploadFile, editImage);
him.GetHistoryItems += him_GetHistoryItems;
ilvImages.ContextMenuStrip = him.cmsHistory;

View file

@ -148,7 +148,7 @@
<value>ilvImages</value>
</data>
<data name="&gt;&gt;ilvImages.Type" xml:space="preserve">
<value>Manina.Windows.Forms.ImageListView, ImageListView, Version=11.0.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>Manina.Windows.Forms.ImageListView, ImageListView, Version=13.4.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;ilvImages.Parent" xml:space="preserve">
<value>tscMain.ContentPanel</value>
@ -219,6 +219,9 @@
<data name="tslSearch.Text" xml:space="preserve">
<value>Search:</value>
</data>
<data name="tstbSearch.Font" type="System.Drawing.Font, System.Drawing">
<value>Segoe UI, 9pt</value>
</data>
<data name="tstbSearch.Size" type="System.Drawing.Size, System.Drawing">
<value>300, 25</value>
</data>
@ -250,7 +253,7 @@
<value>3, 0</value>
</data>
<data name="tsMain.Size" type="System.Drawing.Size, System.Drawing">
<value>472, 25</value>
<value>441, 25</value>
</data>
<data name="tsMain.TabIndex" type="System.Int32, mscorlib">
<value>0</value>