From 760da64a4ceb63e46aca4942264a6d9369ba49ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 28 Feb 2012 16:53:46 +0100 Subject: [PATCH] modalDialog: Hide button layout by default For modal dialogs without buttons, the button group still contributes padding/spacing. To fix that, hide it by default and only show it when actually adding buttons. https://bugzilla.gnome.org/show_bug.cgi?id=668209 --- js/ui/modalDialog.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js index 1b6e37471..1bb9a48dd 100644 --- a/js/ui/modalDialog.js +++ b/js/ui/modalDialog.js @@ -87,6 +87,7 @@ const ModalDialog = new Lang.Class({ y_align: St.Align.START }); this._buttonLayout = new St.BoxLayout({ style_class: 'modal-dialog-button-box', + visible: false, vertical: false }); this._dialogLayout.add(this._buttonLayout, { expand: true, @@ -108,6 +109,8 @@ const ModalDialog = new Lang.Class({ this._buttonLayout.destroy_all_children(); this._actionKeys = {}; + this._buttonLayout.visible = (buttons.length > 0); + for (let i = 0; i < buttons.length; i++) { let buttonInfo = buttons[i]; let label = buttonInfo['label'];