Change window title to the one that's set from the platform for the current channel

This commit is contained in:
Kolja Lampe
2016-08-12 20:49:43 +02:00
parent 00f646983e
commit f01b6a98f2
4 changed files with 17 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ Release date: TBD
### Improvements ### Improvements
#### All platforms #### All platforms
- Show current channel/team in window title
- Changed display of unread messages on the team tabbar, they are now shown as bold text - Changed display of unread messages on the team tabbar, they are now shown as bold text
- Reload only the selected tab and keep its URL on "Reload" and "Clear Cache and Reload". - Reload only the selected tab and keep its URL on "Reload" and "Clear Cache and Reload".
- Disabled `eval()` function for security improvements. - Disabled `eval()` function for security improvements.

View File

@@ -3,7 +3,6 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Mattermost</title>
<link rel="stylesheet" href="modules/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="modules/bootstrap/css/bootstrap.min.css">
</head> </head>

View File

@@ -94,6 +94,11 @@ var MainPage = React.createClass({
key: newKey key: newKey
}); });
this.handleOnTeamFocused(key); this.handleOnTeamFocused(key);
var webview = document.getElementById('mattermostView' + key);
ipcRenderer.send('update-title', {
title: webview.getTitle()
});
}, },
handleUnreadCountChange: function(index, unreadCount, mentionCount, isUnread, isMentioned) { handleUnreadCountChange: function(index, unreadCount, mentionCount, isUnread, isMentioned) {
var unreadCounts = this.state.unreadCounts; var unreadCounts = this.state.unreadCounts;
@@ -403,6 +408,12 @@ var MattermostView = React.createClass({
} }
}); });
webview.addEventListener('page-title-updated', function(event) {
ipcRenderer.send('update-title', {
title: event.title
});
});
webview.addEventListener('console-message', (e) => { webview.addEventListener('console-message', (e) => {
const message = `[${this.props.name}] ${e.message}`; const message = `[${this.props.name}] ${e.message}`;
switch (e.level) { switch (e.level) {

View File

@@ -229,6 +229,11 @@ app.on('ready', function() {
} }
} }
}); });
ipcMain.on('update-title', function(event, arg) {
mainWindow.setTitle(arg.title);
});
if (shouldShowTrayIcon()) { if (shouldShowTrayIcon()) {
// set up tray icon // set up tray icon
trayIcon = new Tray(trayImages.normal); trayIcon = new Tray(trayImages.normal);