Skip to content

Commit

Permalink
UI improvements (#2357)
Browse files Browse the repository at this point in the history
* higher contrast for colorbars
* Cancel newOrg
* Create warning next to "disable confirmations for disabling study deletion"
* Fixed NodeViewer for guests
  • Loading branch information
odeimaiz authored Jun 1, 2021
1 parent 9254ae5 commit 306cd88
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,39 @@ qx.Class.define("osparc.desktop.preferences.pages.ConfirmationsPage", {
const cbConfirmDeleteStudy = new qx.ui.form.CheckBox(this.tr("Delete a Study"));
preferencesSettings.bind("confirmDeleteStudy", cbConfirmDeleteStudy, "value");
cbConfirmDeleteStudy.bind("value", preferencesSettings, "confirmDeleteStudy");
cbConfirmDeleteStudy.addListener("changeValue", e => {
if (!e.getData()) {
const msg = this.tr("Warning: deleting a study cannot be undone");
const win = new osparc.ui.window.Confirmation(msg);
win.getConfirmButton().setLabel(this.tr("OK"));
win.center();
win.open();
win.addListener("close", () => {
if (!win.getConfirmed()) {
cbConfirmDeleteStudy.setValue(true);
}
}, this);
}
}, this);
box.add(cbConfirmDeleteStudy);

const cbConfirmDeleteNode = new qx.ui.form.CheckBox(this.tr("Delete a Node"));
preferencesSettings.bind("confirmDeleteNode", cbConfirmDeleteNode, "value");
cbConfirmDeleteNode.bind("value", preferencesSettings, "confirmDeleteNode");
cbConfirmDeleteNode.addListener("changeValue", e => {
if (!e.getData()) {
const msg = this.tr("Warning: deleting a node cannot be undone");
const win = new osparc.ui.window.Confirmation(msg);
win.getConfirmButton().setLabel(this.tr("OK"));
win.center();
win.open();
win.addListener("close", () => {
if (!win.getConfirmed()) {
cbConfirmDeleteNode.setValue(true);
}
}, this);
}
}, this);
box.add(cbConfirmDeleteNode);

const cbConfirmWindowSize = new qx.ui.form.CheckBox(this.tr("Window size check"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ qx.Class.define("osparc.desktop.preferences.pages.OrganizationsPage", {
orgEditor.addListener("createOrg", () => {
this.__createOrganization(win, orgEditor.getChildControl("create"), orgEditor);
});
orgEditor.addListener("cancel", () => win.close());
}, this);
return createOrgBtn;
},
Expand Down Expand Up @@ -279,6 +280,7 @@ qx.Class.define("osparc.desktop.preferences.pages.OrganizationsPage", {
orgEditor.addListener("updateOrg", () => {
this.__updateOrganization(win, orgEditor.getChildControl("save"), orgEditor);
});
orgEditor.addListener("cancel", () => win.close());
},

__deleteOrganization: function(orgKey) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ qx.Class.define("osparc.desktop.preferences.window.APIKeyBase", {
modal: true,
showMaximize: false,
showMinimize: false,
contentPadding: 0,
width: 350,
clickAwayClose: true
});
Expand All @@ -38,7 +39,8 @@ qx.Class.define("osparc.desktop.preferences.window.APIKeyBase", {
members: {
__addInfoText: function(infoText) {
const introLabel = new qx.ui.basic.Label(infoText).set({
padding: 5,
paddingLeft: 5,
paddingRight: 5,
rich: true
});
this._add(introLabel);
Expand Down
5 changes: 3 additions & 2 deletions services/web/client/source/class/osparc/theme/ColorDark.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ qx.Theme.define("osparc.theme.ColorDark", {
"loading-page-text": "#FFFFFF",
"loading-page-spinner": "#DDDDDD",

"scrollbar-passive": "contrasted-background",
"scrollbar-active": "contrasted-background+"
"contrasted-background++": "#666",
"scrollbar-passive": "contrasted-background+",
"scrollbar-active": "contrasted-background++"
}
});
29 changes: 22 additions & 7 deletions services/web/client/source/class/osparc/ui/window/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,24 @@ qx.Class.define("osparc.ui.window.Dialog", {

members: {
__messageLabel: null,
__btnToolbar: null,

_createChildControlImpl: function(id) {
let control;
switch (id) {
case "buttons-toolbar":
control = new qx.ui.toolbar.ToolBar();
control.addSpacer();
this.add(control);
break;
case "cancel-button": {
const btnToolbar = this.getChildControl("buttons-toolbar");
control = new qx.ui.toolbar.Button(this.tr("Cancel"));
btnToolbar.add(control);
break;
}
}
return control || this.base(arguments, id);
},

__buildLayout: function() {
this.__messageLabel = new qx.ui.basic.Label().set({
Expand All @@ -55,9 +72,7 @@ qx.Class.define("osparc.ui.window.Dialog", {
this.add(this.__messageLabel, {
flex: 1
});
this.__btnToolbar = new qx.ui.toolbar.ToolBar();
this.__btnToolbar.addSpacer();
this.add(this.__btnToolbar);
this.getChildControl("buttons-toolbar");
},

_applyMessage: function(message) {
Expand All @@ -69,16 +84,16 @@ qx.Class.define("osparc.ui.window.Dialog", {
* @param {qx.ui.toolbar.Button} button Button that will be added to the bottom bar of the dialog.
*/
addButton: function(button) {
this.__btnToolbar.add(button);
const btnToolbar = this.getChildControl("buttons-toolbar");
btnToolbar.add(button);
},

/**
* Adds a default cancel button to the dialog.
*/
addCancelButton: function() {
const cancelButton = new qx.ui.toolbar.Button(this.tr("Cancel"));
const cancelButton = this.getChildControl("cancel-button");
cancelButton.addListener("execute", () => this.close(), this);
this.addButton(cancelButton);
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ qx.Class.define("osparc.viewer.NodeViewer", {
this.__initLoadingPage();

const iframe = new osparc.component.widget.PersistentIframe().set({
showActionButton: false,
showRestartButton: false
});
this.setIFrame(iframe);
Expand Down

0 comments on commit 306cd88

Please sign in to comment.