Skip to content

Commit

Permalink
Add icon(s) to indicate how to move up the hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGrayStone committed May 31, 2021
1 parent 23f60ed commit 3c276b3
Show file tree
Hide file tree
Showing 23 changed files with 109 additions and 19 deletions.
4 changes: 3 additions & 1 deletion packages/Algernon.package/ALGBreadcrumbs.class/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
An ALGBreadcrumbs is a GUI component that is responsible for displaying the current hierarchy.

Instance Variables
controller: ALGController reference to ALGController
controller: ALGController reference to ALGController
defaultCrumb: TextMorph default breadcrumb shown on start
navigateBackIconMorph: Morph contains two icons: shift and tab
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
iconInsideSpacing

^ 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
iconSpacing

^ 8
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ updating
clear

self removeAllMorphsIn: self submorphs.
self initializeDefaultCrumb.
self updateWidth
self
initializeNavigateBackIcon;
initializeDefaultCrumb;
updateWidth
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
initialization
createNavigateBackIconMorph
| shiftIconMorph tabIconMorph |

shiftIconMorph := self createNavigationIcon: #NavigateBack.
tabIconMorph := self createNavigationIcon: #HasChildren.
shiftIconMorph
position: (self position x + self class crumbSpacing) @ shiftIconMorph position y.
tabIconMorph
position: (shiftIconMorph position x +
shiftIconMorph width +
self class iconInsideSpacing) @ tabIconMorph position y.
^ self packIconsIntoMorph: { shiftIconMorph . tabIconMorph }.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
initialization
createNavigationIcon: aSymbol

^ (ALGIconFactory getInstance loadIconFor: aSymbol) asMorph
height: self height;
center: self center.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
defaultCrumb: anObject
defaultCrumb := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
defaultCrumb
^ defaultCrumb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
updating
hideNavigateBackIcon

self navigateBackIconMorph hide.
self defaultCrumb
position: (self position x + self class crumbSpacing) @ self defaultCrumb position y.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ initialize
width: self controller width;
color: self class defaultColor;
position: self calculatePosition.
self initializeDefaultCrumb
self
initializeNavigateBackIcon;
initializeDefaultCrumb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
initialization
initializeDefaultCrumb

| crumb |
crumb := self createCrumb: ALGCore title.
crumb center: self center.
crumb position: (self position x + self class crumbSpacing) @ crumb position y.
self addMorphBack: crumb; updateWidth
self defaultCrumb: (self createCrumb: ALGCore title).
self defaultCrumb center: self center.
self defaultCrumb
position: (self position x + self class crumbSpacing) @ self defaultCrumb position y.
self addMorphBack: self defaultCrumb; updateWidth
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
initialization
initializeNavigateBackIcon

self navigateBackIconMorph: self createNavigateBackIconMorph.
self addMorphBack: self navigateBackIconMorph.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
navigateBackIconMorph: anObject
navigateBackIconMorph := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
navigateBackIconMorph
^ navigateBackIconMorph
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
initialization
packIconsIntoMorph: aMorphCollection

^ Morph new
color: Color transparent;
addAllMorphsBack: aMorphCollection;
hide.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
updating
showNavigateBackIcon

self navigateBackIconMorph show.
self defaultCrumb
position: (
self position x +
self class crumbSpacing +
self class iconSpacing +
self navigateBackIconMorph width) @ self defaultCrumb position y
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,28 @@
"defaultTextColor" : "J.J. 7/28/2015 19:27",
"delimeter" : "J.J. 7/28/2015 19:32",
"highlightedTextColor" : "J.J. 7/28/2015 19:27",
"iconInsideSpacing" : "NL 5/31/2021 12:21",
"iconSpacing" : "NL 5/31/2021 12:11",
"newIn:" : "J.J. 7/28/2015 19:26" },
"instance" : {
"calculatePosition" : "jRo 8/1/2020 11:26",
"clear" : "fw 7/30/2015 16:07",
"clear" : "NL 5/31/2021 12:09",
"controller" : "J.J. 7/16/2015 22:48",
"controller:" : "J.J. 7/28/2015 19:25",
"createCrumb:" : "rk 8/3/2020 16:45",
"createNavigateBackIconMorph" : "NL 5/31/2021 12:23",
"createNavigationIcon:" : "NL 5/31/2021 12:18",
"defaultCrumb" : "NL 5/31/2021 12:02",
"defaultCrumb:" : "NL 5/31/2021 12:02",
"hideNavigateBackIcon" : "NL 5/31/2021 12:12",
"highlightLastCrumb" : "jRo 8/1/2020 11:28",
"initialize" : "jRo 8/1/2020 11:26",
"initializeDefaultCrumb" : "pw 7/6/2020 17:34",
"pop" : "jRo 8/1/2020 11:28",
"push:" : "jRo 8/1/2020 01:18",
"initialize" : "NL 5/31/2021 12:08",
"initializeDefaultCrumb" : "NL 5/31/2021 12:08",
"initializeNavigateBackIcon" : "NL 5/31/2021 12:08",
"navigateBackIconMorph" : "NL 5/31/2021 11:34",
"navigateBackIconMorph:" : "NL 5/31/2021 11:34",
"packIconsIntoMorph:" : "NL 5/31/2021 12:24",
"pop" : "NL 5/31/2021 11:48",
"push:" : "NL 5/31/2021 11:40",
"showNavigateBackIcon" : "NL 5/31/2021 12:11",
"updateWidth" : "J.J. 7/28/2015 19:31" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
],
"classvars" : [
],
"commentStamp" : "J.J. 7/31/2015 18:39",
"commentStamp" : "NL 5/31/2021 12:28",
"instvars" : [
"controller" ],
"controller",
"navigateBackIconMorph",
"defaultCrumb" ],
"name" : "ALGBreadcrumbs",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
updating
showChildList
(self currentItem hasChildren) ifFalse: [ ^ self ].
self breadcrumbs showNavigateBackIcon.
self breadcrumbs push: self currentItem.
self searchStack push: self textField currentContent.
self parentStack push: self currentItem.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
updating
showParentList
self searchStack isEmpty ifTrue: [ ^ self ].
self searchStack size = 1 ifTrue: [ self breadcrumbs hideNavigateBackIcon ].
self breadcrumbs pop.
self textField clear.
self textField contents: self searchStack pop.
Expand Down
4 changes: 2 additions & 2 deletions packages/Algernon.package/ALGCore.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@
"selectNext" : "J.J. 7/27/2015 21:41",
"selectPrevious" : "J.J. 7/27/2015 21:42",
"shouldHandleKeyboard:" : "beb 5/29/2020 18:38",
"showChildList" : "jRo 8/1/2020 12:55",
"showChildList" : "NL 5/31/2021 11:47",
"showMorphs" : "fw 7/30/2015 15:39",
"showParentList" : "jRo 8/1/2020 13:28",
"showParentList" : "NL 5/31/2021 11:48",
"step" : "DS 6/2/2017 15:01",
"stepTime" : "DS 5/21/2017 16:53",
"systemChanged:" : "jRo 8/5/2020 16:47",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ initializeFileMapping
#ALGWindowType -> (self windowIcon).
#HasChildren -> (self tabIcon).
#TopResult -> (self starIcon).
#NavigateBack -> (self shiftIcon).
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"iconFor:" : "jRo 5/31/2020 15:35",
"iconSize" : "J.J. 7/30/2015 15:07",
"iconSizeItemType" : "jRo 5/31/2020 15:16",
"initializeFileMapping" : "NL 5/31/2021 11:15",
"initializeFileMapping" : "NL 5/31/2021 11:35",
"methodIcon" : "fw 7/21/2015 22:02",
"morphIcon" : "fw 7/21/2015 22:02",
"packageIcon" : "fw 7/21/2015 22:02",
Expand Down

0 comments on commit 3c276b3

Please sign in to comment.