# HG changeset patch # User souliane # Date 1393860240 -3600 # Node ID f539f6f8ee9cc2c1de01c69535b1d5a379ce5e4e # Parent c86d7a8d2c1ec34376162e271987589d7195fcb9 browser_side: standardize the dialogs size and buttons display: - do not set a default width/height for the XMLUI dialogs - do not display an extra "Close" button when XMLUI form is showed - the buttons order is OK/Save on the left, Cancel/Close on the right - horizontally center the dialog buttons diff -r c86d7a8d2c1e -r f539f6f8ee9c browser_side/contact_group.py --- a/browser_side/contact_group.py Mon Mar 03 15:44:54 2014 +0100 +++ b/browser_side/contact_group.py Mon Mar 03 16:24:00 2014 +0100 @@ -145,8 +145,8 @@ """Add the buttons to close the dialog / save the groups""" buttons = HorizontalPanel() buttons.addStyleName("marginAuto") + buttons.add(Button("Save", listener=self.closeAndSave)) buttons.add(Button("Cancel", listener=self.cancelWithoutSaving)) - buttons.add(Button("Save", listener=self.closeAndSave)) return buttons def getContactList(self): diff -r c86d7a8d2c1e -r f539f6f8ee9c browser_side/file_tools.py --- a/browser_side/file_tools.py Mon Mar 03 15:44:54 2014 +0100 +++ b/browser_side/file_tools.py Mon Mar 03 16:24:00 2014 +0100 @@ -97,12 +97,13 @@ hPanel = HorizontalPanel() hPanel.setSpacing(5) + hPanel.setStyleName('marginAuto') self.file_upload = FilterFileUpload(input_id, max_size) self.vPanel.add(self.file_upload) - hPanel.add(Button(self.texts['cancel_button'], getattr(self, "onCloseBtnClick"))) self.upload_btn = Button(self.texts['ok_button'], getattr(self, "onSubmitBtnClick")) hPanel.add(self.upload_btn) + hPanel.add(Button(self.texts['cancel_button'], getattr(self, "onCloseBtnClick"))) self.status = Label() hPanel.add(self.status) diff -r c86d7a8d2c1e -r f539f6f8ee9c browser_side/menu.py --- a/browser_side/menu.py Mon Mar 03 15:44:54 2014 +0100 +++ b/browser_side/menu.py Mon Mar 03 16:24:00 2014 +0100 @@ -331,5 +331,5 @@ body = AvatarUpload() _dialog = dialog.GenericDialog("Avatar upload", body, options=['NO_CLOSE']) body.setCloseCb(_dialog.close) - _dialog.setSize('40%', '40%') + _dialog.setWidth('40%') _dialog.show() diff -r c86d7a8d2c1e -r f539f6f8ee9c browser_side/xmlui.py --- a/browser_side/xmlui.py Mon Mar 03 15:44:54 2014 +0100 +++ b/browser_side/xmlui.py Mon Mar 03 16:24:00 2014 +0100 @@ -364,6 +364,7 @@ self.setCellHeight(self.main_cont, '100%') if self.type == 'form': hpanel = HorizontalPanel() + hpanel.setStyleName('marginAuto') hpanel.add(Button('Submit',self.onFormSubmitted)) if not 'NO_CANCEL' in self.flags: hpanel.add(Button('Cancel',self.onFormCancelled)) @@ -371,6 +372,6 @@ elif self.type == 'param': assert(isinstance(self.children[0][0],TabPanel)) hpanel = HorizontalPanel() + hpanel.add(Button('Save', self.onSaveParams)) hpanel.add(Button('Cancel', lambda ignore: self._xmluiClose())) - hpanel.add(Button('Save', self.onSaveParams)) self.add(hpanel) diff -r c86d7a8d2c1e -r f539f6f8ee9c libervia.py --- a/libervia.py Mon Mar 03 15:44:54 2014 +0100 +++ b/libervia.py Mon Mar 03 16:24:00 2014 +0100 @@ -378,9 +378,9 @@ pass elif "xmlui" in data: ui = XMLUI(self, xml_data = data['xmlui']) - _dialog = dialog.GenericDialog(ui.title, ui) + options = ['NO_CLOSE'] if ui.type == 'form' else [] + _dialog = dialog.GenericDialog(ui.title, ui, options=options) ui.setCloseCb(_dialog.close) - _dialog.setSize('80%', '80%') _dialog.show() else: dialog.InfoDialog("Error",