Skip to content

Commit

Permalink
Added border and padding to cards and wrote some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonia Heinen committed Jun 14, 2024
1 parent 4065ee0 commit 81cbabd
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ applyUserInterfaceTheme

| textColor font |
super applyUserInterfaceTheme.
self color: ((self userInterfaceTheme get: #color for: PluggableButtonMorph) ifNil: [Color red]).
self color: ((self userInterfaceTheme get: #color for: PluggableButtonMorph) ifNil: [Color red]);
borderWidth: self borderWidthMultiplier * ((self userInterfaceTheme get: #borderWidth for: PluggableButtonMorph) ifNil: [1]);
borderColor: ((self userInterfaceTheme get: #borderColor for: PluggableButtonMorph) ifNil: [Color red]).
textColor := (self userInterfaceTheme get: #textColor for: PluggableButtonMorph) ifNil: [Color white].
font := (self userInterfaceTheme get: #font for: PluggableButtonMorph).
self assigneeModel textColor: textColor; font: font.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
borderWidthMultiplier

^ 3.
2 changes: 1 addition & 1 deletion Squello-Core.package/SPBCard.class/instance/buildTitle.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildTitle
titleMorph := TextMorph new
wrapFlag: true;
lock;
width: self extent x;
width: self extent x - (2 * self padding);
yourself.
self
titleModel: titleMorph;
Expand Down
1 change: 1 addition & 0 deletions Squello-Core.package/SPBCard.class/instance/buildUI.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ buildUI
updateAssigneeCount;
updateLabelIcons;
setCardHeight.
self titleModel position: self position + (self padding@self padding).
self assigneeModel position: self position + self extent - self assigneeOffset.
self statusModel position: self position + self extent - self statusOffset.
self resizeIndicatorFields.
Expand Down
4 changes: 4 additions & 0 deletions Squello-Core.package/SPBCard.class/instance/padding.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
padding

^ 8.
8 changes: 5 additions & 3 deletions Squello-Core.package/SPBCard.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"addLabel:" : "lo 7/31/2022 16:27",
"addLabelLocal:" : "tk 8/2/2022 23:12",
"alignLabels" : "mcr 8/4/2022 01:36",
"applyUserInterfaceTheme" : "AH 6/14/2024 10:29",
"applyUserInterfaceTheme" : "AH 6/14/2024 12:12",
"assigneeModel" : "tk 8/2/2022 23:27",
"assigneeModel:" : "tk 8/2/2022 23:27",
"assigneeOffset" : "lo 8/1/2022 11:45",
Expand All @@ -23,15 +23,16 @@
"becomeActiveCard" : "mcr 8/1/2022 02:42",
"boardProvider" : "jh 7/29/2022 12:46",
"boardProvider:" : "lo 7/31/2022 16:30",
"borderWidthMultiplier" : "AH 6/14/2024 12:02",
"buildAssigneeText" : "mcr 8/4/2022 01:38",
"buildCard:" : "FP 5/21/2024 11:49",
"buildContent:" : "AH 6/1/2024 17:57",
"buildIndicatorDetection" : "tk 8/2/2022 23:23",
"buildIndicatorDetectionHalf" : "lo 8/1/2022 11:37",
"buildNote:" : "FP 5/20/2024 20:02",
"buildStatusText" : "AH 5/25/2024 16:59",
"buildTitle" : "mcr 8/4/2022 01:41",
"buildUI" : "AH 6/14/2024 10:37",
"buildTitle" : "AH 6/14/2024 12:14",
"buildUI" : "AH 6/14/2024 12:16",
"calculateLabelPositionFor:" : "mcr 8/4/2022 01:35",
"cardIndicatorExtent" : "lo 8/1/2022 11:52",
"changeProvider" : "lo 7/8/2022 15:38",
Expand Down Expand Up @@ -66,6 +67,7 @@
"lowerHalfIndicator" : "tk 8/2/2022 23:22",
"lowerHalfIndicator:" : "tk 8/2/2022 23:22",
"moveCardWith:" : "lo 8/3/2022 13:14",
"padding" : "AH 6/14/2024 12:14",
"removeAssignee:" : "lo 7/31/2022 16:38",
"removeAssigneeLocal:" : "lo 7/31/2022 16:39",
"removeLabel:" : "lo 7/31/2022 16:41",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
running
testTheme

card applyUserInterfaceTheme.
self assert: card color equals: (SqueakTheme current properties at: PluggableButtonMorph->#color).
self assert: card borderColor equals: (SqueakTheme current properties at: PluggableButtonMorph->#borderColor).
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"testId" : "lo 5/23/2022 17:39",
"testIssueId" : "lo 5/23/2022 17:40",
"testProvider" : "jh 7/29/2022 11:39",
"testTheme" : "AH 6/14/2024 12:28",
"testTitle" : "lo 7/31/2022 17:28",
"testUpdateDescription" : "lo 5/22/2022 16:37",
"testUpdateTitle" : "mcr 6/30/2022 20:25" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
running
testTheme

self assert: pluggablePasteUpMorph color equals: (SqueakTheme current properties at: Model->#uniformWindowColor).
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
"testActionModel" : "lo 8/1/2022 15:19",
"testDropped" : "mcr 7/3/2022 21:36",
"testReject" : "mcr 7/3/2022 21:42",
"testRepelsMorph" : "mcr 7/3/2022 21:43" } }
"testRepelsMorph" : "mcr 7/3/2022 21:43",
"testTheme" : "AH 6/14/2024 12:26" } }

0 comments on commit 81cbabd

Please sign in to comment.