Hide buttons in Touch Bar depending on a condition - visual-studio-code

I just got a new MacBook Pro with a Touch Bar and I wanted to create an extension specific for Angular apps.
The purpose of the extension was to provide some buttons on the Touch Bar so the user can like, generate a component or rather launch the 'ng serve' command or something else.
My question here is : is it possible to hide some buttons on the Touch Bar depending on a condition, like if I'm on a Angular project or not ?
I have tried things but none of them worked.
Thank you for your time.

Related

Possible to have multiple buttons in a StatusItem on MacOS?

I'm trying to build a timer app on MacOS that would show the remaining time in the status bar.
Wondering if it's possible to show multiple buttons there at once? E.g. show play/pause button, reset button and the time right in the status bar.
Or are there any hacks possible, like make it a single button with 2 icons next to each other, and check the click position to see which "button" got the click?
I know I can put the extra buttons in a popover, but I'm new to MacOS dev and trying to understand the limits. Thanks!

How to use Flutter to implement a button like ios virtual home button

I want to create a button can move to any position like iPhone Style (Virtual Home Button) in Flutter but I don't know any packages or any library can do it. Moreover, I'd like the button to be able to show along with a specific app, eg. dial-up UI. If I deploy to desktop, will its behavior the same with mobile?
ios virtual home button
show button along with dial-up UI
Hope you guys help me ways to create it.
I have tried with unicorndial, floating_bubble, popup window, etc.
but all of them are widget within flutter app, instead of system-wide.
Sorry you can't really create anything like that outside of your App context. Apple is very strict in situations like this.
You can implement this sort of feature in Android by using Floating Service. But for Apple it's a NO NO.

How to add a tab bar to a Mac application (Swift/AppKit)

I am creating a code editor for Mac using Xcode and Swift. I already have a toolbar (NSToolbar) but am not sure how I would achieve a tab design simmilar to Firefox's. I don't want to use NSTabView as those are more like tabbed buttons, and I am looking for a proper tab bar for Mac.
Example of what I want to achieve
In the below image, I have edited the tab bar from Firefox into the design of the app so you can see what I would like to accomplish.
Will I have to implement something like this from scratch, and if so - how would I go about doing it?
Thanks, dhilln.

iPhone and iPad wordpress menu BAD behavior

On this site : mecanomedic.com, the menu template work fine in "normal" desktop browser, but dont slide down on ipad-iphone device. What can be the problem ?
Some tell me it's a css problem, but HOW safari desktop work ?
The problem is that the menu expansion relies on the user hovering with a mouse. On touch devices like iPads & iPhones, the hovering gesture can't be replicated because there's only one input- touch. If I were you, I'd take a look at Twitter's Bootstrap menu setup and perhaps use media queries to serve up a different menu on smaller screen sizes.
Here's an example of a Bootstrap navigation bar in action (you'll have to inspect the code to see how it works).
Add a href to the top-level <a>'s so that they can be focusable:
Produits
Elements that are focusable receive mouse events and hover styles when the user taps on them.
As #Matt stated, the problem is that your menu relies on a hover event and unfortunately that event is unavailable on touch screen devices.
One way to fix this would be to:
Check if the current user's device is an iOS device
If the device is an iOS device, use javascript to trigger a menu item's "show event" when the menu button is CLICKED instead of ROLLED OVER / HOVERED.
This would result in the menu being shown when the user taps a menu button.

iPhone Changing TabBar on-the-fly?

I'm quite new in iPhone Programming, but I'm trying to do my best cause I have some skills in OOP.
I'm creating an iPhone app based on a four element Tabbar. I would like to use other functionalities already implemented by a friend of mine in his own iPhone app (a three elements TabBar app).
Since I would like my app's users could "switch" to old application (3 tabs) by pressing on one of my app's tab, my question is: is it possible to do this, maybe by "popping out my tabbar" (4 tabs) and "pushing in the old tabbar" (3 tabs)?
For a better problem description, we could say that I'm trying to implement a "new mode" and "old mode" in the same application.
Thank you in advance.
P.S. I'm using Xcode 3.2.2 on a Macbook Pro coreDuo and 3.1.3 iPhone simulator
Luca
Your question is a little bit vague, but if you want to be able to choose between two different tab bars, the easiest way to do it is to include both tab bars in the application, and simply hide the one you don't want active. You can still do this in Interface Builder. Just wire up both tab bars, and let your view controller hide the old one in -viewDidLoad. Then, when the "old mode" button is pressed, show the old tab bar and hide the new one.