Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable maximized gl components #3876

Merged
merged 20 commits into from
Mar 20, 2019
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
df32dbe
sorting mappings
MichaelBuessemeyer Mar 5, 2019
86fea0c
Update CHANGELOG.md
MichaelBuessemeyer Mar 5, 2019
94c1c20
changed to slice function to create the copy of the array
MichaelBuessemeyer Mar 6, 2019
97003d9
Merge branch 'sort-select-mappings-ui' of github.com:scalableminds/we…
MichaelBuessemeyer Mar 6, 2019
6d8b666
enabled maximized gl components and fixed rendering but not overlapping
MichaelBuessemeyer Mar 7, 2019
848ee7a
not displaying underlying items anymore when maximized
MichaelBuessemeyer Mar 8, 2019
a11553f
not useing force update to rerender anymore
MichaelBuessemeyer Mar 8, 2019
6052525
Merge branch 'master' of github.com:scalableminds/webknossos into ena…
MichaelBuessemeyer Mar 8, 2019
53787e1
removed useless stuff in rendering method
MichaelBuessemeyer Mar 8, 2019
5a3a6fb
Merge branch 'master' into enable-maximized-gl-components
MichaelBuessemeyer Mar 11, 2019
5c23ba3
better comments and corrected spelling
MichaelBuessemeyer Mar 12, 2019
a9c614a
moved css class definition to gl overwrite less file
MichaelBuessemeyer Mar 12, 2019
a5a3694
fixed bug that caused permanent update of gl
MichaelBuessemeyer Mar 12, 2019
d248a86
fixed and added comments
MichaelBuessemeyer Mar 13, 2019
59eb82b
applied pr feedback
MichaelBuessemeyer Mar 13, 2019
2bfeb61
Merge branch 'master' of github.com:scalableminds/webknossos into ena…
MichaelBuessemeyer Mar 13, 2019
5a43afd
Merge branch 'master' into enable-maximized-gl-components
MichaelBuessemeyer Mar 13, 2019
3562df1
Merge branch 'master' of github.com:scalableminds/webknossos into ena…
philippotto Mar 20, 2019
497ad53
update changelog
philippotto Mar 20, 2019
c66ab90
Merge branch 'master' into enable-maximized-gl-components
philippotto Mar 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const show3DViewportInArbitrary = false;
const LayoutSettings = {
showPopoutIcon: false,
showCloseIcon: false,
showMaximiseIcon: false,
showMaximiseIcon: true,
};

// While the first parameter to `Pane` is the title of the pane, the second one is an id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const updateSizeForGl = gl => {
export class GoldenLayoutAdapter extends React.PureComponent<Props<*>, *> {
gl: GoldenLayout;
unbindListeners: Array<() => void>;
maximizedItem: null;

componentDidMount() {
this.setupLayout();
Expand Down Expand Up @@ -102,6 +103,32 @@ export class GoldenLayoutAdapter extends React.PureComponent<Props<*>, *> {
const { onLayoutChange } = this.props;
if (onLayoutChange != null && this.gl.isInitialised) {
onLayoutChange(this.gl.toConfig(), this.props.activeLayoutName);
// Only when the maximized item changed, adjust css classes to not show hidden gl items.
if (this.maximizedItem !== !this.gl._maximisedItem) {
// Gl needs a forced update when returning from maximized viewing
// mode to render stacked components correctly.
const needsUpdatedSize = this.gl._maximisedItem === null && this.maximizedItem != null;
this.maximizedItem = this.gl._maximisedItem;
const allGlHeaderElemets = document.getElementsByClassName("lm_item");
for (const element of allGlHeaderElemets) {
if (this.maximizedItem) {
// Show only the maximized item and do not hide the gl root component.
if (
!element.classList.contains("lm_maximised") &&
!element.classList.contains("lm_root")
) {
element.classList.add("hidden-gl-item");
}
} else {
// If there is no maximized component, remove the css class to show everything as usual.
element.classList.remove("hidden-gl-item");
}
}
// Force gl to update again when returning from maximized viewing mode.
if (needsUpdatedSize) {
updateSizeForGl(this.gl);
}
}
}
}

Expand Down
10 changes: 10 additions & 0 deletions frontend/stylesheets/goldenlayout_overwrites.less
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,13 @@
border-bottom: 1px solid #1890ff;
}
}

// Used to hide the header and content of a gl item when another component is maximized.
.hidden-gl-item {
MichaelBuessemeyer marked this conversation as resolved.
Show resolved Hide resolved
.lm_header {
display: none;
}
.lm_items .lm_item_container .lm_content {
display: none;
}
}