Skip to content

Implement our own dialog form for display of text messages#1423

Merged
CharliePoole merged 2 commits intomainfrom
issue-11
Feb 1, 2026
Merged

Implement our own dialog form for display of text messages#1423
CharliePoole merged 2 commits intomainfrom
issue-11

Conversation

@CharliePoole
Copy link
Member

@CharliePoole CharliePoole commented Jan 30, 2026

Fixes #11 at last!

@rowo360 Please take a close look at how I calculate the size needed for the text. It's very similar to how I do it for the TipWindow class, but doesn't come out quite right. I'd prefer not to add in the extra "fudge factor" for the height. Main difference from TipWindow is the use of a TextBox rather than writing directly to the window.

Once this is merged, I'll rebase the issue-1418 branch and continue to work on that issue.

@CharliePoole CharliePoole requested a review from rowo360 January 30, 2026 19:01
@rowo360
Copy link
Contributor

rowo360 commented Jan 31, 2026

I'll start review tomorrow when I'm back home.

for (int index = entries.Count; --index >= 0;)
if (!File.Exists(entries[index]))
entries.RemoveAt(index);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change isn't really necessary for using the new dialog. But I noticed that we had not carried out our decision to automatically remove such files and did it here. Of course, we could the feature to one of our settings pages if that seems better, but I thought I'd try this approach first.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good decision! And I prefer to keep it simple without introducing a setting.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to do a second commit, removing the TextBox from the form. Drawing of the text is now in OnPaint just as for TipWindow. Probably, I could have made the TextBox work, but this was easier and I no longer have to add in any unexplained extra height.

Copy link
Contributor

@rowo360 rowo360 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine: the size calculation looks similar to TipWindow. Of course, it's difficult to review the effect by looking only at the code, but I'll check also after merge if some deviations exists (e.g. 4k display)
Number 11 solved 🎉!

@CharliePoole
Copy link
Member Author

Here's the message displayed for Help | Command-line Options...

image

As you say, we can deal with individual issues or improve appearance as we need to.

@CharliePoole CharliePoole merged commit d58e14a into main Feb 1, 2026
2 checks passed
@rowo360
Copy link
Contributor

rowo360 commented Feb 1, 2026

Hmm, this doesn't look good on my computer 🤔 .
The height of the dialog is too large, the position of the dialog is somehow unexpected and the icon not complete visible and very blurred.

@CharliePoole CharliePoole deleted the issue-11 branch February 1, 2026 20:31
@CharliePoole
Copy link
Member Author

OK, I'll do some more on it.

  1. The text box (which I removed) had a minimum size. Without it I have to manually give the display rectangle a minimum size to avoid obscuring the . I should have caught that.
  2. The form itself is displaying at it's minimum size. Do you think the minimum should be smaller?
  3. One possibility: If the message text is smaller than the minimum display rectangle, center it vertically.
  4. The icon isn't blurred for me, so we'll have to figure that out.
  5. Regarding positioning, can you post a bigger screen grab so I can see how it is positioned for you?

Meanwhile, I'll experiment with short messages - I focused on large messages when I wrote it.

@rowo360
Copy link
Contributor

rowo360 commented Feb 2, 2026

I assume that at least the blurring is a High DPI issue (4k monitor with scaling set to 150% (recommended windows setting). I guess that we are using 16x16 icons which are getting upscaled. Down scaling will produce better results.

Here's a (large) screenshot:
I pressed the 'Ok' button in the settings dialog and the message box pops up somewhere on the top/right side. Please also note, the white area in the message box below the Yes, No, Cancel buttons.

@CharliePoole
Copy link
Member Author

I have everything fixed but the positioning. I'll work on that tomorrow. In fact, the text message dialog is displayed in your image at the correct location, but it's taken as relative to the screen rather than the controlling settings dialog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Message Display Box

2 participants