inket / cosyTabs

SIMBL plug-in for Safari. Now with macOS Sierra/Safari 10 support. Small tabs like they used to be back in the day.
Other
45 stars 2 forks source link

Is there a way to adjust the margin on the tab titles? #4

Closed unphased closed 10 years ago

unphased commented 10 years ago

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.

screenshot 2014-04-07 18 59 26

(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...)

inket commented 10 years ago

Maybe swizzle AttachedTabButton's -setTitle: in order to resize _titleTextField ? I could give it a try tomorrow if you want.

unphased commented 10 years ago

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?

inket commented 10 years ago

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.

unphased commented 10 years ago

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.

inket commented 10 years ago

It's not perfect, but now you can change the tab title margins. https://github.com/inket/cosyTabs/commit/4e28063ccfbb2c55c91930c9441e1cd5c5b3484f

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`

inket commented 10 years ago

@unphased did you try it already ? :)

unphased commented 10 years ago

Not yet, I'm gonna get to it soon as I can, you're too fast :)

unphased commented 10 years ago

I love you!

screenshot 2014-04-08 20 49 03

This is with zero margin, it's obviously a little fugly, I'll be tweaking it.

inket commented 10 years ago

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!

unphased commented 10 years ago

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.