-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Port]: Upgrade Utilities GT Home Section to Latest API
- Helpers for both spawning and non-spawning buttons - Supply icon, icon file, or icon path string
- Loading branch information
1 parent
54b3220
commit faf23cc
Showing
4 changed files
with
82 additions
and
65 deletions.
There are no files selected for viewing
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
38 changes: 26 additions & 12 deletions
38
src/Dynabook-GToolkit/GtHomeMultiCardSection.extension.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,29 +1,43 @@ | ||
Extension { #name : #GtHomeMultiCardSection } | ||
|
||
{ #category : #'*Dynabook-GToolkit' } | ||
GtHomeMultiCardSection >> buttonPriority: aNumber titled: aString iconFileNamed: iconable tooltip: tipString inspecting: aValuable [ | ||
"Requires `#iconFolder` to be implemented" | ||
GtHomeMultiCardSection >> buttonPriority: aNumber titled: aString icon: iconable tooltip: tipString action: aValuable [ | ||
"Requires `#iconFolder` to be implemented | ||
iconable - can be icon itself, icon file, or icon path string" | ||
|
||
| icon stencil | | ||
icon := iconable isString | ||
ifTrue: [ self iconFromFileNamed: iconable ] | ||
ifFalse: [ GtFileUtility imageElementFromFileReference: iconable ]. | ||
icon := iconable. | ||
iconable isString ifTrue: [ icon := self iconFromFileNamed: iconable ]. | ||
(iconable isKindOf: AbstractFileReference) | ||
ifTrue: [ icon := GtFileUtility imageElementFromFileReference: iconable ]. | ||
|
||
stencil := GtToolButtonStencil new | ||
title: aString; | ||
icon: icon; | ||
iconSize: 50@50; | ||
action: [ :card | | ||
self | ||
showSpaceWithTitle: aString | ||
with: | ||
(GtInspector | ||
createOn: aValuable value) maximized | ||
from: card ]; | ||
action: aValuable; | ||
description: tipString. | ||
|
||
^ GtHomeCard explicit | ||
priority: aNumber; | ||
stencil: [ stencil ]; | ||
yourself | ||
] | ||
|
||
{ #category : #'*Dynabook-GToolkit' } | ||
GtHomeMultiCardSection >> buttonPriority: aNumber titled: aString icon: iconable tooltip: tipString inspecting: aValuable [ | ||
|
||
^ self | ||
buttonPriority: aNumber | ||
titled: aString | ||
icon: iconable | ||
tooltip: tipString | ||
action: [ :card | | ||
self | ||
showSpaceWithTitle: aString | ||
with: | ||
(GtInspector | ||
createOn: aValuable value) maximized | ||
from: card ] | ||
] |