From bd6b3f2d9fb72d6cbadeb931195800801b346678 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
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 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js
index 1b6e374..1bb9a48 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'];
-- 
1.7.9.1