Author Topic: File Window Tip - linebreaks in description  (Read 276 times)

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1524
  • I'm too damn old to act my age.
File Window Tip - linebreaks in description
« on: June 18, 2022, 05:13:38 PM »
I know I did this once several years ago but I can't remember how.  :o

In a file window tip configuration how do I insert linebreaks in the description so a file window tip description looks the same as a metadata layout description?

I thought

Code: [Select]
{File.MD.description|replace:{cr}{lf}==<Linebreak/>}
Should work but it doesn't seem to do anything.  What am I missing?
Thanks in advance.

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31580
Re: File Window Tip - linebreaks in description
« Reply #1 on: June 18, 2022, 06:13:13 PM »
pereplace:This==That does the trick:

{File.MD.XMP::dc\description\Description\0|pereplace:{cr}{lf}==<LineBreak/>}

The default File Window tip does this for the description:

{File.MD.XMP::dc\description\Description\0|pereplace:{cr}{lf}==</Run><LineBreak/><Run Foreground="#ffaa00" FontSize="8pt">;prefix:<Run Foreground="#ffaa00" FontSize="8pt">;postfix:</Run>}

You can load the default tip from C:\ProgramData\photools.com\IMatch6\Presets\system-high-res.imfwt

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1524
  • I'm too damn old to act my age.
Re: File Window Tip - linebreaks in description
« Reply #2 on: June 18, 2022, 06:36:13 PM »
Thanks Mario, I had tried pereplace before posting this thread and it didn't work.  I just loaded your default file window tip and it doesn't replace line breaks either.

I've attached a file window tip screenshot with your default C:\ProgramData\photools.com\IMatch6\Presets\system-high-res.imfwt loaded.

Bug maybe?

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31580
Re: File Window Tip - linebreaks in description
« Reply #3 on: June 18, 2022, 06:48:04 PM »
It does.
Are you sure your data contains CRLF or maybe just LF? I've just <Shift>+<Enter> to add line breaks.

Also, the extra blank lines between the paragraphs are a "not a concept" for XAML rendering. They will be folded unless you produce actual text blocks with margins or padding from your content.

« Last Edit: June 18, 2022, 06:53:58 PM by Mario »

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1524
  • I'm too damn old to act my age.
Re: File Window Tip - linebreaks in description
« Reply #4 on: June 18, 2022, 07:29:47 PM »
This is so strange.  If I edit a description in my metadata layout and manually insert extra linebreaks there by using SHIFT+ENTER the file window tip does not show the added linebreaks in the description.

But if I copy the description to my favorite text editor NoteTab Pro and add the line breaks there then copy and paste the description back into the iMatch metadata layout description field, then the file window tip does display the line breaks.

Now I just tried adding extra linebreaks again using the Metadata Lyout editor and this time the file window tip does show the line breaks.

I don't know what's going on Mario I'll keep trying to pin this down to something specific.

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31580
Re: File Window Tip - linebreaks in description
« Reply #5 on: June 18, 2022, 07:36:03 PM »
Note: The File Window tip may have some data cached. Open the tip on another file and then go back to the file you have just modified to force the cache to clear.

Both <Ctrl>+<Enter> and <Shift>+<Enter> in the MD panel should work and add line breaks.

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1524
  • I'm too damn old to act my age.
Re: File Window Tip - linebreaks in description
« Reply #6 on: June 18, 2022, 08:03:50 PM »
That helps Mario, thanks again.

If I select one image without doing anything to it linebreaks are not shown.  If I make a tiny change to that description then writeback metadata it still doesn't show linebreaks.

But if I select a different image then come back to the first one, linebreaks are shown.

I wonder if I'm the only one who has this problem?

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31580
Re: File Window Tip - linebreaks in description
« Reply #7 on: June 18, 2022, 08:17:21 PM »
Your editing of linebreaks may interfere with the File Window caching the File Window tip.
Not sure if this is to be considered a bug. Maybe open a bug report and I will look into this for one of the next releases.
Not many users use File Window tips or at least don't use them at the same time the actively modify metadata in the MD panel.
Monitoring the MD panel may harm File Window tip and/or File Window performance - the cache is there for a reason. Opening the FWT for another image after you have editing an image and then the FWT for the edited image will always show the up-to-date tip.

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1524
  • I'm too damn old to act my age.
Re: File Window Tip - linebreaks in description
« Reply #8 on: June 18, 2022, 09:54:02 PM »
I think I'll wait and see if anyone else has the same issue.  If they do I'll submit a bug report, otherwise I'll assume it's something on my end.

Thanks again Mario

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31580
Re: File Window Tip - linebreaks in description
« Reply #9 on: June 19, 2022, 10:08:35 AM »
I have upgraded this to a bug and fixed it for the next release.

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1524
  • I'm too damn old to act my age.
Re: File Window Tip - linebreaks in description
« Reply #10 on: June 19, 2022, 10:54:18 PM »
That sounds great Mario, thank you!

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31580
Re: File Window Tip - linebreaks in description
« Reply #11 on: June 19, 2022, 11:01:41 PM »
Always improving!  :)