From f828b1f417126cc6078d035c574ca0248ec840fc Mon Sep 17 00:00:00 2001 From: Esteban Lorenzano Date: Mon, 15 Apr 2024 12:12:25 +0200 Subject: [PATCH] fix layouts --- .../SpAbstractMessageDialog.class.st | 27 +++++++++---------- src/Spec2-Dialogs/SpRequestDialog.class.st | 25 ++++++++--------- .../SpRequestTextDialog.class.st | 26 +++++++++--------- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Spec2-Dialogs/SpAbstractMessageDialog.class.st b/src/Spec2-Dialogs/SpAbstractMessageDialog.class.st index 9cae5a7c..8b41e2f0 100644 --- a/src/Spec2-Dialogs/SpAbstractMessageDialog.class.st +++ b/src/Spec2-Dialogs/SpAbstractMessageDialog.class.st @@ -43,7 +43,10 @@ SpAbstractMessageDialog >> adjustExtentToLabelHeight: anExtent [ { #category : 'private' } SpAbstractMessageDialog >> calculateLabelHeight [ - ^ (self calculateLabelHeightForTextWithoutMargin: label text forExtent: self extent) + self labelMargin + ^ (self + calculateLabelHeightForTextWithoutMargin: label text + forExtent: self extent) + + self labelMargin ] { #category : 'private' } @@ -60,19 +63,15 @@ SpAbstractMessageDialog >> calculateLabelHeightForTextWithoutMargin: aText forEx SpAbstractMessageDialog >> defaultLayout [ ^ SpBoxLayout newTopToBottom - spacing: 0; - add: (SpBoxLayout newLeftToRight - add: (SpBoxLayout newTopToBottom - vAlignStart; - add: #image; - yourself) - expand: false; - add: #label withConstraints: [ :c | - c - expand: true; - fill: true ]; - yourself); - yourself + add: (SpBoxLayout newLeftToRight + add: (SpBoxLayout newTopToBottom + vAlignStart; + add: image; + yourself) + expand: false; + add: label expand: true; + yourself); + yourself ] { #category : 'accessing' } diff --git a/src/Spec2-Dialogs/SpRequestDialog.class.st b/src/Spec2-Dialogs/SpRequestDialog.class.st index b96dad40..3d06a402 100644 --- a/src/Spec2-Dialogs/SpRequestDialog.class.st +++ b/src/Spec2-Dialogs/SpRequestDialog.class.st @@ -104,18 +104,19 @@ SpRequestDialog >> connectPresenters [ SpRequestDialog >> defaultLayout [ ^ SpBoxLayout newTopToBottom - spacing: 5; - add: (SpBoxLayout newLeftToRight - add: (SpBoxLayout newTopToBottom - vAlignStart; - add: #image; - yourself) - expand: false; - add: #label expand: true; - yourself) height: self calculateLabelHeight; - add: #textInput expand: false; - add: #errorLabel; - yourself + spacing: 5; + add: (SpBoxLayout newLeftToRight + add: (SpBoxLayout newTopToBottom + vAlignStart; + add: image; + yourself) + expand: false; + add: label expand: true; + yourself) + height: self calculateLabelHeight; + add: textInput expand: false; + add: errorLabel; + yourself ] { #category : 'accessing' } diff --git a/src/Spec2-Dialogs/SpRequestTextDialog.class.st b/src/Spec2-Dialogs/SpRequestTextDialog.class.st index 78f057d5..9fd0f309 100644 --- a/src/Spec2-Dialogs/SpRequestTextDialog.class.st +++ b/src/Spec2-Dialogs/SpRequestTextDialog.class.st @@ -36,19 +36,19 @@ SpRequestTextDialog class >> exampleModal [ SpRequestTextDialog >> defaultLayout [ ^ SpBoxLayout newTopToBottom - spacing: 5; - add: (SpBoxLayout newLeftToRight - add: (SpBoxLayout newTopToBottom - vAlignStart; - add: #image; - yourself) - expand: false; - add: #label expand: true; - yourself) - height: self calculateLabelHeight; - add: #textInput expand: true; - add: #errorLabel expand: false; - yourself + spacing: 5; + add: (SpBoxLayout newLeftToRight + add: (SpBoxLayout newTopToBottom + vAlignStart; + add: image; + yourself) + expand: false; + add: label expand: true; + yourself) + height: self calculateLabelHeight; + add: textInput expand: true; + add: errorLabel expand: false; + yourself ] { #category : 'initialization' }