From 27abfc8957d7587f7a25fa9d14a942ce2d983c47 Mon Sep 17 00:00:00 2001 From: Alvin Yu Date: Mon, 17 Aug 2015 20:24:02 +1000 Subject: [PATCH 1/3] New feature - right-click on Zoom button will reset the window (size & position). --- views/navigation-bar.cjsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/views/navigation-bar.cjsx b/views/navigation-bar.cjsx index 6314986..98dcee4 100644 --- a/views/navigation-bar.cjsx +++ b/views/navigation-bar.cjsx @@ -66,6 +66,12 @@ NavigationBar = React.createClass # MacOSX can handle maximize & unmaximize automatically. # May need to call unmaximize() on some OS?? remote.getCurrentWindow().maximize() + resetWindow: -> + remote.getCurrentWindow().setBounds + x: (config.get 'poi.window.x', 0) + 800 + y: config.get 'poi.window.y', 0 + width: 800 + height: 750 toggleFullscreen: -> currWin = remote.getCurrentWindow() currWin.setFullScreen(!currWin.isFullScreen()) @@ -82,7 +88,7 @@ NavigationBar = React.createClass   - +   From 71193d3260d4b249b45f6167a1410df0d4bc9324 Mon Sep 17 00:00:00 2001 From: Alvin Yu Date: Mon, 17 Aug 2015 21:53:19 +1000 Subject: [PATCH 2/3] New hide button Added a hide button to the nav-bar. It only hides the window, instead of close it (will keep consuming memory, but faster when the next time open it). --- views/navigation-bar.cjsx | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/views/navigation-bar.cjsx b/views/navigation-bar.cjsx index 98dcee4..f568941 100644 --- a/views/navigation-bar.cjsx +++ b/views/navigation-bar.cjsx @@ -75,24 +75,31 @@ NavigationBar = React.createClass toggleFullscreen: -> currWin = remote.getCurrentWindow() currWin.setFullScreen(!currWin.isFullScreen()) + hideWindow: -> + remote.getCurrentWindow().hide() copyToClipboard: -> webview.copy() render: -> - - - - - - -  {@getIcon()}  - -   - - - - -   - - + + + + + + + +  {@getIcon()}  + +   + + + + +   + + + + + + module.exports = NavigationBar From 8f2db64e386474c4f2402f720f8a7a1abbebb10b Mon Sep 17 00:00:00 2001 From: Alvin Yu Date: Mon, 17 Aug 2015 22:05:21 +1000 Subject: [PATCH 3/3] Set a minimum window size The buttons can be messed up if the window is too small, so give it a minimum size. Also updated plugin version. --- README.md | 5 +++++ index.cjsx | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 89136ac..85a1c66 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,11 @@ Put the folder in _root_of_poi_/resources/app/plugins ### Change Log +#### v1.1.0 +* New button features + * Right-click on Zoom button will reset the window size and position. + * New Hide button. + #### v1.0.1 * Removed a label (which didn't work, and wouldn't look good if it worked...). Use plain text instead. diff --git a/index.cjsx b/index.cjsx index 05ae494..cf8d376 100644 --- a/index.cjsx +++ b/index.cjsx @@ -46,6 +46,7 @@ initialPoiStatsWindow = -> height: size[1] realClose: true window.poiStatsWindow = newWindow + newWindow.setMinimumSize 600, 425 newWindow.on 'move', savePoiStatsWindowPosition newWindow.on 'resize', savePoiStatsWindowSize newWindow.on 'closed', onPoiStatsWindowClosed @@ -62,7 +63,7 @@ module.exports = displayName: {__ 'PluginName'} author: 'Alvin Yu' link: 'https://github.com/alvin-777/poi-plugin-poi-stats' - version: '0.2.0' + version: '1.1.0' description: __ 'PluginDesc' handleClick: -> if window.poiStatsWindow != null