Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
3d1b0570
Commit
3d1b0570
authored
2 years ago
by
Loïc Correnson
Committed by
David Bühler
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[dome] update addMenu and addMenuItem doc
parent
28fb400a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ivette/src/dome/main/dome.ts
+1
-1
1 addition, 1 deletion
ivette/src/dome/main/dome.ts
ivette/src/dome/renderer/dome.tsx
+15
-18
15 additions, 18 deletions
ivette/src/dome/renderer/dome.tsx
with
16 additions
and
19 deletions
ivette/src/dome/main/dome.ts
+
1
−
1
View file @
3d1b0570
...
@@ -631,7 +631,7 @@ export function start() {
...
@@ -631,7 +631,7 @@ export function start() {
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
/**
/**
Define a custom main window menu.
Define a custom main window menu.
*/
*/
export
function
addMenu
(
label
:
string
)
{
export
function
addMenu
(
label
:
string
)
{
Menubar
.
addMenu
(
label
);
Menubar
.
addMenu
(
label
);
...
...
This diff is collapsed.
Click to expand it.
ivette/src/dome/renderer/dome.tsx
+
15
−
18
View file @
3d1b0570
...
@@ -364,13 +364,15 @@ const customItemCallbacks = new Map<string, callback>();
...
@@ -364,13 +364,15 @@ const customItemCallbacks = new Map<string, callback>();
/**
/**
Create a new custom menu in the menu bar.
Create a new custom menu in the menu bar.
This function can be triggered at any time, and will eventually trigger
an update of the whole application menubar.
This function shall be called statically, although calls from _secondary_
windows would be ignored. It is also possible to call this function from the
main process.
It is also possible to call this function from the main process.
It is also possible to call this function from the main process.
@param label - the menu title (shall be unique)
@param label - the menu title (shall be unique)
*/
*/
export
function
addMenu
(
label
:
string
)
{
export
function
addMenu
(
label
:
string
)
{
ipcRenderer
.
send
(
'
dome.ipc.menu.addmenu
'
,
label
);
ipcRenderer
.
send
(
'
dome.ipc.menu.addmenu
'
,
label
);
}
}
...
@@ -399,8 +401,7 @@ export interface MenuItemProps {
...
@@ -399,8 +401,7 @@ export interface MenuItemProps {
onClick
?:
()
=>
void
;
onClick
?:
()
=>
void
;
}
}
/**
/** Inserts a new custom item in a menu.
Inserts a new custom item in a menu.
The menu can be modified later with [[setMenuItem]].
The menu can be modified later with [[setMenuItem]].
...
@@ -408,15 +409,15 @@ export interface MenuItemProps {
...
@@ -408,15 +409,15 @@ export interface MenuItemProps {
event on all application windows. The item callback, if any, is invoked only
event on all application windows. The item callback, if any, is invoked only
in the process that specify it.
in the process that specify it.
Key short cuts shall be specified with the following codes:
Key short cuts shall be specified with the following codes:
- `"Cmd+<Key>"`
- `"Cmd+<Key>"`
for command (MacOS) or control (Linux) key
for command (MacOS) or control (Linux) key
- `"Alt+<Key>"` for command+option
- `"Alt
+<Key>"` for command+
option
(MacOS) or
alt (Linux) key
(MacOS) or alt (Linux) key - `"Meta
+<Key>"` for command+
shift
(MacOS) or
- `"Meta+<Key>"` for command+shift (MacOS) or
control+alt (Linux) key
control+alt (Linux) key
This function
can be triggered at any time, and will eventually trigger
This function
shall be called statically, although calls from _secondary_
an update of the complete application menubar.
windows would be ignored. It is also possible to call this function from the
It is also possible to call this function from the
main process.
main process.
*/
*/
export
function
addMenuItem
(
props
:
MenuItemProps
)
{
export
function
addMenuItem
(
props
:
MenuItemProps
)
{
if
(
!
props
.
id
&&
props
.
type
!==
'
separator
'
)
{
if
(
!
props
.
id
&&
props
.
type
!==
'
separator
'
)
{
// eslint-disable-next-line no-console
// eslint-disable-next-line no-console
...
@@ -444,10 +445,6 @@ export interface MenuItemOptions {
...
@@ -444,10 +445,6 @@ export interface MenuItemOptions {
You shall specify `null` to remove the previously registered callback
You shall specify `null` to remove the previously registered callback
(`undefined` callback is ignored).
(`undefined` callback is ignored).
This function can be triggered at any time, and will possibly trigger
an update of the application menubar if the properties
can not be changed dynamically in Electron.
It is also possible to call this function from the main process.
It is also possible to call this function from the main process.
*/
*/
export
function
setMenuItem
(
options
:
MenuItemOptions
)
{
export
function
setMenuItem
(
options
:
MenuItemOptions
)
{
...
@@ -601,7 +598,7 @@ export function useCache<K, V>(r: (k: K) => V, s?: Serialize<K>): (k: K) => V {
...
@@ -601,7 +598,7 @@ export function useCache<K, V>(r: (k: K) => V, s?: Serialize<K>): (k: K) => V {
const
v
=
r
(
k
);
const
v
=
r
(
k
);
cache
.
set
(
id
,
v
);
cache
.
set
(
id
,
v
);
return
v
;
return
v
;
},
[
cache
,
r
,
serialize
]);
},
[
cache
,
r
,
serialize
]);
return
get
;
return
get
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment