Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix layouts #1539

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading