6 Commits

Author SHA1 Message Date
aa3a3ea265 testing tray 2021-05-29 15:28:06 +02:00
f1c0ab6dbb restore focus to orignal window 2021-05-28 21:05:12 +02:00
53c16e7063 version bump 2021-05-28 20:56:43 +02:00
2606214e53 tray icon 2021-05-28 20:56:35 +02:00
f5ecebb61a fix settings open 2021-05-28 20:54:56 +02:00
3129030d00 releasing docs 2021-05-15 17:17:44 +02:00
11 changed files with 33 additions and 19 deletions

View File

@@ -2,9 +2,6 @@ name: Main
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
jobs:
build:

View File

@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.1.1] - 2021-05-28
### Added
- Restore focus to previous window when closing banner
- Responsive image
### Fixed
- Settings page not opening
## [1.1.0] - 2021-05-15
### Added

View File

@@ -35,4 +35,4 @@ Alternatively you can run `yarn build` and the `yarn electron-builder -m` for `m
1. Bump version in `package.json`
2. Update `CHANGELOG.md`
3. Create a draft release with the new version. (e.g. tag with `v1.2.3`).
4. Push to `main` and github workflow will build and upload assets to the draft matching the version of `package.json` and draft.
4. Start the publish action and the ci will build and upload assets to the draft matching the version of `package.json` and draft.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 16 KiB

BIN
assets/trayTemplate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
assets/trayTemplate@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
design/tray.afdesign LFS Normal file

Binary file not shown.

View File

@@ -11,7 +11,7 @@
"repository": {
"url": "https://github.com/cupcakearmy/unpixel"
},
"version": "1.1.0",
"version": "1.1.1",
"main": "./dist/back/index.js",
"scripts": {
"start": "electron .",

View File

@@ -1,6 +1,6 @@
import { join } from 'path'
import os from 'os'
import { BrowserWindow, BrowserWindowConstructorOptions, ipcMain } from 'electron'
import { app, BrowserWindow, BrowserWindowConstructorOptions, ipcMain } from 'electron'
import dayjs from 'dayjs'
import logger from 'electron-log'
import ms from 'ms'
@@ -64,6 +64,9 @@ export default class Banner {
static close() {
if (this.window) {
Settings.save('lastRun', Date.now())
this.window.minimize()
this.window.hide()
if (process.platform === 'darwin') app.hide()
this.window.close()
this.window = null
}

View File

@@ -64,7 +64,7 @@ export default class Settings {
static open() {
if (this.win) return
Settings.win = new BrowserWindow({
this.win = new BrowserWindow({
width: 400,
height: 630,
center: true,
@@ -74,20 +74,21 @@ export default class Settings {
contextIsolation: false,
},
})
this.win.on('closed', () => (this.win = null))
const entry = join(__dirname, '../front/settings/index.html')
Settings.win.loadFile(entry)
Settings.win.setMenu(null)
this.win.loadFile(entry)
this.win.setMenu(null)
if (DEV) {
Settings.win.setSize(800, 485)
Settings.win.setResizable(true)
Settings.win.webContents.openDevTools()
this.win.setSize(800, 485)
this.win.setResizable(true)
this.win.webContents.openDevTools()
}
}
static getStatus(): [boolean, number] {
const paused: number = Settings.load('paused')
const paused: number = this.load('paused')
const now = Date.now()
if (paused > now) {
return [true, paused - now]

View File

@@ -60,12 +60,11 @@ export default class TrayUtility {
static init() {
if (!this.tray) {
const file = path.join(__dirname, '../../assets/tray.png')
const icon = nativeImage.createFromPath(file).resize({
width: 24,
height: 24,
})
this.tray = new Tray(icon)
const file = path.join(__dirname, '../../assets/trayTemplate.png')
// const resized = nativeImage.createFromPath(file).resize({ width: 24, height: 24 })
// resized.setTemplateImage(true)
// resized.isMacTemplateImage = true
this.tray = new Tray(file)
this.build()
}
}