-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
63 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import fs from 'node:fs'; | ||
import gui from 'gui'; | ||
import path from 'node:path'; | ||
|
||
import BaseWindow from '../view/base-window'; | ||
import basicStyle from '../view/basic-style'; | ||
|
||
export default class AboutWindow extends BaseWindow { | ||
constructor() { | ||
super(); | ||
|
||
const packageJson = require('../../package.json'); | ||
let iconPath = path.join(__dirname, '../../assets/icons/icon'); | ||
if (packageJson.version.endsWith('-dev')) | ||
iconPath += '-dev'; | ||
const icon = gui.Image.createFromPath(fs.realpathSync(iconPath + '@2x.png')); | ||
|
||
const imageView = gui.GifPlayer.create(); | ||
imageView.setImage(icon); | ||
this.contentView.addChildView(imageView); | ||
const title = gui.Label.create(packageJson.build.productName); | ||
title.setFont(gui.Font.default().derive(1, 'bold', 'normal')); | ||
this.contentView.addChildView(title); | ||
const smallFont = gui.Font.default().derive(-3, 'normal', 'normal'); | ||
const version = gui.Label.create(`Version ${packageJson.version}`); | ||
version.setFont(smallFont); | ||
this.contentView.addChildView(version); | ||
const copyright = gui.Label.create(packageJson.build.copyright); | ||
copyright.setFont(smallFont); | ||
this.contentView.addChildView(copyright); | ||
|
||
this.contentView.setStyle({ | ||
alignItems: 'center', | ||
padding: basicStyle.padding, | ||
gap: basicStyle.padding / 2, | ||
}); | ||
this.resizeToFitContentView(); | ||
this.window.setResizable(false); | ||
this.window.setMinimizable(false); | ||
} | ||
|
||
saveState() { | ||
return null; // do not remember state | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters