Skip to content

Commit cd6c172

Browse files
committed
maximize to loading
1 parent 24cb70c commit cd6c172

File tree

1 file changed

+50
-9
lines changed
  • services/static-webserver/client/source/class/osparc/ui/message

1 file changed

+50
-9
lines changed

services/static-webserver/client/source/class/osparc/ui/message/Loading.js

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* The loading page
2020
*
2121
* -----------------------
22+
* | [] |
2223
* | |
2324
* | oSparc/service logo |
2425
* | spinner + header |
@@ -38,9 +39,10 @@ qx.Class.define("osparc.ui.message.Loading", {
3839
layout.setRowFlex(this.self().GRID_POS.SPACER_TOP, 1);
3940
layout.setRowFlex(this.self().GRID_POS.SPACER_BOTTOM, 1);
4041
layout.setColumnFlex(0, 1);
41-
layout.setColumnFlex(2, 1);
4242
layout.setColumnMaxWidth(1, 400);
4343
layout.setColumnAlign(1, "center", "middle");
44+
layout.setColumnFlex(2, 1);
45+
layout.setColumnAlign(2, "right", "middle");
4446
this._setLayout(layout);
4547

4648
this.__buildLayout();
@@ -67,19 +69,25 @@ qx.Class.define("osparc.ui.message.Loading", {
6769
},
6870
},
6971

72+
events: {
73+
"restore" : "qx.event.type.Event",
74+
"maximize" : "qx.event.type.Event",
75+
},
76+
7077
statics: {
7178
ICON_WIDTH: 190,
7279
LOGO_HEIGHT: 100,
7380
ICON_HEIGHT: 220,
7481
STATUS_ICON_SIZE: 20,
7582

7683
GRID_POS: {
77-
SPACER_TOP: 0,
78-
LOGO: 1,
79-
WAITING: 2,
80-
MESSAGES: 3,
81-
EXTRA_WIDGETS: 4,
82-
SPACER_BOTTOM: 5,
84+
TOOLBAR: 0,
85+
SPACER_TOP: 1,
86+
LOGO: 2,
87+
WAITING: 3,
88+
MESSAGES: 4,
89+
EXTRA_WIDGETS: 5,
90+
SPACER_BOTTOM: 6,
8391
}
8492
},
8593

@@ -95,9 +103,11 @@ qx.Class.define("osparc.ui.message.Loading", {
95103
column: 0,
96104
row: 0
97105
});
98-
this._add(new qx.ui.core.Spacer(), {
106+
107+
const maxLayout = this.__createMaximizeToolbar();
108+
this._add(maxLayout, {
99109
column: 2,
100-
row: 0
110+
row: this.self().GRID_POS.TOOLBAR
101111
});
102112

103113
this._add(new qx.ui.core.Spacer(), {
@@ -170,6 +180,37 @@ qx.Class.define("osparc.ui.message.Loading", {
170180
});
171181
},
172182

183+
maximizeIFrame: function(maximize) {
184+
if (maximize) {
185+
this.fireEvent("maximize");
186+
this.addState("maximized");
187+
} else {
188+
this.fireEvent("restore");
189+
this.removeState("maximized");
190+
}
191+
const maxButton = this.__maxButton;
192+
maxButton.set({
193+
label: osparc.widget.PersistentIframe.getZoomLabel(maximize),
194+
icon: osparc.widget.PersistentIframe.getZoomIcon(maximize)
195+
});
196+
osparc.utils.Utils.setIdToWidget(maxButton, osparc.widget.PersistentIframe.getMaximizeWidgetId(maximize));
197+
qx.event.message.Bus.getInstance().dispatchByName("maximizeIframe", this.hasState("maximized"));
198+
},
199+
200+
__createMaximizeToolbar: function() {
201+
const maximize = false;
202+
const maxButton = this.__maxButton = osparc.widget.PersistentIframe.createToolbarButton(maximize).set({
203+
label: osparc.widget.PersistentIframe.getZoomLabel(maximize),
204+
icon: osparc.widget.PersistentIframe.getZoomIcon(maximize),
205+
});
206+
osparc.utils.Utils.setIdToWidget(maxButton, osparc.widget.PersistentIframe.getMaximizeWidgetId(maximize));
207+
maxButton.addListener("execute", () => this.maximizeIFrame(!this.hasState("maximized")), this);
208+
209+
const maximizeLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox());
210+
maximizeLayout.add(maxButton);
211+
return maximizeLayout;
212+
},
213+
173214
__applyLogo: function(newLogo) {
174215
const productLogoPath = osparc.product.Utils.getLogoPath();
175216
if (newLogo !== productLogoPath) {

0 commit comments

Comments
 (0)