Tomas Jelinek has uploaded a new change for review. Change subject: frontend: change widget stylings ......................................................................
frontend: change widget stylings Change-Id: I4f73b9202462770e4426845c3c6360d5ed16a10e Signed-off-by: Tomas Jelinek <[email protected]> --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.ui.xml M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/BaseEntityModelCheckboxEditor.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml 5 files changed, 68 insertions(+), 45 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/93/18693/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.java index 12b1e2b..c24ce1e 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.java @@ -1,6 +1,11 @@ package org.ovirt.engine.ui.common.widget; +import com.google.gwt.dom.client.Style.Display; +import com.google.gwt.safehtml.shared.SafeHtml; +import com.google.gwt.safehtml.shared.SafeHtmlUtils; +import org.ovirt.engine.ui.common.CommonApplicationResources; import org.ovirt.engine.ui.common.idhandler.HasElementId; +import org.ovirt.engine.ui.common.widget.dialog.InfoIcon; import org.ovirt.engine.ui.common.widget.editor.EditorWidget; import com.google.gwt.core.client.GWT; @@ -52,8 +57,13 @@ @UiField SimplePanel contentWidgetContainer; + @UiField(provided = true) + InfoIcon infoIcon; + @UiField Style style; + + private static final CommonApplicationResources resources = GWT.create(CommonApplicationResources.class); /** * By default the title gets erased, when the setEnabled is called @@ -67,6 +77,9 @@ public AbstractValidatedWidgetWithLabel(W contentWidget, VisibilityRenderer renderer) { this.contentWidget = contentWidget; this.renderer = renderer; + + infoIcon = new InfoIcon(SafeHtmlUtils.EMPTY_SAFE_HTML, resources); + initWidget(WidgetUiBinder.uiBinder.createAndBindUi(this)); } @@ -236,4 +249,9 @@ public void setKeepTitleOnSetEnabled(boolean keepTitleOnSetEnabled) { this.keepTitleOnSetEnabled = keepTitleOnSetEnabled; } + + public void showInfoIcon(SafeHtml text) { + infoIcon.getElement().getStyle().setDisplay(Display.INLINE); + infoIcon.setText(text); + } } diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.ui.xml b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.ui.xml index 72718ea..4d6203e 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.ui.xml +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.ui.xml @@ -1,11 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> -<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui"> +<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" + xmlns:g="urn:import:com.google.gwt.user.client.ui" + xmlns:d="urn:import:org.ovirt.engine.ui.common.widget.dialog"> <ui:style type="org.ovirt.engine.ui.common.widget.AbstractValidatedWidgetWithLabel.Style"> .wrapper { line-height: 30px; text-align: left; + display: table; + width: 100%; } .label { @@ -28,15 +32,26 @@ } .contentWidget { - float: right; + /*float: right;*/ width: 230px; padding: 0 5px; line-height: 30px; + display: table-cell; } + + .infoIconStyle { + float: right; + margin-top: 3px; + display: none; + } + </ui:style> <g:HTMLPanel ui:field="wrapperPanel" addStyleNames="{style.wrapper}"> - <label ui:field="labelElement" class="{style.label} {style.labelEnabled}" /> + <div style="display: table-cell;"> + <label ui:field="labelElement" class="{style.label} {style.labelEnabled}" /> + <d:InfoIcon ui:field="infoIcon" addStyleNames="{style.infoIconStyle}" /> + </div> <g:SimplePanel ui:field="contentWidgetContainer" addStyleNames="{style.contentWidget}" /> <div style="clear: both;" /> </g:HTMLPanel> diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/BaseEntityModelCheckboxEditor.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/BaseEntityModelCheckboxEditor.java index 21a8340..1b32110 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/BaseEntityModelCheckboxEditor.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/BaseEntityModelCheckboxEditor.java @@ -41,7 +41,10 @@ // align content widget container to the left and hide the LabelElement if (useCheckBoxWidgetLabel) { getContentWidgetContainer().getElement().getStyle().setFloat(Float.LEFT); + // as it can use the whole window no need to have the size explicitly set + getContentWidgetContainer().getElement().getStyle().setWidth(100, Unit.PCT); getLabelElement().getStyle().setDisplay(Display.NONE); + } } diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java index 54b2c04..98af512 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java @@ -419,12 +419,9 @@ public EntityModelRadioButtonEditor isAutoAssignEditor; @UiField(provided = true) - InfoIcon cpuPinningInfo; - - @UiField(provided = true) @Path(value = "cpuPinning.entity") @WithElementId("cpuPinning") - public EntityModelTextBoxOnlyEditor cpuPinning; + public EntityModelTextBoxEditor cpuPinning; @UiField(provided = true) @Path(value = "cpuSharesAmountSelection.selectedItem") @@ -613,11 +610,6 @@ copyTemplatePermissionsEditor = new EntityModelCheckBoxEditor(Align.RIGHT, new ModeSwitchingVisibilityRenderer()); isMemoryBalloonDeviceEnabled = new EntityModelCheckBoxEditor(Align.RIGHT); isSingleQxlEnabledEditor = new EntityModelCheckBoxEditor(Align.RIGHT, new ModeSwitchingVisibilityRenderer()); - cpuPinningInfo = - new InfoIcon(SafeHtmlUtils.fromTrustedString(applicationTemplates.italicFixedWidth("400px",//$NON-NLS-1$ - constants.cpuPinningLabelExplanation()) - .asString() - .replaceAll("(\r\n|\n)", "<br />")), resources);//$NON-NLS-1$ //$NON-NLS-2$ priorityEditor = new EntityModelCellTable<ListModel>( (Resources) GWT.create(ButtonCellTableResources.class)); disksAllocationView = new DisksAllocationView(constants); @@ -654,7 +646,7 @@ commentEditor = new EntityModelTextBoxEditor(new ModeSwitchingVisibilityRenderer()); totalvCPUsEditor = new EntityModelTextBoxEditor(new ModeSwitchingVisibilityRenderer()); numOfVmsEditor = new EntityModelTextBoxEditor(new ModeSwitchingVisibilityRenderer()); - cpuPinning = new EntityModelTextBoxOnlyEditor(new ModeSwitchingVisibilityRenderer()); + cpuPinning = new EntityModelTextBoxEditor(new ModeSwitchingVisibilityRenderer()); cpuSharesAmountEditor = new EntityModelTextBoxOnlyEditor(new ModeSwitchingVisibilityRenderer()); cpuSharesAmountEditor.asValueBox().setWidth("110px");//$NON-NLS-1$ kernel_pathEditor = new EntityModelTextBoxEditor(new ModeSwitchingVisibilityRenderer()); @@ -973,6 +965,10 @@ provisioningCloneEditor.setLabel(constants.cloneVmPopup()); minAllocatedMemoryEditor.setLabel(constants.physMemGuarVmPopup()); cpuSharesAmountSelectionEditor.setLabel(constants.cpuShares()); + cpuPinning.showInfoIcon(SafeHtmlUtils.fromTrustedString(applicationTemplates.italicFixedWidth("400px",//$NON-NLS-1$ + constants.cpuPinningLabelExplanation()) + .asString() + .replaceAll("(\r\n|\n)", "<br />"))); //$NON-NLS-1$ //$NON-NLS-2$ // Boot Options firstBootDeviceEditor.setLabel(constants.firstDeviceVmPopup()); diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml index d5633fe..648577e 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml @@ -25,6 +25,8 @@ font-weight: bold; margin-top: 10px; margin-bottom: 5px; + width: 100%; + float: left; } .sectionComment { @@ -36,6 +38,7 @@ .horizontallyAlignedCheckBox { float: left; padding-right: 15px; + width: auto; } .horizontallyAlignedCheckBoxContent { @@ -118,7 +121,7 @@ } .runHostPanel { - + float: left; } .attachCdPanel { @@ -131,6 +134,7 @@ .hostRunMigrationOptions { margin-left: 6px; + float: left; } .warningMessageLabel { @@ -139,19 +143,14 @@ bottom: 10px; } - - - .cpuPinningStyle { - float: left; - } - .expanderContent,.generalExpanderContent { padding-left: 10px; } .monitorsStyles { width: 40px; - padding-left: 25px; + float: right; + padding-right: 5px; } .expanderContent { @@ -243,21 +242,14 @@ padding-left: 5px; padding-right: 5px; padding-top: 0; - width: 230px; + width: 100%; height: 30px; } .monitorsLabel { float: left; color: #333333; - width: 250px; - } - - .cpuPinningLabel { - float: left; - color: #333333; - width: 220px; - margin: 5px; + width: 255px; } .cpuSharesSelector { @@ -277,7 +269,12 @@ .migrationSelectorInner { width: 260px; } - </ui:style> + + .cpuPinningStyle, .timezoneEditorStyle { + float: left; + } + + </ui:style> <t:DialogTabPanel width="100%" height="100%"> <t:header> @@ -397,8 +394,8 @@ <t:DialogTab ui:field="initialRunTab"> <t:content> <g:FlowPanel> - <g:Label addStyleNames="{style.sectionLabel}" text="{constants.initialRunGeneral}" /> - <e:ListModelListBoxEditor ui:field="timeZoneEditor" /> + <g:Label addStyleNames="{style.sectionLabel}" text="{constants.initialRunGeneral}" /> + <e:ListModelListBoxEditor ui:field="timeZoneEditor" /> <g:Label addStyleNames="{style.sectionLabel}" text="{constants.initialRunWindows}" /> <e:ListModelListBoxEditor ui:field="domainEditor" /> </g:FlowPanel> @@ -412,14 +409,10 @@ <e:ListModelListBoxEditor ui:field="displayProtocolEditor" /> <e:ListModelListBoxEditor ui:field="vncKeyboardLayoutEditor" /> <e:ListModelListBoxEditor ui:field="usbSupportEditor" /> - <g:FlowPanel width="100%"> - <g:FlowPanel addStyleNames="{style.monitorPanel}"> - <g:HorizontalPanel verticalAlignment="middle"> - <g:Label text="{constants.monitors}" ui:field="numOfMonitorsLabel" addStyleNames="{style.monitorsLabel}" /> - <e:ListModelListBoxEditor ui:field="numOfMonitorsEditor" addStyleNames="{style.monitorsStyles}" /> - <e:EntityModelCheckBoxEditor ui:field="isSingleQxlEnabledEditor" addStyleNames="{style.checkbox}" /> - </g:HorizontalPanel> - </g:FlowPanel> + <g:FlowPanel addStyleNames="{style.monitorPanel}"> + <g:Label text="{constants.monitors}" ui:field="numOfMonitorsLabel" addStyleNames="{style.monitorsLabel}" /> + <e:ListModelListBoxEditor ui:field="numOfMonitorsEditor" addStyleNames="{style.monitorsStyles}" /> + <e:EntityModelCheckBoxEditor ui:field="isSingleQxlEnabledEditor" addStyleNames="{style.checkbox}" /> </g:FlowPanel> <e:EntityModelCheckBoxEditor ui:field="isSmartcardEnabledEditor" addStyleNames="{style.checkbox}" /> <g:Label ui:field="nativeUsbWarningMessage" text="{constants.nativeUsbSupportWarning}" addStyleNames="{style.warningMessageLabel}" /> @@ -439,7 +432,7 @@ <t:content> <g:FlowPanel> <g:Label addStyleNames="{style.sectionLabel}" text="{constants.runOnVmPopup}" /> - <g:VerticalPanel addStyleNames="{style.runHostPanel}" verticalAlignment='ALIGN_MIDDLE'> + <g:VerticalPanel width="100%" addStyleNames="{style.runHostPanel}" verticalAlignment='ALIGN_MIDDLE'> <e:EntityModelRadioButtonEditor ui:field="isAutoAssignEditor" addStyleNames="{style.radioButton}" /> <g:HorizontalPanel verticalAlignment='ALIGN_MIDDLE'> @@ -485,9 +478,7 @@ <g:Label addStyleNames="{style.sectionLabel}" text="{constants.cpuAllocVmPopup}"/> <e:ListModelListBoxEditor ui:field="cpuSharesAmountSelectionEditor" addStyleNames="{style.cpuSharesSelector}"/> <e:EntityModelTextBoxOnlyEditor ui:field="cpuSharesAmountEditor" addStyleNames="{style.cpuSahresValue}"/> - <g:Label text="{constants.cpuPinningLabel}" addStyleNames="{style.cpuPinningLabel}"/> - <d:InfoIcon ui:field="cpuPinningInfo" addStyleNames="{style.poolNameIcon}"/> - <e:EntityModelTextBoxOnlyEditor ui:field="cpuPinning" addStyleNames="{style.cpuPinningStyle}"/> + <e:EntityModelTextBoxEditor ui:field="cpuPinning" addStyleNames="{style.cpuPinningStyle}" /> </g:FlowPanel> <g:FlowPanel addStyleNames="{style.sectionPanelTight}"> <g:Label addStyleNames="{style.sectionLabel}" text="{constants.memAllocVmPopup}" /> -- To view, visit http://gerrit.ovirt.org/18693 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f73b9202462770e4426845c3c6360d5ed16a10e Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Tomas Jelinek <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
