How to center a tauri app on the osx tray icon - rust

I am trying to center a Tauri app on the osx tray icon, but cannot find a way to do it.
The idea is to make the app open and close on tray icon click, and to make it fixed at the top of the screen and centered on the icon (the y position may change depending on the number of items available from other apps). Something like this:
https://eshop.macsales.com/blog/wp-content/uploads/2019/05/Fantastical1280.jpg
(Sorry, i tried to add the image to the question, but always got a "Server error" when uploading)
I have searched the docs, but haven't found anything and also didn't find a solution on google
On the tauri.conf.json there is a windows.x and windows.y options, but i don't think i can get this kind of logic there.
I noticed that there is a window.set_position() function that i could call when the icon is clicked. But i am not sure how to get the correct position to enter the window on the icon

Related

Change taskbar menu in Tauri

I'm using Tauri and would like to change the menu items shown when clicking my application in the taskbar using the right mouse button (Windows/Linux) or double click (MacOS).
For example Firefox shows "Open a New Window" and music players often show "Play/Pause" or "Next track" buttons. How to do that with Tauri?
I'm aware of SystemTrayMenu in Tauri, but that only seems to affect the system tray, not the task bar.
(What I mean by "taskbar": the line of application icons that you click to open them, and that usually indicate which ones are running. I think MacOS calls it Dock, in Windows it's at the bottom between start button and clock, and Linux isn't very homogeneous but in Ubuntu it's vertically on the left by default. I do not mean the system tray of usually smaller icons that are almost always next to the clock, that are usually more like background services. I.e. I mean where your browser usually shown up, not where your VPN usually shows up.)
Tauri does not support this at the moment (2022-06-27). You may file a feature request.

What causes different icons to appear on different monitors in Windows 10?

We have customers reporting an issue with icons not appearing correctly in Windows 10. I am not able to reproduce the issue with our application, but it is similar in appearance to something that's happening with other programs on my computer. The first screenshot below is from a single computer. It is my task bar on my left and middle monitors. Notice that the "notepad++" icon on the left (it's the highlighted/active icon) is the original icon with the little chameleon sitting on a pencil (you will have to zoom in) and the one on the right just shows the text "n++".
Similarly the Sql Developer icon (immediately to the right of N++) also looks different on different monitors (demonstrating that even when the app's not running this is an issue).
In fact, as I was writing up this question I found that there is a difference between two means of getting at the icon resources in notepad++.exe. If I use IconsExtract (third party tool) on the exe I get the "n++" style icon, but if I right click on N++ in the task bar > Choose properties > Click "Change Icon" I get the chameleon on a pencil icon. You can see these two overlaid in the second image.
I can't for the life of me figure out how windows decides which icon to put where. I would be satisfied with a response that just told me where the two different n++ icons really are.
What it looks like on my monitors
Comparing the two methods of seeing icons
(Don't be fooled by the second chameleon which does appear to be the same.
I showed this to a coworker today and he knew the answer... the taskbar on the left was my laptop and I have configured the "size of text, apps, and other items" under "scale and layout" in the "display settings" for that screen to 150%. Changing the size to 100% caused the icons to become the same across all taskbars. I'm still looking for a good article with the details as to why, but changing the size definitely fixes the issue.

Uwp phone toolbar

I'd like to have a toolbar in my uwp app (only on phone version) and I can't figure it out. I'd like to make it like Groove Music store app have it on mobile phone :
I' d like to customize this toolbar with a toggle button and a title at least. So is there a way to do that on universal win?
It will probably be slightly different than you are thinking. UWP doesn't think so much about "what device am I on" as it thinks about what screen size it is being displayed at. So when you design your app, you want the toolbar to appear only at screen sizes below a certain amount. The closest thing to what you want might be a Command Bar, which you can put at the bottom or top.
https://msdn.microsoft.com/en-us/library/windows/apps/hh465302.aspx
Or you could make a custom XAML control that appears where you want it to and only shows up with a screen below a certain size. I hope this helps answer the question.

Android Menu coming from bottom like Google Drive

I have a floating action button and when the users taps on it I want a layout to be shown, animating from the bottom exactly like the Google Drive app (so not covering the whole screen).
I read someone suggest the open source Umano's AndroidSlidingUpPanel but that is more similar to the Google Play Music app and I don't want that as I don't need the panel to be draggable/slidable.
What component should I use?
This is the Bottom sheet component. Check out its specs:
http://www.google.com/design/spec/components/bottom-sheets.html#bottom-sheets-specs
There are third libraries for the bottom sheet if you don't want to make it your self.

Browser Window Gone in Latest Xcode?

Has the browser window been removed from the latest version of Xcode? I've seen this window in an iOS class I watched online and again in a book I have. I can't find anything in the View menu to turn it on.
I'm running Lion and the latest version of Xcode. I created a new project with Core Data turned on and then built it. I then clicked on .xcdatamodeld file and I get a graphic window with the default table in it.
Do you mean the project browser on the left? You enable that using the 'view' buttons on the right side of the toolbar.
The toolbar might be hidden though, so go to the view menu and select "Show toolbar" if needed.
Then select the fourth button from the right on the toolbar, it is the first button in the set of view buttons. This shows the Navigator View on the left of your screen, which has 7 selectors on the top. The leftmost will give you the project browser (project navigator), the one next to it is the symbol navigator.
I hate to be answering my own question again. I like to keep my answer rate at 100%. Since I didn't get a response here, I tried the Apple developer forums. It turn out the Xcode 4.* changed the interface and this series of windows no longer exist. The same functions can be found in other locations.

Resources