Is there a way to adjust the margin on the tab titles?
Closed this issue · 10 comments
I changed my tabs to be 100px wide (I could go even lower) but there is a huge space making most of the tab size wasted.
(I need to use Safari, but it simply does not measure up to Chrome, which can show 50+ icons by eventually just showing the favicons -- I can do w/o favicons... but all that wasted space...)
Maybe swizzle AttachedTabButton
's -setTitle:
in order to resize _titleTextField
? I could give it a try tomorrow if you want.
I have no idea how to do that. Yes that would be awesome if you could give it a shot. :)
Are these private API's? Is it that if one is familiar with the UI widgets being used by Safari that it's possible to hack into it?
Not really. It's replacing method implementations to change how Safari works.
To know which methods need 'replacing', I use class-dump to dump the header files and try to guess from class/method names which ones are relevant. If it's a UI element it's pretty easy to identify thanks to Interface Inspector.
I noticed that the margin space on the left side of the tab is so that the X close button will appear in there nice and snug. But at least the right side of it could be put to use. And the X can appear above text, that's great too.
It's not perfect, but now you can change the tab title margins. 4e28063
Just change the values in
#define TAB_TITLE_LEFT_MARGIN NSIntegerMax #define TAB_TITLE_RIGHT_MARGIN NSIntegerMax
to something like
#define TAB_TITLE_LEFT_MARGIN 0 #define TAB_TITLE_RIGHT_MARGIN 0
Not yet, I'm gonna get to it soon as I can, you're too fast :)
Cool! :) Sometimes it's a bit messy because the tabs are drawn in 6 different ways (first tab, first tab + selected, middle tab, middle tab + selected, last tab, last tab + selected) but you should be able to find a comfortable setting if you keep trying!
Yep I noticed there is a difference between the selected tab and the ones immediately next to them (the rest of the non-selected tabs have a smaller margin than the selected tab and what looks like the tab immediately to the right of it, but there are still more subtle differences). It does not get in my way. This is a much better experience already.