Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
b542edc6
Commit
b542edc6
authored
Oct 25, 2017
by
dev0tion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix left mouse button tray behavior and tray icon
parent
35a906bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
22 deletions
+23
-22
main.ts
Breeze.UI/main.ts
+23
-22
No files found.
Breeze.UI/main.ts
View file @
b542edc6
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
const
app
=
electron
.
app
;
const
app
=
electron
.
app
;
// Module to create native browser window.
// Module to create native browser window.
const
BrowserWindow
=
electron
.
BrowserWindow
;
const
BrowserWindow
=
electron
.
BrowserWindow
;
const
nativeImage
=
require
(
'electron'
).
nativeImage
const
path
=
require
(
'path'
);
const
path
=
require
(
'path'
);
const
url
=
require
(
'url'
);
const
url
=
require
(
'url'
);
...
@@ -181,36 +182,36 @@ function createTray() {
...
@@ -181,36 +182,36 @@ function createTray() {
const
Menu
=
electron
.
Menu
;
const
Menu
=
electron
.
Menu
;
const
Tray
=
electron
.
Tray
;
const
Tray
=
electron
.
Tray
;
let
appIcon
=
null
;
let
trayIcon
;
var
iconPath
if
(
os
.
platform
()
===
'win32'
)
{
if
(
serve
)
{
if
(
serve
)
{
iconPath
=
'.
\\
src
\\
assets
\\
images
\\
breeze-logo-tray.ico'
;
trayIcon
=
nativeImage
.
createFromPath
(
'./src/assets/images/breeze-logo.png'
)
;
}
else
{
}
else
{
iconPath
=
path
.
join
(
__dirname
+
'
\\
assets
\\
images
\\
breeze-logo-tray
.png'
);
trayIcon
=
nativeImage
.
createFromPath
(
'./assets/images/breeze-logo
.png'
);
}
}
}
else
{
let
systemTray
=
new
Tray
(
trayIcon
);
if
(
serve
)
{
const
contextMenu
=
Menu
.
buildFromTemplate
([
iconPath
=
'./src/assets/images/breeze-logo-tray.png'
;
{
}
else
{
label
:
'Hide/Show'
,
iconPath
=
path
.
join
(
__dirname
+
'//assets//images//breeze-logo-tray.png'
);
click
:
function
()
{
}
mainWindow
.
isVisible
()
?
mainWindow
.
hide
()
:
mainWindow
.
show
();
}
}
}
]);
systemTray
.
setToolTip
(
'Breeze Wallet'
);
systemTray
.
setContextMenu
(
contextMenu
);
systemTray
.
on
(
'click'
,
function
()
{
if
(
!
mainWindow
.
isVisible
())
{
mainWindow
.
show
();
}
appIcon
=
new
Tray
(
iconPath
);
if
(
!
mainWindow
.
isFocused
())
{
const
contextMenu
=
Menu
.
buildFromTemplate
([{
mainWindow
.
focus
();
label
:
'Hide/Show'
,
click
:
function
()
{
mainWindow
.
isVisible
()
?
mainWindow
.
hide
()
:
mainWindow
.
show
();
}
}
}]);
});
appIcon
.
setToolTip
(
'Breeze Wallet'
);
appIcon
.
setContextMenu
(
contextMenu
);
app
.
on
(
'window-all-closed'
,
function
()
{
app
.
on
(
'window-all-closed'
,
function
()
{
if
(
appIcon
)
appIcon
.
destroy
();
if
(
systemTray
)
systemTray
.
destroy
();
});
});
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment