mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
update StatusBar
fix width of URL status show dialog before update
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
absolute left
|
absolute left
|
||||||
height 24px
|
height 24px
|
||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
width 350px
|
right 185px
|
||||||
line-height 24px
|
line-height 24px
|
||||||
font-size 12px
|
font-size 12px
|
||||||
padding 0 15px
|
padding 0 15px
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
position absolute
|
position absolute
|
||||||
right 60px
|
right 60px
|
||||||
height 24px
|
height 24px
|
||||||
|
width 125px
|
||||||
border-width 0 0 0 1px
|
border-width 0 0 0 1px
|
||||||
border-style solid
|
border-style solid
|
||||||
border-color $ui-borderColor
|
border-color $ui-borderColor
|
||||||
|
|||||||
@@ -6,14 +6,17 @@ import ZoomManager from 'browser/main/lib/ZoomManager'
|
|||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const ipc = electron.ipcRenderer
|
const ipc = electron.ipcRenderer
|
||||||
const { remote } = electron
|
const { remote } = electron
|
||||||
const { Menu, MenuItem } = remote
|
const { Menu, MenuItem, dialog } = remote
|
||||||
|
|
||||||
const zoomOptions = [0.8, 0.9, 1, 1.1, 1.2, 1.3]
|
const zoomOptions = [0.8, 0.9, 1, 1.1, 1.2, 1.3]
|
||||||
|
|
||||||
class StatusBar extends React.Component {
|
class StatusBar extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {updateAvailable: false}
|
|
||||||
|
this.state = {
|
||||||
|
updateAvailable: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
@@ -23,7 +26,16 @@ class StatusBar extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateApp () {
|
updateApp () {
|
||||||
ipc.send('update-app', 'Deal with it.')
|
let index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
|
type: 'warning',
|
||||||
|
message: 'Update Boostnote',
|
||||||
|
detail: 'New Boostnote is ready to be installed.',
|
||||||
|
buttons: ['Restart & Install', 'Not Now']
|
||||||
|
})
|
||||||
|
|
||||||
|
if (index === 0) {
|
||||||
|
ipc.send('update-app', 'Deal with it.')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleZoomButtonClick (e) {
|
handleZoomButtonClick (e) {
|
||||||
@@ -55,7 +67,7 @@ class StatusBar extends React.Component {
|
|||||||
<div className='StatusBar'
|
<div className='StatusBar'
|
||||||
styleName='root'
|
styleName='root'
|
||||||
>
|
>
|
||||||
<div styleName='pathname'>{location.pathname}</div>
|
<div styleName='pathname'>{location.pathname + location.search}</div>
|
||||||
{this.state.updateAvailable
|
{this.state.updateAvailable
|
||||||
? <button onClick={this.updateApp} styleName='update'>
|
? <button onClick={this.updateApp} styleName='update'>
|
||||||
<i styleName='update-icon' className='fa fa-cloud-download'/> Update is available!
|
<i styleName='update-icon' className='fa fa-cloud-download'/> Update is available!
|
||||||
|
|||||||
Reference in New Issue
Block a user