Tabs Start Wide
gilliginsisland opened this issue · 4 comments
I have a bad but quick fix to the issue of tabs not getting smaller immediately on start.
in the load method, put this
for (id BrowserWindow in [NSApplication.sharedApplication windows])
{
if (![BrowserWindow isKindOfClass:NSClassFromString(@"BrowserWindow")]) return;
NSArray *orderedTabViewItems = [BrowserWindow performSelector:@selector(orderedTabViewItems)];
if ([orderedTabViewItems count] < 1) return;
[[orderedTabViewItems[0] performSelector:@selector(tabBarView)] performSelector:@selector(refreshButtons)];
}
it will loop over all the windows in the browser and find the container of the tabs. it will then force them to refresh right when simbl is loaded.
Out of curiosity, are you using Safari beta (6.1 or 7) ? I noticed the tabs weren't getting smaller on start on Safari 7, but I don't remember it happening in Safari 6... or is my memory that bad ?
I am on beta 7, but even when i was on Safari 6 they weren't getting smaller on load.
When I say load, I mean when the app is opened, and there are already windows open from the previous session.
This happens because by the time SIMBL has decided to inject cosytabs, Safari has already resumed and drawn the windows and tabs. Until the window is resized or the a new tab is added or removed, the tabs are large.
By putting the refresh command in the load method, it gets safari to reload the tabs at the new fixed size, without needing to wait for something else to trigger it.
Okay, thanks. I'll push the fix in a few minutes.