()
| 7 | |
| 8 | export default class AboutWindow extends BaseWindow { |
| 9 | constructor() { |
| 10 | super(); |
| 11 | |
| 12 | const packageJson = require('../../package.json'); |
| 13 | let iconPath = path.join(__dirname, '../../assets/icons/icon'); |
| 14 | if (packageJson.version.endsWith('-dev')) |
| 15 | iconPath += '-dev'; |
| 16 | const icon = gui.Image.createFromPath(fs.realpathSync(iconPath + '@2x.png')); |
| 17 | |
| 18 | const imageView = gui.GifPlayer.create(); |
| 19 | imageView.setImage(icon); |
| 20 | this.contentView.addChildView(imageView); |
| 21 | const title = gui.Label.create(packageJson.build.productName); |
| 22 | title.setFont(gui.Font.default().derive(1, 'bold', 'normal')); |
| 23 | this.contentView.addChildView(title); |
| 24 | const smallFont = gui.Font.default().derive(-3, 'normal', 'normal'); |
| 25 | const version = gui.Label.create(`Version ${packageJson.version}`); |
| 26 | version.setFont(smallFont); |
| 27 | this.contentView.addChildView(version); |
| 28 | const copyright = gui.Label.create(packageJson.build.copyright); |
| 29 | copyright.setFont(smallFont); |
| 30 | this.contentView.addChildView(copyright); |
| 31 | |
| 32 | this.contentView.setStyle({ |
| 33 | alignItems: 'center', |
| 34 | padding: basicStyle.padding, |
| 35 | gap: basicStyle.padding / 2, |
| 36 | }); |
| 37 | this.resizeToFitContentView(); |
| 38 | this.window.setResizable(false); |
| 39 | this.window.setMinimizable(false); |
| 40 | } |
| 41 | |
| 42 | saveState() { |
| 43 | return null; // do not remember state |
nothing calls this directly
no test coverage detected