Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf44ac97

Browse files
afshingithub-actions[bot]jtpio
authored
Clean up interface switcher plugin in preparation for release (jupyter#6766)
* Clean up interface switcher plugin in preparation for release* Use caret down icon to be consistent with the "New" dropdown in the tree page* Update Playwright Snapshots* Update Playwright Snapshots* Fix button height of interface switcher* Update packages/lab-extension/style/base.cssCo-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com>* Update Playwright Snapshots* Update Playwright Snapshots---------Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>Co-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com>
1 parent072a5d6 commitf44ac97

File tree

8 files changed

+13
-11
lines changed

8 files changed

+13
-11
lines changed

‎packages/lab-extension/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"@jupyterlab/docregistry":"^4.0.0-alpha.20",
5151
"@jupyterlab/notebook":"^4.0.0-alpha.20",
5252
"@jupyterlab/translation":"^4.0.0-alpha.20",
53+
"@jupyterlab/ui-components":"^4.0.0-alpha.35",
5354
"@lumino/commands":"^2.0.0-rc.1",
5455
"@lumino/disposable":"^2.0.0-rc.1"
5556
},

‎packages/lab-extension/src/index.ts‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import { Menu, MenuBar } from '@lumino/widgets';
1919

2020
import{INotebookShell}from'@jupyter-notebook/application';
2121

22+
import{caretDownIcon}from'@jupyterlab/ui-components';
23+
2224
/**
2325
* The command IDs used by the application plugin.
2426
*/
@@ -49,12 +51,11 @@ interface ISwitcherChoice {
4951
/**
5052
* A plugin to add custom toolbar items to the notebook page
5153
*/
52-
constlaunchButtons:JupyterFrontEndPlugin<void>={
54+
constinterfaceSwitcher:JupyterFrontEndPlugin<void>={
5355
id:'@jupyter-notebook/lab-extension:interface-switcher',
5456
autoStart:true,
55-
requires:[ITranslator],
57+
requires:[ITranslator,INotebookTracker],
5658
optional:[
57-
INotebookTracker,
5859
ICommandPalette,
5960
INotebookShell,
6061
ILabShell,
@@ -63,17 +64,12 @@ const launchButtons: JupyterFrontEndPlugin<void> = {
6364
activate:(
6465
app:JupyterFrontEnd,
6566
translator:ITranslator,
66-
notebookTracker:INotebookTracker|null,
67+
notebookTracker:INotebookTracker,
6768
palette:ICommandPalette|null,
6869
notebookShell:INotebookShell|null,
6970
labShell:ILabShell|null,
7071
toolbarRegistry:IToolbarWidgetRegistry|null
7172
)=>{
72-
if(!notebookTracker){
73-
// to prevent showing the toolbar button in non-notebook pages
74-
return;
75-
}
76-
7773
const{ commands, shell}=app;
7874
constbaseUrl=PageConfig.getBaseUrl();
7975
consttrans=translator.load('notebook');
@@ -83,6 +79,7 @@ const launchButtons: JupyterFrontEndPlugin<void> = {
8379
constmenubar=newMenuBar(overflowOptions);
8480
constswitcher=newMenu({ commands});
8581
switcher.title.label=trans.__('Interface');
82+
switcher.title.icon=caretDownIcon;
8683
menubar.addMenu(switcher);
8784

8885
constisEnabled=()=>{
@@ -182,7 +179,7 @@ const launchNotebookTree: JupyterFrontEndPlugin<void> = {
182179
*/
183180
constplugins:JupyterFrontEndPlugin<any>[]=[
184181
launchNotebookTree,
185-
launchButtons
182+
interfaceSwitcher
186183
];
187184

188185
exportdefaultplugins;

‎packages/lab-extension/style/base.css‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99
align-items: center;
1010
justify-content: center;
1111
}
12+
13+
.jp-InterfaceSwitcher .lm-MenuBar-itemIconsvg {
14+
vertical-align: sub;
15+
}

‎packages/tree-extension/style/base.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414

1515
.jp-FileBrowser-toolbarbutton.jp-ToolbarButtonComponent {
16-
height:100%;
16+
height:var(--jp-flat-button-height);
1717
}
1818

1919
.jp-FileBrowser-filterBox {
-80 Bytes
Loading
24 Bytes
Loading
19 Bytes
Loading
27 Bytes
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp