Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
mycard
Commits
a5951d38
Commit
a5951d38
authored
May 03, 2023
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add closeToTray
parent
156c1688
Pipeline
#21490
passed with stages
in 4 minutes and 50 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
3 deletions
+46
-3
app/mycard.component.html
app/mycard.component.html
+9
-2
app/mycard.component.ts
app/mycard.component.ts
+16
-1
app/settings.sevices.ts
app/settings.sevices.ts
+21
-0
No files found.
app/mycard.component.html
View file @
a5951d38
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
<i
i18n
(click)=
"currentWindow.minimize()"
class=
"fa fa-minus"
i18n-title
title=
"最小化"
></i>
<i
i18n
(click)=
"currentWindow.minimize()"
class=
"fa fa-minus"
i18n-title
title=
"最小化"
></i>
<i
i18n
*ngIf=
"!currentWindow.isMaximized()"
(click)=
"currentWindow.maximize()"
class=
"fa fa-expand"
i18n-title
title=
"最大化"
></i>
<i
i18n
*ngIf=
"!currentWindow.isMaximized()"
(click)=
"currentWindow.maximize()"
class=
"fa fa-expand"
i18n-title
title=
"最大化"
></i>
<i
i18n
*ngIf=
"currentWindow.isMaximized()"
(click)=
"currentWindow.unmaximize()"
class=
"fa fa-clone"
i18n-title
title=
"还原"
></i>
<i
i18n
*ngIf=
"currentWindow.isMaximized()"
(click)=
"currentWindow.unmaximize()"
class=
"fa fa-clone"
i18n-title
title=
"还原"
></i>
<i
i18n
(click)=
"c
urrentWindow.hide
()"
class=
"fa fa-times"
i18n-title
title=
"关闭"
></i>
<i
i18n
(click)=
"c
loseWindow
()"
class=
"fa fa-times"
i18n-title
title=
"关闭"
></i>
</div>
</div>
</div>
</div>
</nav>
</nav>
...
@@ -66,6 +66,13 @@
...
@@ -66,6 +66,13 @@
<form
(submit)=
"submit()"
>
<form
(submit)=
"submit()"
>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"form-group row"
>
<label
i18n
class=
"col-sm-3 col-form-label"
>
关闭时
</label>
<div
class=
"col-sm-9"
>
<input
type=
"checkbox"
id=
"chkCloseToTray"
[(ngModel)]=
"closeToTray"
name=
"chkCloseToTray"
>
<label
i18n
for=
"chkCloseToTray"
>
点击关闭按钮最小化到系统托盘
</label>
</div>
</div>
<div
class=
"form-group row"
>
<div
class=
"form-group row"
>
<label
i18n
for=
"locale"
class=
"col-sm-3 col-form-label"
>
语言
</label>
<label
i18n
for=
"locale"
class=
"col-sm-3 col-form-label"
>
语言
</label>
<div
class=
"col-sm-9"
>
<div
class=
"col-sm-9"
>
...
@@ -78,7 +85,7 @@
...
@@ -78,7 +85,7 @@
<div
class=
"form-group row"
>
<div
class=
"form-group row"
>
<label
i18n
class=
"col-sm-3 col-form-label"
>
允许导入
</label>
<label
i18n
class=
"col-sm-3 col-form-label"
>
允许导入
</label>
<div
class=
"col-sm-9"
>
<div
class=
"col-sm-9"
>
<input
type=
"checkbox"
[(ngModel)]=
"importEnabled"
name=
"chkImportEnabled"
>
<input
type=
"checkbox"
id=
"chkImportEnabled"
[(ngModel)]=
"importEnabled"
name=
"chkImportEnabled"
>
<label
i18n
for=
"chkImportEnabled"
>
我确认我在开发者指导下使用导入功能
</label>
<label
i18n
for=
"chkImportEnabled"
>
我确认我在开发者指导下使用导入功能
</label>
</div>
</div>
</div>
</div>
...
...
app/mycard.component.ts
View file @
a5951d38
...
@@ -38,6 +38,7 @@ export class MyCardComponent implements OnInit {
...
@@ -38,6 +38,7 @@ export class MyCardComponent implements OnInit {
locale
:
string
;
locale
:
string
;
importEnabled
:
boolean
;
importEnabled
:
boolean
;
closeToTray
:
boolean
;
resizing
:
HTMLElement
|
null
;
resizing
:
HTMLElement
|
null
;
...
@@ -67,6 +68,8 @@ export class MyCardComponent implements OnInit {
...
@@ -67,6 +68,8 @@ export class MyCardComponent implements OnInit {
this
.
currentWindow
.
webContents
.
openDevTools
({
mode
:
'
undocked
'
});
this
.
currentWindow
.
webContents
.
openDevTools
({
mode
:
'
undocked
'
});
}
}
});
});
$
(
'
#settings-modal
'
).
on
(
'
show.bs.modal
'
,
()
=>
{
this
.
update_settings
();
});
//$('[data-toggle="tooltip"]').tooltip();
//$('[data-toggle="tooltip"]').tooltip();
// bootstrap有BUG不能用这玩意
// bootstrap有BUG不能用这玩意
...
@@ -104,9 +107,13 @@ export class MyCardComponent implements OnInit {
...
@@ -104,9 +107,13 @@ export class MyCardComponent implements OnInit {
this
.
set_update_status
(
'
update-downloaded
'
);
this
.
set_update_status
(
'
update-downloaded
'
);
});
});
this
.
update_settings
();
}
update_settings
()
{
this
.
locale
=
this
.
settingsService
.
getLocale
();
this
.
locale
=
this
.
settingsService
.
getLocale
();
this
.
importEnabled
=
this
.
settingsService
.
getImportEnabled
();
this
.
importEnabled
=
this
.
settingsService
.
getImportEnabled
();
this
.
closeToTray
=
this
.
settingsService
.
getCloseToTray
();
}
}
update_retry
()
{
update_retry
()
{
...
@@ -162,6 +169,7 @@ export class MyCardComponent implements OnInit {
...
@@ -162,6 +169,7 @@ export class MyCardComponent implements OnInit {
submit
()
{
submit
()
{
this
.
settingsService
.
setImportEnabled
(
this
.
importEnabled
);
this
.
settingsService
.
setImportEnabled
(
this
.
importEnabled
);
this
.
settingsService
.
setCloseToTray
(
this
.
closeToTray
);
if
(
this
.
locale
!==
this
.
settingsService
.
getLocale
())
{
if
(
this
.
locale
!==
this
.
settingsService
.
getLocale
())
{
this
.
settingsService
.
setLocale
(
this
.
locale
);
this
.
settingsService
.
setLocale
(
this
.
locale
);
remote
.
app
.
relaunch
();
remote
.
app
.
relaunch
();
...
@@ -170,6 +178,13 @@ export class MyCardComponent implements OnInit {
...
@@ -170,6 +178,13 @@ export class MyCardComponent implements OnInit {
$
(
'
#settings-modal
'
).
modal
(
'
hide
'
);
$
(
'
#settings-modal
'
).
modal
(
'
hide
'
);
}
}
closeWindow
()
{
if
(
this
.
closeToTray
)
this
.
currentWindow
.
hide
();
else
remote
.
app
.
quit
();
}
//
//
// moesound_loaded() {
// moesound_loaded() {
// this.moesound.nativeElement.insertCSS(`
// this.moesound.nativeElement.insertCSS(`
...
...
app/settings.sevices.ts
View file @
a5951d38
...
@@ -22,11 +22,13 @@ export class SettingsService {
...
@@ -22,11 +22,13 @@ export class SettingsService {
];
];
static
SETTING_LOCALE
=
'
locale
'
;
static
SETTING_LOCALE
=
'
locale
'
;
static
IMPORT_ENABLED
=
'
importEnabled
'
;
static
IMPORT_ENABLED
=
'
importEnabled
'
;
static
CLOSE_TO_TRAY
=
'
closeToTray
'
;
static
defaultLocale
=
remote
.
app
.
getLocale
();
static
defaultLocale
=
remote
.
app
.
getLocale
();
locale
:
string
;
locale
:
string
;
libraries
:
Library
[];
libraries
:
Library
[];
importEnabled
:
boolean
;
importEnabled
:
boolean
;
closeToTray
:
boolean
;
getLibraries
()
{
getLibraries
()
{
...
@@ -112,4 +114,23 @@ export class SettingsService {
...
@@ -112,4 +114,23 @@ export class SettingsService {
this
.
importEnabled
=
enabled
;
this
.
importEnabled
=
enabled
;
localStorage
.
setItem
(
SettingsService
.
IMPORT_ENABLED
,
enabled
?
'
true
'
:
'
false
'
);
localStorage
.
setItem
(
SettingsService
.
IMPORT_ENABLED
,
enabled
?
'
true
'
:
'
false
'
);
}
}
getCloseToTray
():
boolean
{
if
(
this
.
closeToTray
===
undefined
)
{
let
closeToTray
=
localStorage
.
getItem
(
SettingsService
.
CLOSE_TO_TRAY
);
if
(
!
closeToTray
)
{
this
.
closeToTray
=
true
;
localStorage
.
setItem
(
SettingsService
.
CLOSE_TO_TRAY
,
'
true
'
);
}
else
{
this
.
closeToTray
=
closeToTray
===
'
true
'
;
}
}
return
this
.
closeToTray
;
}
setCloseToTray
(
enabled
:
boolean
)
{
this
.
closeToTray
=
enabled
;
localStorage
.
setItem
(
SettingsService
.
CLOSE_TO_TRAY
,
enabled
?
'
true
'
:
'
false
'
);
}
}
}
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