I like to use Toolbar.add_separator to group icons logically.
This tool bar groups 15 icons: 2, 2, 1 ,3, 3, 2, 2.
But the separators don’t show on an screen shot sent to me by a MAC retina user.
Maybe when retina enlarges the icons (so the aren’t tiny) it doesn’t enlarge the separators(?) Maybe MAC doesn’t ever show separators?
These are from my extension 2DXY SlickMoves which I just updated to use vector icons: MAC=pdf, WIN = svg.
Maybe in addition to Sketchup.platform we also need Sketchup.screenresolution?
the easiest way is to get it from a never shown webDialog using …
nodlg = UI::WebDialog.new('noDlg', false, '', 0, 0, 0, 0, false)
scale = nodlg.screen_scale_factor.to_i
nodlg = nil
works on both platforms [I believe]…
and I’ve never known mac to show toolbar separators…
It is meant to be called after the dialog is open on whatever display it’s on. (Which may be moved by the user manually to another display. So it needs to be re-called a strategic times.)
But running it before the WD instance is shown returns
1.0 on my machine which is standard 96/ppi. Ie:
Wish it was also implemented as also a singleton method for the display that the application window is on. Either as a module method on the
UI module, or the
But you can create a wrapper for yourself, that opens a new dialog during startup, that does not save it’s position. (Yea, not foolproof.)
@john_drivenupthewall I don’t think you’d want to truncate the scalar float value, would you ?
from memory I was wanting to avoid the floats as scale factors for retina images tend to be @2 or @4 on a mac and for screen can vary i.e. 1.25, 1.75, 2.0, 2,5, etc…
so I later just test for => 2
I would use Sketchup.screenresolution to test if I needed to insert extra adjacent separators. But if MAC never shows separators (another undocumented API “feature”) then it doesn’t help me.
your mac retina image is showing smaller images than the Windows svg’s, so I assumed you have two versions of pdf…
to avoid the padding I use large pdf’s and let SU scale them down…
four different background colours would eliminate the need for separates on both platforms…
I created the icons as pdfs 4 inches square.
Then I converted them to svgs at same size using Inkscape.
I use the same PDF for small and large icon for mac
and same svg for both small and large on win.
The image above may mislead as I pasted 2 screen grabs: one from a mac retina customer and the win from my own machine 1920x1080. Then roughly resized them to be the same over width. Here is an example pdf for one icon:resize.pdf (8.4 KB) Forum upload tool doesn’t allow svg uploads.
I believe that MAC retinas have to double the size? of icons for all applications… 24x24 jpg will be 48x48? and 16x16jpg will be 32x32? Which results in somewhat crude pixelation. Similarly it must paint vector icons into same size pixel squares. These are just my assumptions since I’m not a mac user…
I make all mine in a SU viewport of 512 X 512 px…
your example file appears to be half that size when opened in my image editor…