Skip to content

Commit

Permalink
Merge pull request #1539 from pharo-spec/dev-3.0
Browse files Browse the repository at this point in the history
fix layouts
  • Loading branch information
estebanlm committed Apr 15, 2024
2 parents 6909e9e + f828b1f commit 2be6762
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
27 changes: 13 additions & 14 deletions src/Spec2-Dialogs/SpAbstractMessageDialog.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand All @@ -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' }
Expand Down
25 changes: 13 additions & 12 deletions src/Spec2-Dialogs/SpRequestDialog.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand Down
26 changes: 13 additions & 13 deletions src/Spec2-Dialogs/SpRequestTextDialog.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand Down

0 comments on commit 2be6762

Please sign in to comment.