@@ -2066,15 +2066,31 @@ registerAction2(class NotebookConfigureLayoutAction extends Action2 {
2066
2066
category : NOTEBOOK_ACTIONS_CATEGORY ,
2067
2067
menu : [
2068
2068
{
2069
- id : MenuId . NotebookEditorLayoutConfigure ,
2069
+ id : MenuId . NotebookToolbar ,
2070
2070
group : 'notebookLayout' ,
2071
- when : NOTEBOOK_IS_ACTIVE_EDITOR ,
2071
+ when : ContextKeyExpr . equals ( 'config.notebook.globalToolbar' , true ) ,
2072
2072
order : 1
2073
- } ,
2073
+ }
2074
+ ]
2075
+ } ) ;
2076
+ }
2077
+ run ( accessor : ServicesAccessor ) : void {
2078
+ accessor . get ( IPreferencesService ) . openSettings ( { jsonEditor : false , query : '@tag:notebookLayout' } ) ;
2079
+ }
2080
+ } ) ;
2081
+
2082
+ registerAction2 ( class NotebookConfigureLayoutFromEditorTitle extends Action2 {
2083
+ constructor ( ) {
2084
+ super ( {
2085
+ id : 'workbench.notebook.layout.configure.editorTitle' ,
2086
+ title : localize ( 'workbench.notebook.layout.configure.label' , "Customize Notebook Layout" ) ,
2087
+ f1 : true ,
2088
+ category : NOTEBOOK_ACTIONS_CATEGORY ,
2089
+ menu : [
2074
2090
{
2075
- id : MenuId . NotebookToolbar ,
2091
+ id : MenuId . NotebookEditorLayoutConfigure ,
2076
2092
group : 'notebookLayout' ,
2077
- when : ContextKeyExpr . equals ( 'config.notebook.globalToolbar' , true ) ,
2093
+ when : NOTEBOOK_IS_ACTIVE_EDITOR ,
2078
2094
order : 1
2079
2095
}
2080
2096
]
@@ -2095,13 +2111,70 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
2095
2111
when : NOTEBOOK_IS_ACTIVE_EDITOR
2096
2112
} ) ;
2097
2113
2098
- MenuRegistry . appendMenuItem ( MenuId . NotebookEditorLayoutConfigure , {
2099
- command : {
2100
- id : 'breadcrumbs.toggle' ,
2101
- title : { value : localize ( 'cmd.toggle' , "Toggle Breadcrumbs" ) , original : 'Toggle Breadcrumbs' } ,
2102
- } ,
2103
- group : 'notebookLayoutDetails' ,
2104
- order : 2
2114
+ registerAction2 ( class ToggleLineNumberFromEditorTitle extends Action2 {
2115
+ constructor ( ) {
2116
+ super ( {
2117
+ id : 'notebook.toggleLineNumbersFromEditorTitle' ,
2118
+ title : { value : localize ( 'notebook.toggleLineNumbers' , "Toggle Notebook Line Numbers" ) , original : 'Toggle Notebook Line Numbers' } ,
2119
+ precondition : NOTEBOOK_EDITOR_FOCUSED ,
2120
+ menu : [
2121
+ {
2122
+ id : MenuId . NotebookEditorLayoutConfigure ,
2123
+ group : 'notebookLayoutDetails' ,
2124
+ order : 1 ,
2125
+ when : NOTEBOOK_IS_ACTIVE_EDITOR
2126
+ } ] ,
2127
+ category : NOTEBOOK_ACTIONS_CATEGORY ,
2128
+ f1 : true ,
2129
+ toggled : {
2130
+ condition : ContextKeyExpr . notEquals ( 'config.notebook.lineNumbers' , 'off' ) ,
2131
+ title : { value : localize ( 'notebook.showLineNumbers' , "Show Notebook Line Numbers" ) , original : 'Show Notebook Line Numbers' } ,
2132
+ }
2133
+ } ) ;
2134
+ }
2135
+
2136
+ async run ( accessor : ServicesAccessor ) : Promise < void > {
2137
+ return accessor . get ( ICommandService ) . executeCommand ( 'notebook.toggleLineNumbers' ) ;
2138
+ }
2139
+ } ) ;
2140
+
2141
+ registerAction2 ( class ToggleCellToolbarPositionFromEditorTitle extends Action2 {
2142
+ constructor ( ) {
2143
+ super ( {
2144
+ id : 'notebook.toggleCellToolbarPositionFromEditorTitle' ,
2145
+ title : { value : localize ( 'notebook.toggleCellToolbarPosition' , "Toggle Cell Toolbar Position" ) , original : 'Toggle Cell Toolbar Position' } ,
2146
+ menu : [ {
2147
+ id : MenuId . NotebookEditorLayoutConfigure ,
2148
+ group : 'notebookLayoutDetails' ,
2149
+ order : 3
2150
+ } ] ,
2151
+ category : NOTEBOOK_ACTIONS_CATEGORY ,
2152
+ f1 : false
2153
+ } ) ;
2154
+ }
2155
+
2156
+ async run ( accessor : ServicesAccessor , ...args : any [ ] ) : Promise < void > {
2157
+ return accessor . get ( ICommandService ) . executeCommand ( 'notebook.toggleCellToolbarPosition' , ...args ) ;
2158
+ }
2159
+ } ) ;
2160
+
2161
+ registerAction2 ( class ToggleBreadcrumbFromEditorTitle extends Action2 {
2162
+ constructor ( ) {
2163
+ super ( {
2164
+ id : 'breadcrumbs.toggleFromEditorTitle' ,
2165
+ title : { value : localize ( 'notebook.toggleBreadcrumb' , "Toggle Breadcrumbs" ) , original : 'Toggle Breadcrumbs' } ,
2166
+ menu : [ {
2167
+ id : MenuId . NotebookEditorLayoutConfigure ,
2168
+ group : 'notebookLayoutDetails' ,
2169
+ order : 2
2170
+ } ] ,
2171
+ f1 : false
2172
+ } ) ;
2173
+ }
2174
+
2175
+ async run ( accessor : ServicesAccessor ) : Promise < void > {
2176
+ return accessor . get ( ICommandService ) . executeCommand ( 'breadcrumbs.toggle' ) ;
2177
+ }
2105
2178
} ) ;
2106
2179
2107
2180
MenuRegistry . appendMenuItem ( MenuId . NotebookToolbar , {
0 commit comments