Re: Icons with relative paths

2022-07-18 Thread spike
Since we need an argument to distinguish between document and theme relative paths, I'm using the absence of that argument to set legacy mode. For absolute paths it doesn't make any difference. I just need to test for absolute or relative. The devil is, of course, in the details. I keep overthinki

Re: Icons with relative paths

2022-07-18 Thread tbp1...@gmail.com
You can add a new parameter to the method call, say use_legacy = True. Then all existing code will work as always with the default value of use_legacy. You add a new code branch for when use_legacy is False so you can get what you want in that case. Tests for file existence will work with re

Re: Icons with relative paths

2022-07-18 Thread spike
I can kludge it, but it introduces some subtle but potentially nasty bugs. It really needs to be fixed properly in the next major update. I suppose adding a 'pathType' parameter to insertIconFromFile would work. If the parameter is missing then it uses legacy mode and issues a deprecation warn

Re: Icons with relative paths

2022-07-18 Thread tbp1...@gmail.com
I'm all in favor of improving features, but please find a way to make them continue to work with existing code. It seems to me that the easiest way to go about this would be to make the code fall back to a document or outline-relative path if it can't find the icon files in the other standard

Re: Icons with relative paths

2022-07-18 Thread spike
g.os_path_exists works with relative paths but c.editCommands.insertIconFromFile forces relative paths to be relative to the Leo theme directory. Document relative paths are rejected. Running the following command from Leo's Python Console tab fails: c.editCommands.insertIconFromFile('./icons/

Re: "Chapters" Dropdown Can Now Be Placed At Left Of IconBar

2022-07-18 Thread Edward K. Ream
On Mon, Jul 18, 2022 at 11:09 AM tbp1...@gmail.com wrote: > And the default was False anyway, but having it in leoSettings.leo at > least means that someone might notice it there. > Yes. All official settings should be documented in leoSettings.leo. Edward -- You received this message becaus

Re: "Chapters" Dropdown Can Now Be Placed At Left Of IconBar

2022-07-18 Thread tbp1...@gmail.com
And the default was False anyway, but having it in leoSettings.leo at least means that someone might notice it there. On Monday, July 18, 2022 at 12:03:06 PM UTC-4 Edward K. Ream wrote: > To use the new feature, add a new node to the @settings tree in your >> myLeoSettings.leo outline with this

Developer's Notebook - Placing The "Chapters" Dropdown On The Left Of The Iconbar

2022-07-18 Thread tbp1...@gmail.com
In this Developer's Notebook, I want to share how I arrived at the new code to place the "Chapters" dropdown at the left of the Iconbar instead of the usual right. Mainly there are a couple of tricks that I have found useful and would like to pass on to others who haven't come across them. As

Re: "Chapters" Dropdown Can Now Be Placed At Left Of IconBar

2022-07-18 Thread Edward K. Ream
> To use the new feature, add a new node to the @settings tree in your > myLeoSettings.leo outline with this text: > > @bool chapter-dropdown-left = True > Rev 2e1dbd9 adds `@bool chapter-dropdown-left = False` to leoSettings.leo, retaining legacy operation by default. Edward -- You received th

"Chapters" Dropdown Can Now Be Placed At Left Of IconBar

2022-07-18 Thread tbp1...@gmail.com
With the new merge of the devel branch, you can locate the "chapters" dropdown at the left of the Iconbar. This is useful if you use chapters a lot, since it prevents the dropdown from being truncated off the end of the toolbar when there are many script buttons, or the Leo window is narrow. T

Re: Icons with relative paths

2022-07-18 Thread tbp1...@gmail.com
Typically, either you write code and try different paths depending on whether your file is in one place or another, or a Leo method does the same thing for you, in which case you need to know where Leo is going to look. For example, in the part of the Cheatsheet you mention: fn = g.os_