generated from hpi-swa-teaching/SWT-Demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made labels massively more beautiful
- Loading branch information
Antonia Heinen
committed
Jun 20, 2024
1 parent
eebd169
commit 949555c
Showing
13 changed files
with
53 additions
and
19 deletions.
There are no files selected for viewing
7 changes: 5 additions & 2 deletions
7
Squello-Core.package/SPBCard.class/instance/calculateLabelPositionFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
updating-local | ||
calculateLabelPositionFor: aNumber | ||
|
||
| label previousLabel | | ||
| label previousLabel firstAttempt | | ||
previousLabel := self labelModels at: aNumber - 1. | ||
label := self labelModels at: aNumber. | ||
|
||
firstAttempt := (previousLabel position x + previousLabel extent x + self labelBorderOffset) @ previousLabel position y. | ||
firstAttempt x + label extent x <= (self extent x - self labelBorderOffset) ifTrue: [^ firstAttempt]. | ||
|
||
^ self labelBorderOffset @ | ||
(previousLabel position y + (previousLabel extent y + self inbetweenLabelOffset)) | ||
(previousLabel position y + (previousLabel extent y + self inbetweenLabelOffset)). |
4 changes: 2 additions & 2 deletions
4
Squello-Core.package/SPBCard.class/instance/labelBorderOffset.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
accessing | ||
constants | ||
labelBorderOffset | ||
|
||
^ 4. | ||
^ self padding. |
2 changes: 1 addition & 1 deletion
2
Squello-Core.package/SPBCard.class/instance/labelTitleOffset.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
accessing | ||
constants | ||
labelTitleOffset | ||
|
||
^ 10. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
5 changes: 5 additions & 0 deletions
5
Squello-Core.package/SPBLabelMorph.class/instance/applyUserInterfaceTheme.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
as yet unclassified | ||
applyUserInterfaceTheme | ||
|
||
super applyUserInterfaceTheme. | ||
self font: (self userInterfaceTheme get: #font for: PluggableButtonMorph). |
8 changes: 8 additions & 0 deletions
8
Squello-Core.package/SPBLabelMorph.class/instance/initialize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
as yet unclassified | ||
initialize | ||
|
||
super initialize. | ||
self cornerStyle: #rounded; | ||
cornerRadius: 8; | ||
margins: 4@2. | ||
self applyUserInterfaceTheme. |
6 changes: 6 additions & 0 deletions
6
Squello-Core.package/SPBLabelMorph.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"applyUserInterfaceTheme" : "AH 6/20/2024 23:12", | ||
"initialize" : "AH 6/20/2024 23:06" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "Squello-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "SPBLabelMorph", | ||
"pools" : [ | ||
], | ||
"super" : "TextMorph", | ||
"type" : "normal" } |