Skip to content
Snippets Groups Projects
Commit 1b0f0ba2 authored by Xiao Gui's avatar Xiao Gui Committed by xgui3783
Browse files

feat: allow for mass dock/undock of widget windows

parent 884b5936
No related branches found
No related tags found
No related merge requests found
......@@ -122,7 +122,17 @@ div[contextualBlock]
color:rgba(245,245,245,0.8);
}
span.tabContainer > *
.pointer-events
{
pointer-events: all;
}
.no-pointer-events
{
pointer-events: none;
}
span.tabContainer > *:not(.pointer-events)
{
pointer-events: none;
}
......@@ -195,6 +205,7 @@ span.tabContainer.active-tab:before
top:0;
width:100%;
height:100%;
pointer-events: none;
}
:host-context([darktheme="true"]) span.tabContainer.active-tab:before
......
......@@ -97,11 +97,29 @@
<span
placement = "left"
tooltip = "Tools Browser"
(mouseover) = "_toolIconsVisible = true"
(mouseout) = "_toolIconsVisible = false"
[tooltip] = "_toolIconDockAll ? 'dock all widgets' : _toolIconFloatAll ? 'float all widgets' : 'Tools Browser'"
[ngClass] = "{'active-tab' : (sidePanelView$ | async) === 'toolsBrowser'}"
(click) = "toggleSidePanel('toolsBrowser')"
class = "tabContainer">
<i class="glyphicon glyphicon-wrench"></i>
<span class ="badge">
<span [class.hidden] = "_toolIconsVisible" >
...
</span>
<span [class.hidden] = "!_toolIconsVisible">
<span class = "pointer-events" (click) = "$event.stopPropagation();this.widgetServices.dockAllWidgets()" (mouseover) = "_toolIconDockAll = true" (mouseout) = "_toolIconDockAll = false">
<i class = "no-pointer-events glyphicon glyphicon-log-in"></i>
</span>
<span class = "mute-text">
|
</span>
<span class = "pointer-events" (click) = "$event.stopPropagation();this.widgetServices.floatAllWidgets()" (mouseover) = "_toolIconFloatAll = true" (mouseout) = "_toolIconFloatAll = false">
<i class = "no-pointer-events glyphicon glyphicon-new-window"></i>
</span>
</span>
</span>
</span>
</div>
</layout-mainside>
......
......@@ -128,6 +128,15 @@ export class WidgetServices{
console.warn('widgetref not found')
}
}
dockAllWidgets(){
/* nb cannot directly iterate the set, as the set will be updated and create and infinite loop */
[...this.widgetComponentRefs].forEach(cr => cr.instance.dock())
}
floatAllWidgets(){
[...this.widgetComponentRefs].forEach(cr => cr.instance.undock())
}
}
function safeGetSingle(obj:any, arg:string){
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment