mirror of
https://github.com/rhysd/Mstdn.git
synced 2024-11-28 20:24:10 +01:00
add icons
This commit is contained in:
parent
ed0a1682d3
commit
e230b271c2
@ -3,10 +3,10 @@ Web-based Desktop Client for [Mastodon][]
|
||||
|
||||
Features:
|
||||
|
||||
- Small window on your menubar (or isolated window)
|
||||
- Desktop notification
|
||||
- Customizable shortcut keybinds
|
||||
- Multi-account
|
||||
- [x] Small window on your menubar (or isolated window)
|
||||
- [ ] Desktop notification
|
||||
- [ ] Customizable shortcut keybinds
|
||||
- [ ] Multi-account
|
||||
|
||||
Mastodon is an open source project. So if you want to make a new UI, you can just fork the project,
|
||||
implement your favorite UI and host it on your place. Then you can participate Mastodon networks from it.
|
||||
|
11
main/app.ts
11
main/app.ts
@ -3,7 +3,7 @@ import {app, BrowserWindow, globalShortcut, Tray} from 'electron';
|
||||
import windowState = require('electron-window-state');
|
||||
import * as menubar from 'menubar';
|
||||
import log from './log';
|
||||
import {Config} from './config'
|
||||
import {Config, Account} from './config'
|
||||
|
||||
const IS_DEBUG = process.env.NODE_ENV === 'development';
|
||||
const IS_DARWIN = process.platform === 'darwin';
|
||||
@ -12,23 +12,23 @@ const DEFAULT_WIDTH = 340;
|
||||
const DEFAULT_HEIGHT = 400;
|
||||
|
||||
export class App {
|
||||
private host: string;
|
||||
private account: Account;
|
||||
|
||||
constructor(private win: Electron.BrowserWindow, private config: Config) {
|
||||
if (config.accounts.length === 0) {
|
||||
throw new Error('No account found. Please check the config.');
|
||||
}
|
||||
this.host = this.config.accounts[0].host;
|
||||
this.account = this.config.accounts[0];
|
||||
}
|
||||
|
||||
open() {
|
||||
this.win.loadURL(`https://${this.host}`);
|
||||
this.win.loadURL(`https://${this.account.host}${this.account.default_page}`);
|
||||
this.win.show();
|
||||
}
|
||||
}
|
||||
|
||||
function trayIcon(color: string) {
|
||||
return path.join(__dirname, '..', 'resources', `tray-icon-${
|
||||
return path.join(__dirname, '..', 'resources', 'icon', `tray-icon-${
|
||||
color === 'white' ? 'white' : 'black'
|
||||
}@2x.png`);
|
||||
}
|
||||
@ -109,6 +109,7 @@ function startNormalWindow(config: Config): Promise<Electron.BrowserWindow> {
|
||||
tray.on('double-click', toggleWindow);
|
||||
if (IS_DARWIN) {
|
||||
tray.setHighlightMode('never');
|
||||
app.dock.setIcon(APP_ICON);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import log from './log';
|
||||
export interface Account {
|
||||
host: string;
|
||||
name: string;
|
||||
default_page: string;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
|
BIN
resources/icon/icon.icns
Normal file
BIN
resources/icon/icon.icns
Normal file
Binary file not shown.
BIN
resources/icon/icon.ico
Normal file
BIN
resources/icon/icon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 361 KiB |
BIN
resources/icon/icon.png
Normal file
BIN
resources/icon/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 59 KiB |
BIN
resources/icon/tray-icon-black@2x.png
Normal file
BIN
resources/icon/tray-icon-black@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 986 B |
BIN
resources/icon/tray-icon-white@2x.png
Normal file
BIN
resources/icon/tray-icon-white@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 986 B |
Loading…
Reference in New Issue
Block a user