diff --git a/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs b/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs index 4b8a44ffb..7bd8d2547 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs +++ b/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs @@ -63,6 +63,8 @@ private void InitializeComponent() this.tsbSettings = new System.Windows.Forms.ToolStripButton(); this.scMain = new ShareX.HelpersLib.SplitContainerCustomSplitter(); this.pbThumbnail = new ShareX.HelpersLib.MyPictureBox(); + this.pgHistoryItemInfo = new System.Windows.Forms.PropertyGrid(); + this.scHistoryItemInfo = new ShareX.HelpersLib.SplitContainerCustomSplitter(); this.tscHistory.ContentPanel.SuspendLayout(); this.tscHistory.TopToolStripPanel.SuspendLayout(); this.tscHistory.SuspendLayout(); @@ -72,6 +74,10 @@ private void InitializeComponent() this.scMain.Panel1.SuspendLayout(); this.scMain.Panel2.SuspendLayout(); this.scMain.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.scHistoryItemInfo)).BeginInit(); + this.scHistoryItemInfo.Panel1.SuspendLayout(); + this.scHistoryItemInfo.Panel2.SuspendLayout(); + this.scHistoryItemInfo.SuspendLayout(); this.SuspendLayout(); // // tscHistory @@ -315,7 +321,7 @@ private void InitializeComponent() // // scMain.Panel2 // - this.scMain.Panel2.Controls.Add(this.pbThumbnail); + this.scMain.Panel2.Controls.Add(this.scHistoryItemInfo); this.scMain.SplitterColor = System.Drawing.Color.White; this.scMain.SplitterLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(189)))), ((int)(((byte)(189))))); // @@ -329,6 +335,29 @@ private void InitializeComponent() this.pbThumbnail.PictureBoxBackColor = System.Drawing.SystemColors.Control; this.pbThumbnail.ShowImageSizeLabel = true; // + // pgHistoryItemInfo + // + resources.ApplyResources(this.pgHistoryItemInfo, "pgHistoryItemInfo"); + this.pgHistoryItemInfo.Name = "pgHistoryItemInfo"; + this.pgHistoryItemInfo.PropertySort = System.Windows.Forms.PropertySort.NoSort; + this.pgHistoryItemInfo.ToolbarVisible = false; + // + // scHistoryItemInfo + // + resources.ApplyResources(this.scHistoryItemInfo, "scHistoryItemInfo"); + this.scHistoryItemInfo.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.scHistoryItemInfo.Name = "scHistoryItemInfo"; + // + // scHistoryItemInfo.Panel1 + // + this.scHistoryItemInfo.Panel1.Controls.Add(this.pbThumbnail); + // + // scHistoryItemInfo.Panel2 + // + this.scHistoryItemInfo.Panel2.Controls.Add(this.pgHistoryItemInfo); + this.scHistoryItemInfo.SplitterColor = System.Drawing.Color.White; + this.scHistoryItemInfo.SplitterLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(189)))), ((int)(((byte)(189))))); + // // HistoryForm // resources.ApplyResources(this, "$this"); @@ -354,6 +383,10 @@ private void InitializeComponent() this.scMain.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit(); this.scMain.ResumeLayout(false); + this.scHistoryItemInfo.Panel1.ResumeLayout(false); + this.scHistoryItemInfo.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.scHistoryItemInfo)).EndInit(); + this.scHistoryItemInfo.ResumeLayout(false); this.ResumeLayout(false); } @@ -393,5 +426,7 @@ private void InitializeComponent() private System.Windows.Forms.Button btnAdvancedSearchReset; private System.Windows.Forms.ToolStripButton tsbCopyStats; private System.Windows.Forms.ToolStripSeparator tss2; + private System.Windows.Forms.PropertyGrid pgHistoryItemInfo; + private HelpersLib.SplitContainerCustomSplitter scHistoryItemInfo; } } \ No newline at end of file diff --git a/ShareX.HistoryLib/Forms/HistoryForm.cs b/ShareX.HistoryLib/Forms/HistoryForm.cs index 771468be0..82a738f32 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.cs +++ b/ShareX.HistoryLib/Forms/HistoryForm.cs @@ -65,12 +65,14 @@ public HistoryForm(string historyPath, HistorySettings settings, Action il.Images.Add(Resources.globe); lvHistory.SmallImageList = il; - him = new HistoryItemManager(uploadFile, editImage); + him = new HistoryItemManager(uploadFile, editImage, ShowMoreInfo); him.GetHistoryItems += him_GetHistoryItems; lvHistory.ContextMenuStrip = him.cmsHistory; pbThumbnail.Reset(); lvHistory.FillLastColumn(); + scHistoryItemInfo.SplitterWidth = 7; // Because of bug must be assigned here again + scHistoryItemInfo.Panel2Collapsed = true; if (Settings.RememberSearchText) { @@ -282,6 +284,11 @@ private void UpdateControls() { UpdatePictureBox(); } + + if (!scHistoryItemInfo.Panel2Collapsed) + { + pgHistoryItemInfo.SelectedObject = historyItem; + } } private void UpdatePictureBox() @@ -525,6 +532,12 @@ private void lvHistory_ItemDrag(object sender, ItemDragEventArgs e) } } + private void ShowMoreInfo(HistoryItem historyItem) + { + pgHistoryItemInfo.SelectedObject = historyItem; + scHistoryItemInfo.Panel2Collapsed = false; + } + #endregion Form events } } \ No newline at end of file diff --git a/ShareX.HistoryLib/Forms/HistoryForm.resx b/ShareX.HistoryLib/Forms/HistoryForm.resx index c2aa23eba..6079b2c0d 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.resx +++ b/ShareX.HistoryLib/Forms/HistoryForm.resx @@ -954,6 +954,18 @@ 100 + + Fill + + + True + + + 0, 0 + + + Horizontal + Fill @@ -961,7 +973,7 @@ 0, 0 - 628, 661 + 627, 475 3 @@ -973,11 +985,86 @@ ShareX.HelpersLib.MyPictureBox, ShareX.HelpersLib, Version=13.5.1.0, Culture=neutral, PublicKeyToken=null - scMain.Panel2 + scHistoryItemInfo.Panel1 0 + + scHistoryItemInfo.Panel1 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + scHistoryItemInfo + + + 0 + + + Fill + + + False + + + 0, 0 + + + 627, 179 + + + 0 + + + pgHistoryItemInfo + + + System.Windows.Forms.PropertyGrid, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + scHistoryItemInfo.Panel2 + + + 0 + + + scHistoryItemInfo.Panel2 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + scHistoryItemInfo + + + 1 + + + 627, 661 + + + 475 + + + 7 + + + 5 + + + scHistoryItemInfo + + + ShareX.HelpersLib.SplitContainerCustomSplitter, ShareX.HelpersLib, Version=13.5.1.0, Culture=neutral, PublicKeyToken=null + + + scMain.Panel2 + + + 0 + scMain.Panel2 @@ -1000,7 +1087,7 @@ 550 - 6 + 7 4 diff --git a/ShareX.HistoryLib/HistoryItemManager.cs b/ShareX.HistoryLib/HistoryItemManager.cs index 1d0c444fd..48af3c4e2 100644 --- a/ShareX.HistoryLib/HistoryItemManager.cs +++ b/ShareX.HistoryLib/HistoryItemManager.cs @@ -50,11 +50,13 @@ public partial class HistoryItemManager public bool IsTextFile { get; private set; } private Action uploadFile, editImage; + private Action showMoreInfo; - public HistoryItemManager(Action uploadFile, Action editImage) + public HistoryItemManager(Action uploadFile, Action editImage, Action showMoreInfo = null) { this.uploadFile = uploadFile; this.editImage = editImage; + this.showMoreInfo = showMoreInfo; InitializeComponent(); } @@ -518,7 +520,14 @@ public void EditImage() public void ShowMoreInfo() { - new HistoryItemInfoForm(HistoryItem).Show(); + if (showMoreInfo != null) + { + showMoreInfo(HistoryItem); + } + else + { + new HistoryItemInfoForm(HistoryItem).Show(); + } } } } \ No newline at end of file