A recent commit fixed the box problem. But I am still struggling with how to source images other than "open" and "close".
It looks great with the correct boxes. Chris On Friday, March 9, 2018 at 9:53:31 AM UTC-8, Chris George wrote: > > > > > > > Where do I get to choose the boxes? >>> >> >> There are two settings: For the Leo Dark theme they are: >> >> @string tree-image-closed = nodes-dark/triangles/closed.png >> @string tree-image-open = nodes-dark/triangles/open.png >> > >> I think these paths are relative to the leo/Icons folder. *But let's >> not guess*. >> >> Searching for tree-image-closed finds ssm.set_indicator_paths & helper. >> Here is the docstring: >> >> ''' >> In the stylesheet, replace (if they exist):: >> >> image: @tree-image-closed >> image: @tree-image-open >> >> by:: >> >> url(path/closed.png) >> url(path/open.png) >> >> path can be relative to ~ or to leo/Icons. >> >> Assuming that ~/myIcons/closed.png exists, either of these will work:: >> >> @string tree-image-closed = nodes-dark/triangles/closed.png >> @string tree-image-closed = myIcons/closed.png >> >> Return the updated stylesheet. >> ''' >> > > I have verified that this works fine if the folder is in my home directory > (not a great place for theme images IMHO) or in leo/Icons (also not a great > place for theme images IMHO) Putting them in then in > *.../leo/themes/<theme_name>/Icons > *doesn't work and this is the only place where theme images should live > IMHO. Having more than one place to look is extremely valuable for > settings. But it can lead to madness for people looking to create or modify > themes. > > I have attached two screenshots to clarify. abstract.png is an example of > correct behavior. nb. All theme images should be svg. Raster formats look > like crap when you resize them. > > @string tree-image-closed = dark/branch_closed.svg > @string tree-image-closed = dark/branch_open.svg > > These settings are read, inserted and applied. The triangle images are > correctly displayed. Here is the css that works with it. > > > > QTreeView::branch:closed:has-children{ > > image: @tree-image-closed; > > } > > QTreeView::branch:open:has-children{ > > image: @tree-image-open; > > } > > The second image is direct.png. It shows the total loss of triangles in > the tree. Here is the css. > > TreeView::branch:closed:has-children{ > > > image: url(:dark/branch_closed.svg); > > } > > QTreeView::branch:open:has-children{ > > image: url(:dark/branch_open.svg); > > } > > The css passes the checks, the images simply do not display. > > > Looking at the full stylesheet, the color_theme machinery returns the > following for the abstract.png css. > > > > > QTreeView::branch:closed:has-children{ > > image: url(/home/chris/leo-editor/leo/Icons/dark/branch_closed.svg); > > } > > QTreeView::branch:open:has-children{ > > image: url(/home/chris/leo-editor/leo/Icons/dark/branch_open.svg); > > } > > The script replaces dark/branch_open.svg with the full path to the image. > It seems that direct coding of the stylesheet won't work for any other > images than the two; open and closed. I tried creating a new definition in > the same node as the @string statements, but it didn't work. Creating the > smae abstraction for every single new image we want to use in the > stylesheet would be tedious. > > > For ease of use (themers and users) is there a different mechanism we > could use for replacing the path to leo when appending to the provided path > relative to leo/themes/<theme_name>? For example: the default Qt styling > uses the format > > url(:/<theme>/<image>); > > > Note the leading "/". > > > If we could support this syntax, it would make modifying existing Qt > themes much, much simpler. > > > > These two settings might also be involved: >> >> @bool color_theme_is_dark = True >> @string color_theme = leo_dark_0 >> >> Again, *let's not guess*. >> >> *@bool color_theme_is_dark*: I found nothing for a regex search for >> color.theme.is.dark. >> >> I was about to disable it, but its body text contains: >> >> Set to true for dark themes, so bookmarks.py can generate >> random background colors which are appropriate etc. >> >> > As for the boxes, I still have white boxes in the tree. The directory > .../leo/themes/dark exists and contains the desired boxes. The undesirable > boxes *do not exist *on my local machine. I have disconnected my network. > I must assume that the white boxes I am seeing are Qt defaults that are > part of Qt and are appearing because the desired boxes cannot be found. > > @bool color_theme_is_dark = True > @string color_theme = dark > > >> *@string color_theme*: A cff on the regex color.theme yields 5 matches, >> including qt_gui.getImageImage. The docstring is: >> >> '''Load the image in file named `name` and return it. >> >> If self.color_theme, set from @settings -> @string color_theme is set, >> >> - look first in $HOME/.leo/themes/<theme_name>/Icons, >> - then in .../leo/themes/<theme_name>/Icons, >> - then in .../leo/Icons, >> - as well as trying absolute path >> ''' >> Its helper also has the same docstring ;-) >> >> *Summary*: The truth is out there if we look. >> >> HTH. >> >> Edward >> > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.