Could it be possible to not init previewHeight when using newTab() ?
And use last tab/current tab previewHeight instead ?
Please, can you do something for this ?
Could it be possible to use as the default value the value set in the current tab and not the last tab? Something like:
if Font.currentTab:
default_preview_height = Font.currentTab.previewHeight
else:
default_preview_height = Font.tab[-1].previewHeight
Font.newTab(layers)
Font.tabs[-1].previewHeight = default_preview_height
It happened to me a few times. Can you drag-resize the current tab before you open the new tab.
I think for the API it would make more sense if previewHeight always initialized to the same value (probably 0
) until the developer decides to set it to something. For the UI, I agree with Hugo that a new tab should have the same previewHeight as the active tab Font.currentTab
, whereas right now it takes the previewHeight from the last tab Font.tabs[-1]
.
Also while I was looking at this I noticed some strange behaviour. If I want to open 3 tabs, I would press Cmd-T three times, but this only opens 2 tabs. If I continue to press Cmd-T, it switches between tabs instead of opening new ones.
It takes the heigh from when it was changed the last time.