desktop-app
desktop-app copied to clipboard
Add ability to minimize to System Tray
Add the ability to minimize Station to the Windows system tray.
- In the Options Form => General Category add a new On/Off toggle : "Minimize to System Tray"
- When toggle is set to Off, Station minimizes to the Windows taskbar as it currently does
- When toggle is set to On, Station minimizes to the Windows System Tray
Add a context menu to the Station System Tray icon containing these 2 options:
- Open Staion - Open the Staion Main application
- Exit - CLose Station Application
Also add the ability to open the Station main application by double clicking over the Station System Tray icon.
https://github.com/sandwichdoge/MinimizeToTray
I'm currently barely able to achieve this function through this program, hopefully it will be officially implemented soon, thanks : )
Yup, I'm gonna upvote this. Station is an excelllent piece of software, the ability to minimize to system tray would be the cherry on top.
Yes please add this feature. This would make the app perfect.
Without the minimize/close to try function, I am unable to use this amazing software and am forced to use similar but inferior alternatives such as Hamsket or Ferdium.
What I do not understand is why such a simple feature is considered "hard to implement." It is essentially a small change in the settings of the application's main window/form to identify it as "tray allowed" and the addition of a "tray menu" with a few very small functions events to handle the tray access section.
Basic NodeJS code sample:
const { app, BrowserWindow } = require('electron');
let mainWindow;
function createWindow() {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
title: 'My App',
icon: './icon.png'
});
mainWindow.on('minimize', function(event) {
event.preventDefault();
mainWindow.minimizeToTray();
});
mainWindow.loadFile('index.html');
}
app.on('ready', createWindow);
app.on('window-all-closed', function() {
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', function() {
if (mainWindow === null) {
createWindow();
}
});
This code creates a new BrowserWindow and sets up a listener for the 'minimize' event. When the window is minimized, the event.preventDefault() method is called to prevent the default behavior of minimizing the window to the taskbar. Instead, the mainWindow.minimizeToTray() method is called to minimize the window to the tray.
The app.on('ready') event listener creates the window when the app is ready. The app.on('window-all-closed') event listener quits the app when all windows are closed. The app.on('activate') event listener creates a new window if the mainWindow is null.
To use this code, you would need to create an index.html file and place it in the same directory as the app.js file. The index.html file could contain any HTML code that you want.
Of course, it is only an example to demonstrate how simple it can be to implement.
Please dedicate some time to this feature. It is unbelievable that an application like Station lacks such basic functionality. It is almost as if a car racer is missing a fourth wheel or an airplane is missing a wing: everything else is there but the "one small detail" that makes it truly usable.