-
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.
- Loading branch information
Showing
13 changed files
with
65 additions
and
7 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/Material-Core.package/MDButton.class/class/minimumPadding.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,4 @@ | ||
default properties | ||
minimumPadding | ||
|
||
^ 5 |
4 changes: 4 additions & 0 deletions
4
packages/Material-Core.package/MDButton.class/instance/labelShrinkThreshold.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,4 @@ | ||
drawing | ||
labelShrinkThreshold | ||
|
||
^ (self label font widthOf: $m) * 2 |
5 changes: 3 additions & 2 deletions
5
packages/Material-Core.package/MDButton.class/instance/updateContents..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,5 +1,6 @@ | ||
drawing | ||
updateContents: aCanvas | ||
|
||
self updateLabelPosition. | ||
self updateIcons | ||
self updateIcons. | ||
self updateLabelExtent. | ||
self updateLabelPosition |
16 changes: 16 additions & 0 deletions
16
packages/Material-Core.package/MDButton.class/instance/updateLabelExtent.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,16 @@ | ||
drawing | ||
updateLabelExtent | ||
|
||
| availableWidth | | ||
|
||
availableWidth := self width. | ||
self hasIcon ifTrue: [availableWidth := availableWidth - self icon width]. | ||
self hasIconRight ifTrue: [availableWidth := availableWidth - self iconRight width]. | ||
availableWidth := availableWidth - (self class minimumPadding * 2). | ||
|
||
availableWidth < self labelShrinkThreshold | ||
ifTrue: [self label shrink] | ||
ifFalse: [ | ||
self label expand. | ||
availableWidth < self label fullWidth | ||
ifTrue: [self label width: availableWidth]] |
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
5 changes: 5 additions & 0 deletions
5
packages/Material-Tools.package/MDLabel.class/instance/expand.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 @@ | ||
scaling | ||
expand | ||
|
||
contents := self fullContents. | ||
self fitContents |
4 changes: 4 additions & 0 deletions
4
packages/Material-Tools.package/MDLabel.class/instance/fullContents..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,4 @@ | ||
accessing | ||
fullContents: anObject | ||
|
||
fullContents := anObject |
4 changes: 4 additions & 0 deletions
4
packages/Material-Tools.package/MDLabel.class/instance/fullContents.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,4 @@ | ||
accessing | ||
fullContents | ||
|
||
^ fullContents ifNil: [fullContents := ''] |
4 changes: 4 additions & 0 deletions
4
packages/Material-Tools.package/MDLabel.class/instance/fullWidth.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,4 @@ | ||
scaling | ||
fullWidth | ||
|
||
^ self font widthOfString: self fullContents |
6 changes: 6 additions & 0 deletions
6
packages/Material-Tools.package/MDLabel.class/instance/shrink.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,6 @@ | ||
scaling | ||
shrink | ||
|
||
self fullContents ifNotEmpty: [ | ||
contents := self fullContents first asString. | ||
self fitContents] |
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