This repository was archived by the owner on May 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
feat: Relates to #312. Taskbar app #332
Merged
Merged
Changes from all commits
Commits
Show all changes
165 commits
Select commit
Hold shift + click to select a range
0fba9ea
WIP: Relates to #312. Initial setup using menubar library
ltfschoen 4cc3a6a
feat: Update Readme. Add taskbar icon. Tweak taskbar window size. Cha…
ltfschoen c5aa7d7
refactor: Remove temporary hello world file
ltfschoen a280b07
Merge branch 'master' into luke-312-taskbar-app
ltfschoen 730fd87
docs: Update Readme to include building before running
ltfschoen 02b0d95
docs: Move onto separate line
ltfschoen b2a4092
fix: Update Onboarding component and make Terms & Conditions consiste…
ltfschoen 64f65f4
fix: Add white background body element so Onboarding background consi…
ltfschoen c204424
feat: Change mainWindow file extension to TypeScript file
ltfschoen ff1a7e5
feat: Create FetherWindow class
ltfschoen 3a1c9d7
refactor: Move FetherWindow component into module folder. Fix its type
ltfschoen c703da0
refactor: Rename fetherWindow to app
ltfschoen 7e91f70
refactor: Rename FetherWindow to FetherApp. fetherApp var stores window
ltfschoen 60027ca
fix: Change back to JS from TS
ltfschoen 5abd34a
fix: Replace TS with Babel.js in fether-electron
ltfschoen a17aaf0
refactor: Move FetherApp options into FetherAppOptions class
ltfschoen 7a9a81b
refactor: Move download, installation, and running of Parity Ethereum…
ltfschoen 5610464
refactor: Move into default options.index the Electron start url
ltfschoen 9ed899c
refactor: Move all FetherApp dependencies into subfolders within app …
ltfschoen d101121
fix: isRunning boolean returned to .then
ltfschoen 30abe60
fix: Add hasVisibleWindows and event to activate Electron listener
ltfschoen 70ebf94
docs: Add Fixme
ltfschoen 4763ac0
refactor: Integrate menubar. Separate logic for taskbar app. See comm…
ltfschoen 7b0873b
refactor: Remove menubar demo and dependency
ltfschoen 36c5399
Merge branch 'master' into luke-312-taskbar-app
ltfschoen ae917cc
refactor: Destructuring of fetherApp properties
ltfschoen b63313b
feat: Replace taskbar icon with Parity Ethereum Fether instead of Par…
ltfschoen 666bbb5
feat: Add method for fetherApp event listener handlers setup and move…
ltfschoen 57e3c7e
feat: Add EventListener error listener
ltfschoen f29672a
fix: Fix so that it shows the window automatically when loaded in tas…
ltfschoen c8e7b90
fix: Fix naming of event listeners so they match. Reorder in order th…
ltfschoen 794ae5c
feat: Add security configuration options to Electron. Add progress ba…
ltfschoen 34e52b1
refactor: Add newlines so steps are readable
ltfschoen 03d9e80
Merge branch 'master' into luke-312-taskbar-app
ltfschoen 41e1b03
feat: Makde body element draggable
ltfschoen aa232ae
feat: Configure window to be alwaysOnTop
ltfschoen 17c4a2b
fix: Save window and restore within bounds of tray when restored
ltfschoen 0bf4455
WIP: Fixes window position when screen resolution reduced. Restores t…
ltfschoen 9fe0756
WIP: Refactor by moving some code into settings and utils/window
ltfschoen eb673a8
test: Setup fether-electron tests. Add tests for Fether window
ltfschoen d64bb09
fix: Fix semicolon wrong place
ltfschoen 4ea5ae0
WIP: Add classes and elements for no-drag, or no user selection
ltfschoen c561f1e
merge latest from master and fix conflicts
ltfschoen b2a4a07
review-fix: Try to make token cards clickable on account page. Try fu…
ltfschoen 70ff7eb
remove console.logs
ltfschoen e38bff0
feat: Add automatic opening of DevTools when flag provided
ltfschoen ea8c837
merge latest master and fix merge conflicts
ltfschoen eca0023
Merge branch 'master' into luke-312-taskbar-app
ltfschoen 5f4f205
WIP: Saves position windows. Incorrect screen dims being used. Debugging
ltfschoen 893cd5e
WIP - move window up into view when window bottom of screen and navig…
ltfschoen 4fbd36f
refactor: Move Electron menu template into separate file. Create even…
ltfschoen 32d1bc5
fix: Use window after defined
ltfschoen 8ce7add
feat: Add context menu on right click for Windows
ltfschoen ffffaa9
feat: Toggle Fether menu with ALT-M in Windows but menu items do not …
ltfschoen 61ab4ef
refactor: Remove useless debugger
ltfschoen 85197a7
fix: Fix missing code
ltfschoen d20f255
refactor: Remove console.logs
ltfschoen 84ee045
refactor: Cleanup console.log
ltfschoen f6e811e
fix: Only run hookWindowMessage on Windows
ltfschoen 9bb328d
Disable taskbar app mode on linux
ltfschoen ab04406
WIP - Fether menu window frame on Windows and Feedback adjust
ltfschoen bc8a6dd
Show Fether menu in frame always on Windows
ltfschoen 21e20b1
Hide menu bar by default. Comment out code that not working
ltfschoen 7460b19
fix comment
ltfschoen 418ce12
Merge branch 'master' into luke-312-taskbar-app
ltfschoen 0f373a1
fix: Recover save position and show icon on Windows
ltfschoen a81b1a9
refactor: Move showTrayBalloon into own method
ltfschoen ff88225
fix: Add missing options prop
ltfschoen 6e8aafc
feat: Run showTrayBalloon when Fether window is maximised or restored
ltfschoen 710a582
docs: Update Readme
ltfschoen c0b3fa1
feat: Save window position on Linux. Refactor events
ltfschoen 3e606c2
fix: Fix save windows position on minimise on Linux. Add taskbar usag…
ltfschoen aad638b
fix: Reduce debounce to 1s so on Linux if crash 1s after move it save…
ltfschoen e68c763
fix: Minimise should only save position, not kill window object too
ltfschoen 2068b60
fix: Fix so unregisters relevant listeners when click close button in…
ltfschoen 3ae04f8
docs: Update Readme with Windows non-taskbar info
ltfschoen 9359890
Move icons to static folder
amaury1093 a20c55f
Merge pull request #396 from paritytech/am-312-taskbar-app
ltfschoen 83114f1
fix: Remove unused image
ltfschoen b8c1a82
chore: Add copyright to electron-builder config
ltfschoen 9bbff3e
fix: Add new taskbar icons with higher DPI
ltfschoen d2acf13
temp: Try adding more icons to see how to increase windows taskbar ic…
ltfschoen e313366
chore: Remove all useless icons that do not chagne poor quality icon …
ltfschoen f6341a2
fix: Prevent removalAllListeners of undefined error when close window…
ltfschoen aa5abc1
feat: Add Windows icon
ltfschoen 0c0788c
review-fix: Remove blue background highlight from tray icon on macOS
ltfschoen b4d3a3b
refactor: State that downloading Parity Ethereum precisely
ltfschoen 955bcad
review-fix: Remove craco and extend dependencies
ltfschoen 7aa59ce
review-fix: Replace console.logs with pino
ltfschoen dfb3f7b
test: Update package.json to use Jest with colours
ltfschoen 7c9eb5f
test: Setup Jest
ltfschoen 1807ca2
test: Mock pino.info to pass Fether window tests in Fether Electron
ltfschoen 22ed464
test: Fix pipelineOperator error that was failing tests
ltfschoen d293a7d
test: Fix Babel decorators plugin errors
ltfschoen d2c41d0
test: Fix all failing tests
ltfschoen cc280b7
fix: Remove Babel plugins that broke yarn electron build but are unne…
ltfschoen cc9ece9
refactor: Remove unnecessary use of extend library dependency and use…
ltfschoen a246b80
review-fix: Convert FetherApp options into function instead of class
ltfschoen 546e44d
fix: Do not show taskbar icon when run in TASKBAR=false mode
ltfschoen 2dccca1
review-fix: Convert FetherApp class create method into constructor
ltfschoen c04a3ac
refactor: Move FetherApp methods into methods folder
ltfschoen e0b77f7
fix: Fix config
ltfschoen 00c95b0
refactor: Move setup of listeners to end
ltfschoen 79ea08a
fix: Return menu from getMenu
ltfschoen 1f2a846
chore: Replace small tray icon with white on black icon
ltfschoen b7478ea
feat: Change taskbar icons to white on transparent with 5x sizes
ltfschoen 8e4919e
fix: Improve 16x16 icon monotone transparent
ltfschoen 389873b
remove old 16x16 icon
ltfschoen 9757370
add new 16x16 icon
ltfschoen a1aa02e
move old tray icons
ltfschoen 2819f62
chore: Tray icon rename old white background icons. Windows use .ico …
ltfschoen d478303
remove 16x16 tray icon since invisible on non-retina
ltfschoen e42e8f5
replace with new 16x16 tray icon
ltfschoen dc3d47e
move white 16x16 tray icon to old since non-retina has white backgrou…
ltfschoen 3edd2cb
fix: Add 16x16 black icon for non-retina since tray background is white
ltfschoen a9592c4
remove old 16x16 non-retina tray icon since bad shape
ltfschoen 091238b
fix: Add new 16x16 non-retina with tweaked shape
ltfschoen f2f2736
remove old 16x16 non-retina tray icon since bad shape
ltfschoen 1cacdea
fix: Add new 16x16 non-retina with tweaked shape
ltfschoen 3669299
fix: Add dock icon to static folder and set it so it appears in devel…
ltfschoen aed978a
fix: Rename to __Template so on macOS the image adapts to both light …
ltfschoen 13fd3cc
fix: Rename to use template icon file with _Template postfix on macOS
ltfschoen c0daacb
refactor: Move mac tray icons into subfolder
ltfschoen 3d4e54c
fix: Add icon.png amongst _Template.png files otherwise does not compile
ltfschoen 56dd39b
fix: Fix quality of icon used in balloon on Windows to be 64x64px
ltfschoen bf5dbf9
merge latest from master
ltfschoen adf8737
review-fix: Fix incorrectly loaded path dependency
ltfschoen 3f3d288
fix: Fixes Cannot read getGlobal of undefined since remote must be en…
ltfschoen 27ca625
review-fix: Remove empty craco config file from fether electron
ltfschoen dba6a22
fix: Add changes made in PR #403 to fix bug #401
ltfschoen 0d9f269
test: Update to latest Babel 7 plugins following migration guide and …
ltfschoen e9b95dc
WIP
ltfschoen 6ad5502
WIP - Refactor methods to be directly associated with class. Yet to d…
ltfschoen 32d53c6
refactor: Remove double quotes
ltfschoen 1867a83
refactor: Reorder methods alphabetically
ltfschoen 8115e9b
refactor: Remove double quotes
ltfschoen 9d5c0f1
refactor: Remove eslint-disable-lines since no longer used
ltfschoen 48e5bd6
refactor: Update according to eslint recommendation
ltfschoen fcb43a9
refactor: Rename thatFA to fetherApp now that everythings in order
ltfschoen b561844
refactor: Polishing up. Shorten names and destructuring
ltfschoen 6c06a36
fix: Fix linting errors
ltfschoen 18c9536
refactor: Rename files to match function names
ltfschoen dbf6dab
fix: Use constructor when creating ParityEthereum class instance
ltfschoen 0387a3f
fix: Must pass context of fetherApp as argument to different methods
ltfschoen 22d7c13
review-fix: Remove commented out old event emitter line of code
ltfschoen dd47b9b
WIP - attempt to address review comments
ltfschoen 7ec1855
WIP
ltfschoen 2673b0c
WIP - use craco in fether-react, and jest in fether-electron, as inst…
ltfschoen 3aecfba
WIP - restore fether-electron's babel.config.js so tests pass
ltfschoen 688ceca
chore: Restore newer versions since tests still pass
ltfschoen fd8615f
Merge pull request #406 from paritytech/luke-312-taskbar-tests
ltfschoen b497ba2
fix: Do not show balloon message every time ALT key is pressed on Win…
ltfschoen 9e0b9b7
chore: Update yarn.lock
ltfschoen ea705cd
test: Update fether-react test command per Axel recommendation in PR …
ltfschoen af9340f
merge latest master and fix conflicts
ltfschoen b8ec52b
chore: Revert to using older version of commander
ltfschoen 2b5a97d
Merge branch 'master' into luke-312-taskbar-app
ltfschoen 060d7d3
feat: Show frame on Linux too. Menu visible on load for non-macOS. Re…
ltfschoen 21b974c
fix: Remove unnecessary leftover .apply
ltfschoen 80accae
refactor: Move menu logic into setupMenu method
ltfschoen 510b7e9
fix: createWindow may be called from showWindow too, but we were not …
ltfschoen 1210a11
fix: Allow dev tools in production
ltfschoen 66f2820
fix: Fix bug where Fether window closed and webrequest received when …
ltfschoen f1d7792
fix: Fix error when click tray icon to re-open Fether window after ch…
ltfschoen b4318da
fix: Resize Fether window on Windows with additional height upon load…
ltfschoen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,4 @@ | ||
| module.exports = { | ||
| plugins: [['@babel/plugin-proposal-class-properties', { loose: false }]], | ||
| presets: ['@babel/preset-env'] | ||
| }; | ||
Binary file not shown.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,114 @@ | ||
| // Copyright 2015-2018 Parity Technologies (UK) Ltd. | ||
| // This file is part of Parity. | ||
| // | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| import EventEmitter from 'events'; | ||
|
|
||
| import { | ||
| calculateWinPosition, | ||
| createPositioner, | ||
| createTray, | ||
| createWindow, | ||
| fixWinPosition, | ||
| getScreenResolution, | ||
| hideWindow, | ||
| loadTray, | ||
| moveWindowUp, | ||
| onTrayClick, | ||
| onWindowClose, | ||
| processSaveWinPosition, | ||
| setupAppListeners, | ||
| setupDebug, | ||
| setupGlobals, | ||
| setupLogger, | ||
| setupMenu, | ||
| setupParityEthereum, | ||
| setupRequestListeners, | ||
| setupSecurity, | ||
| setupWinListeners, | ||
| setupWin32Listeners, | ||
| showTrayBalloon, | ||
| showWindow, | ||
| updateProgress, | ||
| windowClear | ||
| } from './methods'; | ||
|
|
||
| let hasCalledInitFetherApp = false; | ||
|
|
||
| class FetherApp extends EventEmitter { | ||
| constructor (electronApp, options) { | ||
| super(); | ||
|
|
||
| if (hasCalledInitFetherApp) { | ||
| this.emit( | ||
| 'error', | ||
| new Error('Unable to initialise Fether app more than once') | ||
| ); | ||
| } | ||
|
|
||
| /** | ||
| * After the Fether instance and fetherApp.win has been created. | ||
| * If the user then chooses from the Fether Menu "Window > Close" | ||
| * it runs windowClear, which deletes fetherApp.win and associated | ||
| * listeners since the 'close' event also occurs when the user exits. | ||
| * If the user then clicks the tray icon to re-open the Fether window, | ||
| * it will run the onTrayClick method, which calls fetherApp.showWindow | ||
| * and if fetherApp.win does not exist, it runs showWindow and createWindow | ||
| * to restore create fetherApp.win again and associated listeners. However we | ||
| * do not need to run all the fetherApp methods again like we did on the | ||
| * when fetherApp.win was first created (i.e. createTray, loadTray, | ||
| * setupDebug, setupSecurity, setupLogger, setupParityEthereum, setupGlobals) | ||
| */ | ||
| this.app = electronApp; | ||
| this.options = options; | ||
|
|
||
| this.createWindow(); | ||
| this.updateProgress(0.4, undefined); | ||
|
|
||
| // These methods are called only once when Fether instance is created | ||
| // (i.e. not called again when the Fether window closed and re-opened) | ||
| this.createTray(); | ||
| this.loadTray(); | ||
| this.setupDebug(); | ||
| this.setupSecurity(); | ||
| this.setupLogger(); | ||
| this.setupParityEthereum(); | ||
| this.setupGlobals(); | ||
|
|
||
| this.updateProgress(0.8, undefined); | ||
| this.showWindow(undefined); | ||
| this.updateProgress(1.0, undefined); | ||
| this.updateProgress(-1, 'after-create-app'); | ||
| } | ||
|
|
||
| calculateWinPosition = () => calculateWinPosition(this); | ||
| createPositioner = () => createPositioner(this); | ||
| createTray = () => createTray(this); | ||
| createWindow = () => createWindow(this); | ||
| fixWinPosition = positionStruct => fixWinPosition(this, positionStruct); | ||
| getScreenResolution = () => getScreenResolution(); | ||
| hideWindow = () => hideWindow(this); | ||
| loadTray = () => loadTray(this); | ||
| moveWindowUp = () => moveWindowUp(this); | ||
| onTrayClick = (e, bounds) => onTrayClick(this, e, bounds); | ||
| onWindowClose = () => onWindowClose(this); | ||
| processSaveWinPosition = () => processSaveWinPosition(this); | ||
| setupAppListeners = () => setupAppListeners(this); | ||
| setupDebug = () => setupDebug(this); | ||
| setupGlobals = () => setupGlobals(); | ||
| setupLogger = () => setupLogger(); | ||
| setupMenu = () => setupMenu(this); | ||
| setupParityEthereum = () => setupParityEthereum(this); | ||
| setupRequestListeners = () => setupRequestListeners(this); | ||
| setupSecurity = () => setupSecurity(this); | ||
| setupWinListeners = () => setupWinListeners(this); | ||
| setupWin32Listeners = () => setupWin32Listeners(this); | ||
| showTrayBalloon = () => showTrayBalloon(this); | ||
| showWindow = trayPos => showWindow(this, trayPos); | ||
| updateProgress = (percentage, eventListenerName) => | ||
| updateProgress(this, percentage, eventListenerName); | ||
| windowClear = () => windowClear(this); | ||
| } | ||
|
|
||
| export default FetherApp; |
This file contains hidden or 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,21 @@ | ||
| // Copyright 2015-2018 Parity Technologies (UK) Ltd. | ||
| // This file is part of Parity. | ||
| // | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| import electron from 'electron'; | ||
| import { template } from './template'; | ||
|
|
||
| const { Menu } = electron; | ||
|
|
||
| const menu = Menu.buildFromTemplate(template); | ||
|
|
||
| const getMenu = () => { | ||
| return Menu.getApplicationMenu(); | ||
| }; | ||
|
|
||
| const addMenu = () => { | ||
| Menu.setApplicationMenu(menu); | ||
| }; | ||
|
|
||
| export { addMenu, getMenu }; |
87 changes: 87 additions & 0 deletions
87
packages/fether-electron/src/main/app/menu/template/index.js
This file contains hidden or 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,87 @@ | ||
| // Copyright 2015-2018 Parity Technologies (UK) Ltd. | ||
| // This file is part of Parity. | ||
| // | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| import electron from 'electron'; | ||
|
|
||
| const { app, shell } = electron; | ||
|
|
||
| // Create the Application's main menu | ||
| // https://github.com/electron/electron/blob/master/docs/api/menu.md#examples | ||
| export const template = [ | ||
| { | ||
| label: 'Edit', | ||
| submenu: [ | ||
| { role: 'cut' }, | ||
| { role: 'copy' }, | ||
| { role: 'paste' }, | ||
| { role: 'delete' }, | ||
| { role: 'selectall' } | ||
| ] | ||
| }, | ||
| { | ||
| label: 'View', | ||
| submenu: [ | ||
| { role: 'reload' }, | ||
| { role: 'forcereload' }, | ||
| { role: 'toggledevtools' }, | ||
| { type: 'separator' }, | ||
| { role: 'resetzoom' }, | ||
| { role: 'zoomin' }, | ||
| { role: 'zoomout' }, | ||
| { type: 'separator' }, | ||
| { role: 'togglefullscreen' } | ||
| ] | ||
| }, | ||
| { | ||
| role: 'window', | ||
| submenu: [{ role: 'minimize' }, { role: 'close' }] | ||
| }, | ||
| { | ||
| role: 'help', | ||
| submenu: [ | ||
| { | ||
| label: 'Learn More', | ||
| click () { | ||
| shell.openExternal('https://parity.io'); | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ]; | ||
|
|
||
| if (process.platform === 'darwin') { | ||
| template.unshift({ | ||
| label: app.getName(), | ||
| submenu: [ | ||
| { role: 'about' }, | ||
| { type: 'separator' }, | ||
| { role: 'services', submenu: [] }, | ||
| { type: 'separator' }, | ||
| { role: 'hide' }, | ||
| { role: 'hideothers' }, | ||
| { role: 'unhide' }, | ||
| { type: 'separator' }, | ||
| { role: 'quit' } | ||
| ] | ||
| }); | ||
|
|
||
| // Edit menu | ||
| template[1].submenu.push( | ||
| { type: 'separator' }, | ||
| { | ||
| label: 'Speech', | ||
| submenu: [{ role: 'startspeaking' }, { role: 'stopspeaking' }] | ||
| } | ||
| ); | ||
|
|
||
| // Window menu | ||
| template[3].submenu = [ | ||
| { role: 'close' }, | ||
| { role: 'minimize' }, | ||
| { role: 'zoom' }, | ||
| { type: 'separator' }, | ||
| { role: 'front' } | ||
| ]; | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.