Skip to content

Commit

Permalink
add new onredrawthum evebthabdler [#13]
Browse files Browse the repository at this point in the history
fix controlls getting stuck on dosabled state after adding images
  • Loading branch information
t0815 committed Sep 19, 2024
1 parent 0c2ad89 commit a11aacc
Show file tree
Hide file tree
Showing 13 changed files with 287 additions and 231 deletions.
2 changes: 1 addition & 1 deletion MyCBZ/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
<applicationSettings>
<Win_CBZ.Win_CBZSettings>
<setting name="InstalledVersion" serializeAs="String">
<value>0.21.166b</value>
<value>0.21.167b</value>
</setting>
<setting name="RenamerPlaceholders" serializeAs="Xml">
<value>
Expand Down
20 changes: 20 additions & 0 deletions MyCBZ/Events/RedrawThumbEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Win_CBZ.Events
{
internal class RedrawThumbEvent
{
public Page Page { get; set; }

public RedrawThumbEvent() { }

public RedrawThumbEvent(Page page)
{
this.Page = page;
}
}
}
16 changes: 8 additions & 8 deletions MyCBZ/Forms/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions MyCBZ/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ private ProjectModel NewProjectModel()
AppEventHandler.ApplicationStateChanged += ApplicationStateChanged;
AppEventHandler.GlobalActionRequired += HandleGlobalActionRequired;
AppEventHandler.GeneralTaskProgress += HandleGlobalTaskProgress;
AppEventHandler.RedrawThumbnail += OnRedrawThumbnail;

newProjectModel.RenameStoryPagePattern = Win_CBZSettings.Default.StoryPageRenamePattern;
newProjectModel.RenameSpecialPagePattern = Win_CBZSettings.Default.SpecialPageRenamePattern;
Expand Down Expand Up @@ -1128,6 +1129,18 @@ private void ExecuteCurrentGlobalAction_Click_1(object sender, EventArgs e)
}
}

private void OnRedrawThumbnail(object sender, RedrawThumbEvent e)
{
if (!WindowClosed)
{
Invoke(new Action(() =>
{
ThumbnailPagesSlice.Add(e.Page);
RequestImageInfoSlice();
}));
}
}

public void ReloadPreviewThumbs()
{
if (!WindowClosed)
Expand Down
Loading

0 comments on commit a11aacc

Please sign in to comment.