mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Fix history selection issue
This commit is contained in:
parent
82ad2deb94
commit
f576029f70
3 changed files with 28 additions and 28 deletions
|
@ -312,14 +312,17 @@ private void UpdateTitle(HistoryItem[] historyItems = null)
|
|||
|
||||
private void UpdateControls()
|
||||
{
|
||||
if (him.RefreshInfo())
|
||||
{
|
||||
UpdatePictureBox();
|
||||
}
|
||||
else
|
||||
HistoryItem previousHistoryItem = him.HistoryItem;
|
||||
HistoryItem historyItem = him.UpdateSelectedHistoryItem();
|
||||
|
||||
if (historyItem == null)
|
||||
{
|
||||
pbThumbnail.Reset();
|
||||
}
|
||||
else if (historyItem != previousHistoryItem)
|
||||
{
|
||||
UpdatePictureBox();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdatePictureBox()
|
||||
|
|
|
@ -175,7 +175,7 @@ private void ImageHistoryForm_KeyDown(object sender, KeyEventArgs e)
|
|||
|
||||
private void ilvImages_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
him.RefreshInfo();
|
||||
him.UpdateSelectedHistoryItem();
|
||||
}
|
||||
|
||||
private void ilvImages_ItemDoubleClick(object sender, ItemClickEventArgs e)
|
||||
|
|
|
@ -59,16 +59,12 @@ public HistoryItemManager(Action<string> uploadFile, Action<string> editImage)
|
|||
InitializeComponent();
|
||||
}
|
||||
|
||||
public bool RefreshInfo()
|
||||
public HistoryItem UpdateSelectedHistoryItem()
|
||||
{
|
||||
HistoryItem tempHistoryItem = GetSelectedHistoryItem();
|
||||
HistoryItem = GetSelectedHistoryItem();
|
||||
|
||||
if (tempHistoryItem != null)
|
||||
if (HistoryItem != null)
|
||||
{
|
||||
if (HistoryItem != tempHistoryItem)
|
||||
{
|
||||
HistoryItem = tempHistoryItem;
|
||||
|
||||
IsURLExist = !string.IsNullOrEmpty(HistoryItem.URL);
|
||||
IsShortenedURLExist = !string.IsNullOrEmpty(HistoryItem.ShortenedURL);
|
||||
IsThumbnailURLExist = !string.IsNullOrEmpty(HistoryItem.ThumbnailURL);
|
||||
|
@ -81,12 +77,13 @@ public bool RefreshInfo()
|
|||
IsTextFile = IsFileExist && Helpers.IsTextFile(HistoryItem.FilePath);
|
||||
|
||||
UpdateButtons();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
cmsHistory.Enabled = false;
|
||||
}
|
||||
|
||||
cmsHistory.Enabled = false;
|
||||
return false;
|
||||
return HistoryItem;
|
||||
}
|
||||
|
||||
private HistoryItem GetSelectedHistoryItem()
|
||||
|
|
Loading…
Reference in a new issue