Skip to content

Commit

Permalink
add link to app's homepage to app name
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Nov 5, 2016
1 parent 78918f0 commit 1e0f5e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ import {shell, ipcRenderer, remote} from 'electron';

ipcRenderer.on('about-window:info', (_, info: AboutWindowInfo) => {
const app_name = remote.app.getName();
const open_home = () => shell.openExternal(info.homepage);
document.title = `About ${app_name}`;

const title_elem = document.querySelector('.title') as HTMLHeadingElement;
title_elem.innerText = `${app_name} ${remote.app.getVersion()}`;
title_elem.addEventListener('click', open_home);

if (info.homepage) {
document
.querySelector('.logo')
.addEventListener('click', () => shell.openExternal(info.homepage));
.addEventListener('click', open_home);
}

const copyright_elem = document.querySelector('.copyright') as HTMLDivElement;
Expand Down
5 changes: 5 additions & 0 deletions styles/ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ body {
margin: 0.2em;
}

.title {
cursor: pointer;
}

.description {
margin-bottom: 1em;
text-align: center;
}

.versions {
Expand Down

0 comments on commit 1e0f5e6

Please sign in to comment.