Skip to content

Commit a11489f

Browse files
hriday-panchasarabhufmann
authored andcommitted
Improve options menu styling
Change CSS style of options-menu so that we can re-use theia styles for it fixes #751
1 parent f936a11 commit a11489f

File tree

4 files changed

+28
-61
lines changed

4 files changed

+28
-61
lines changed

packages/react-components/src/components/abstract-output-component.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,12 @@ export abstract class AbstractOutputComponent<P extends AbstractOutputProps, S e
161161
protected showOptions(): React.ReactNode {
162162
return <React.Fragment>
163163
<ul>
164-
{this.props.pinned === undefined && <li className='drop-down-list-item' onClick={() => this.pinView()}>Pin View</li>}
165-
{this.props.pinned === true && <li className='drop-down-list-item' onClick={() => this.unPinView()}>Unpin View</li>}
164+
{this.props.pinned === undefined && <li className='drop-down-list-item' onClick={() => this.pinView()}>
165+
<div className='drop-down-list-item-text'>Pin View</div>
166+
</li>}
167+
{this.props.pinned === true && <li className='drop-down-list-item' onClick={() => this.unPinView()}>
168+
<div className='drop-down-list-item-text'>Unpin View</div>
169+
</li>}
166170
</ul>
167171
{this.state.additionalOptions && this.showAdditionalOptions()}
168172
</React.Fragment>;

packages/react-components/src/components/datatree-output-component.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ export class DataTreeOutputComponent extends AbstractOutputComponent<AbstractOut
233233
protected showAdditionalOptions(): React.ReactNode {
234234
return <React.Fragment>
235235
<ul>
236-
<li className='drop-down-list-item' key={0} onClick={() => this.exportOutput()}>Export to csv</li>
236+
<li className='drop-down-list-item' key={0} onClick={() => this.exportOutput()}>
237+
<div className='drop-down-list-item-text'>Export to csv</div>
238+
</li>
237239
</ul>
238240
</React.Fragment>;
239241
}

packages/react-components/src/components/table-output-component.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,9 @@ export class TableOutputComponent extends AbstractOutputComponent<TableOutputPro
783783
<ul>
784784
<li className='drop-down-list-item' onClick={() => {
785785
this.setState({showToggleColumns: !this.state.showToggleColumns});
786-
}}>Toggle Columns</li>
786+
}}>
787+
<div className='drop-down-list-item-text'>Toggle Columns</div>
788+
</li>
787789
</ul>
788790
{this.state.showToggleColumns && <div className='toggle-columns-table'>{this.renderToggleColumnsTable()}</div>}
789791
</React.Fragment>;

packages/react-components/style/output-components-style.css

+16-57
Original file line numberDiff line numberDiff line change
@@ -41,55 +41,6 @@
4141
.title-bar-label:hover {
4242
background-color: var(--theia-list-hoverBackground);
4343
}
44-
.remove-component-button:hover {
45-
cursor: pointer;
46-
background-color: var(--theia-list-hoverBackground);
47-
}
48-
.share-component-container {
49-
align-self: start;
50-
justify-self: center;
51-
position: relative;
52-
display: inline-block;
53-
}
54-
.share-component-button {
55-
background: none;
56-
border: none;
57-
color: var(--theia-ui-font-color0)
58-
}
59-
.share-component-button:hover {
60-
cursor: pointer;
61-
background-color: var(--theia-list-hoverBackground);
62-
}
63-
.share-component-drop-down {
64-
position: absolute;
65-
top: 100%;
66-
left: 50%;
67-
padding: 0;
68-
z-index: 2;
69-
min-width: 180px;
70-
background: var(--theia-menu-background);
71-
color: var(--theia-menu-foreground);
72-
font-size: var(--theia-ui-font-size1);
73-
box-shadow: 0px 1px 6px var(--theia-widget-shadow);
74-
border: 1px solid var(--theia-menu-border);
75-
}
76-
.share-component-drop-down > ul {
77-
list-style-type: none;
78-
margin: 0;
79-
padding: 0;
80-
display: table;
81-
width: 100%;
82-
}
83-
.drop-down-list-item {
84-
padding: 8px 12px;
85-
background-color: var(--theia-menu-background);
86-
color: var(--theia-menu-foreground);
87-
}
88-
.drop-down-list-item:hover {
89-
background: var(--theia-menu-selectionBackground);
90-
color: var(--theia-menu-selectionForeground);
91-
opacity: 1;
92-
}
9344
.remove-component-button {
9445
background: none;
9546
border: none;
@@ -353,14 +304,16 @@ canvas {
353304
position: absolute;
354305
top: 0%;
355306
left: 100%;
356-
padding: 0;
307+
padding: 4px 0px;
357308
z-index: 2;
358-
min-width: 180px;
309+
min-width: 170px;
359310
background: var(--theia-menu-background);
360311
color: var(--theia-menu-foreground);
361312
font-size: var(--theia-ui-font-size1);
362-
box-shadow: 0px 1px 6px var(--theia-widget-shadow);
313+
box-shadow: 0px 0px 12px var(--theia-widget-shadow);
363314
border: 1px solid var(--theia-menu-border);
315+
outline: none;
316+
user-select: none;
364317
}
365318
.options-menu-drop-down > ul {
366319
list-style-type: none;
@@ -370,24 +323,30 @@ canvas {
370323
width: 100%;
371324
}
372325
.drop-down-list-item {
373-
padding: 8px 12px;
374-
background-color: var(--theia-menu-background);
375-
color: var(--theia-menu-foreground);
326+
min-height: var(--theia-private-menu-item-height);
327+
max-height: var(--theia-private-menu-item-height);
328+
padding: 0px;
329+
line-height: var(--theia-private-menu-item-height);
330+
display: table-row;
376331
}
377332
.drop-down-list-item:hover {
378333
background: var(--theia-menu-selectionBackground);
379334
color: var(--theia-menu-selectionForeground);
335+
border: thin solid var(--theia-menu-selectionBorder);
380336
opacity: 1;
381337
}
338+
.drop-down-list-item-text {
339+
padding-left: 18%;
340+
}
382341
.toggle-columns-table {
383342
height: 150px;
384343
overflow: scroll;
385344
z-index: 999 !important;
386345
background: var(--theia-menu-background);
387346
color: var(--theia-menu-foreground);
388347
font-size: var(--theia-ui-font-size1);
389-
box-shadow: 0px 1px 6px var(--theia-widget-shadow);
390-
border: 1px solid var(--theia-tree-inactiveIndentGuidesStroke);
348+
box-shadow: 0px 0px 15px var(--theia-widget-shadow);
349+
border: 1px solid var(--theia-menu-border);
391350
}
392351

393352
.react-grid-item:hover {

0 commit comments

Comments
 (0)