bikkelbroeders / TouchBarDemoApp

Allows you to use your macOS Touch Bar from an iPad (through USB connection) or on-screen by pressing the Fn-key.
MIT License
1.66k stars 120 forks source link

Center the touch bar (or) fill the whole bottom #3

Open esteszeke opened 7 years ago

esteszeke commented 7 years ago

As tittle suggests. When pressing Fn it appears on screen closest to the mouse pointer. If you do it at the base of the screen it shows up alined, but only extending from one corner or the other, leaving about one inch from either the right or the left.

non-retina MacBook Pro 2010-mid.

Works great so far, though, I love it!

robbertkl commented 7 years ago

Hi, thank you for your feedback. The Fn-toggle was designed to appear at your mouse pointer when needed, and to be dismissed when you're done. It isn't really meant to be stationary on the screen. However, if you put your mouse pointer in the bottom center of the screen, the Touch Bar should appear centered and aligned to the bottom of the screen. The Touch Bar is rendered at it's original resolution, which is 1085x30. I assume you're running your MacBook Pro on a 1280x800 resolution, so this should leave 195px (or around 97 on each side if centered).

We're considering adding a stationary, permanent on-screen Touch Bar that sticks to the bottom of the screen, but this will be separate from the Fn-toggle option. For this Touch Bar, we would make it extend to the full width of your screen, either by scaling the Touch Bar, or adding black regions left and right.

julianschiavo commented 7 years ago

Around how much time until this feature is implemented? (@robbertkl)

robbertkl commented 7 years ago

No idea yet. Please note that this is just a demo app, not a fully featured product. That being said, we might still add some small features in the coming days/weeks.

nakulbajaj commented 7 years ago

Hi @esteszeke,

If you're up for it, you can try to install the modified version that I made which always centers the Touch Bar to the bottom. (attached) Of course, it will not update like the genuine version. Let me know if it works for you. Keep in mind that it will interfere with the dock if the dock is kept at the bottom.

Thanks

TouchBarServer.app.zip

MarcoBrandao commented 7 years ago

However, if you put your mouse pointer in the bottom center of the screen, the Touch Bar should appear centered and aligned to the bottom of the screen.

Thank you for this tip, now I moved my dock to the left side of my screen.

fulldecent commented 7 years ago

I like this feature's idea of

I would prefer this to https://github.com/bikkelbroeders/TouchBarDemoApp/issues/3#issuecomment-258667435 that is

julianschiavo commented 7 years ago

Hey @nakulbajaj can you give us the source code for your version please?

nakulbajaj commented 7 years ago

Hi @wwdc17

All I really did was switch out [_touchBarWindow setFrameOrigin:self.mouseTouchOrigin];

in the toggleTouchBarWindow method in AppDelegate.m of TouchBarServer with

NSRect e = [[NSScreen mainScreen] frame];
int width = (int)e.size.width - 1095;
width = width/2;
NSPoint centerBottomPoint = CGPointMake(width, 0);
[_touchBarWindow setFrameOrigin:centerBottomPoint];

I understand that it's not neat but it works! I did some math there to figure out the width of the screen and then found the x value knowing that the touch bar width seems to be 1095. Should work for all screen sizes.

julianschiavo commented 7 years ago

OK, thanks! I'm gonna work with my 0.1% proficiency to make it have black bars on either side :P

julianschiavo commented 7 years ago

You wanna submit a pull request or should I?

nakulbajaj commented 7 years ago

I could submit a PR but I decided not to just because I don't want it to default to the center and bottom. I want the user to be able to continue choosing a different location with their mouse.

Do you mind adding another menu item which can enable the functionality I made? Just a boolean that can be enabled or disabled?

Then by all means you can submit a PR 👍

julianschiavo commented 7 years ago

I don't even know how... 😞

julianschiavo commented 7 years ago

@robbertkl Can you guys keep supporting this app?

nakulbajaj commented 7 years ago

@wwdc17 If you're just using this app to have TouchBar functionality on your non-touchbar Mac, I strongly recommend Touché

julianschiavo commented 7 years ago

That... doesn't look good. It has a X button which takes up lots of space for nothing. I'd prefer using this 😛