Skip to content

Commit

Permalink
Add icon (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
freekode authored Feb 19, 2024
1 parent 3823c1d commit c14b013
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 45 deletions.
42 changes: 3 additions & 39 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,42 +1,6 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

application-dev.yaml
tp2intervals.sqlite
*.log*
node_modules

.idea
.vscode
42 changes: 42 additions & 0 deletions boot/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

application-dev.yaml
tp2intervals.sqlite
*.log*
node_modules
Binary file added electron/build/icon.icns
Binary file not shown.
Binary file added electron/build/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion electron/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ nsis:
uninstallDisplayName: ${productName}
createDesktopShortcut: always
mac:
icon: resources/icon.png
target:
target: default
arch:
Expand All @@ -44,6 +43,8 @@ extraResources:
- from: '../ui/dist/ui'
filter: '**/*'
- 'dev-app-update.yml'
- from: 'build/icon.png'
to: 'icon.png'
publish:
provider: github
owner: freekode
Expand Down
Binary file removed electron/resources/icon.png
Binary file not shown.
14 changes: 10 additions & 4 deletions electron/src/main/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { app, BrowserWindow, shell } from 'electron';
import path from 'path';
import './boot'
import { bootController, getBootController, initBootController } from './boot/boot-controller';
import { bootController, initBootController } from './boot/boot-controller';
import { systemEvents } from './events';
import log from 'electron-log';
import { appUpdater } from "./autoupdate/app-updater";
Expand All @@ -17,6 +17,12 @@ log.info("isDev", isDev)
let splashWindow: BrowserWindow | null = null;
let mainWindow: BrowserWindow | null = null;

const getIconPath = () => {
return app.isPackaged
? path.join(process.resourcesPath, 'icon.png')
: path.join(__dirname, '../../build/icon.png');
}

const getSplashWindowPageUrl = () => {
if (app.isPackaged) {
return 'file://' + path.join(__dirname, `../../../browser/assets/loading.html`);
Expand All @@ -34,12 +40,12 @@ const getMainWindowPageUrl = () => {
}

const createSplashWindow = async () => {
// todo add icon
splashWindow = new BrowserWindow({
show: true,
title: 'Loading',
width: 500,
height: 300,
icon: getIconPath(),
resizable: false,
frame: false,
center: true,
Expand All @@ -64,13 +70,13 @@ const createSplashWindow = async () => {
};

const createMainWindow = async () => {
// todo add icon
mainWindow = new BrowserWindow({
show: false,
width: 650,
height: 800,
height: 850,
minWidth: 500,
minHeight: 450,
icon: getIconPath(),
trafficLightPosition: {x: 12, y: 12},
autoHideMenuBar: true,
webPreferences: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class TrainingPeaksActionsComponent implements OnInit {
trainingTypes: any[];

private readonly selectedPlanDirection = this.directions[0].value;
private readonly selectedTrainingTypes = ['BIKE', 'VIRTUAL_BIKE'];
private readonly selectedTrainingTypes = ['BIKE', 'VIRTUAL_BIKE', 'MTB'];
private readonly todayDate = formatDate(new Date(), DATE_FORMAT, LOCALE)
private readonly tomorrowDate = formatDate(new Date(new Date().setDate(new Date().getDate() + 1)), DATE_FORMAT, LOCALE)

Expand Down

0 comments on commit c14b013

Please sign in to comment.