Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some icons access #1470

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ SpMorphicNumberInputFieldAdapter >> buildWidget [
color: Color transparent;
changeTableLayout;
listDirection: #topToBottom;
addMorph: (self newIconButtonAction: #decreaseValueOf: with: textMorph iconSelector: #arrowDoubleDownIcon);
addMorph: (self newIconButtonAction: #increaseValueOf: with: textMorph iconSelector: #arrowDoubleUpIcon);
addMorph: (self newIconButtonAction: #decreaseValueOf: with: textMorph iconSelector: #arrowDoubleDown);
addMorph: (self newIconButtonAction: #increaseValueOf: with: textMorph iconSelector: #arrowDoubleUp);
yourself.

"With the layout frame I set next to it, the arrows will be at the top right of the text morph. We should be able to make it vertically centered but I don't know how to do that with morphs. If someone knows, please do :)"
Expand Down
12 changes: 6 additions & 6 deletions src/Spec2-Core/SpEditableListPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -159,27 +159,27 @@ SpEditableListPresenter >> initializePresenters [
bottomButton := self newButton.
addButton
addStyle: 'small';
icon: (self iconNamed: #addIcon);
icon: (self iconNamed: #add);
help: 'Add a new item to the list'.
removeButton
addStyle: 'small';
icon: (self iconNamed: #removeIcon);
icon: (self iconNamed: #remove);
help: 'Remove a item from the list'.
upButton
addStyle: 'small';
icon: (self iconNamed: #upIcon);
icon: (self iconNamed: #up);
help: 'Move this item up from one element'.
downButton
addStyle: 'small';
icon: (self iconNamed: #downIcon);
icon: (self iconNamed: #down);
help: 'Move this item down from one element'.
topButton
addStyle: 'small';
icon: (self iconNamed: #topIcon);
icon: (self iconNamed: #top);
help: 'Move this item on the first position of the list'.
bottomButton
addStyle: 'small';
icon: (self iconNamed: #bottomIcon);
icon: (self iconNamed: #bottom);
help: 'Move this item on the last position of the list'
]

Expand Down
24 changes: 13 additions & 11 deletions src/Spec2-Core/SpNotificationCenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,46 @@
I'm a simple object holding a limited list of notification items.
"
Class {
#name : #SpNotificationCenter,
#superclass : #Object,
#name : 'SpNotificationCenter',
#superclass : 'Object',
#instVars : [
'items',
'limit',
'application'
],
#category : #'Spec2-Core-Notification'
#category : 'Spec2-Core-Notification',
#package : 'Spec2-Core',
#tag : 'Notification'
}

{ #category : #adding }
{ #category : 'adding' }
SpNotificationCenter >> add: aSpNotificationItem [
items size > limit
ifTrue: [ items removeLast: self bulkSize ].
items addFirst: aSpNotificationItem.
self updateIfNecessary.
]

{ #category : #accessing }
{ #category : 'accessing' }
SpNotificationCenter >> application [
^ application
]

{ #category : #adding }
{ #category : 'adding' }
SpNotificationCenter >> bulkSize [
"Returns the number of itesm that should be removed when the limit is reached.
Pay attention that the limit MUST always be larger than bulkSize"

^ 5
]

{ #category : #adding }
{ #category : 'adding' }
SpNotificationCenter >> forApplication: app [

application := app
]

{ #category : #initialization }
{ #category : 'initialization' }
SpNotificationCenter >> initialize [

super initialize.
Expand All @@ -49,17 +51,17 @@ SpNotificationCenter >> initialize [
items := OrderedCollection new.
]

{ #category : #accessing }
{ #category : 'accessing' }
SpNotificationCenter >> items [
^ items
]

{ #category : #accessing }
{ #category : 'accessing' }
SpNotificationCenter >> limit [
^ limit
]

{ #category : #adding }
{ #category : 'adding' }
SpNotificationCenter >> updateIfNecessary [

| notifs |
Expand Down
14 changes: 8 additions & 6 deletions src/Spec2-Core/SpNotificationItem.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,28 @@
I'm a simple object representing a notification.
"
Class {
#name : #SpNotificationItem,
#superclass : #Object,
#name : 'SpNotificationItem',
#superclass : 'Object',
#instVars : [
'text'
],
#category : #'Spec2-Core-Notification'
#category : 'Spec2-Core-Notification',
#package : 'Spec2-Core',
#tag : 'Notification'
}

{ #category : #'instance creation' }
{ #category : 'instance creation' }
SpNotificationItem class >> with: aString [

^ self new text: aString ; yourself
]

{ #category : #accessing }
{ #category : 'accessing' }
SpNotificationItem >> text [
^ text
]

{ #category : #accessing }
{ #category : 'accessing' }
SpNotificationItem >> text: aString [
text := aString
]
8 changes: 4 additions & 4 deletions src/Spec2-Examples/SpDemoNotebookPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SpDemoNotebookPresenter >> browserPage [

^ SpNotebookPage
title: 'Browser'
icon: (self iconNamed: #nautilusIcon)
icon: (self iconNamed: #nautilus)
provider: [
SpClassMethodBrowser new
classes: self class environment allClasses;
Expand Down Expand Up @@ -58,7 +58,7 @@ SpDemoNotebookPresenter >> defaultLayout [

{ #category : 'pages' }
SpDemoNotebookPresenter >> dynamicPage [
^ SpNotebookPage title: 'Dynamic' icon: (self iconNamed: #nautilusIcon) provider: [ SpDynamicWidgetChange new ]
^ SpNotebookPage title: 'Dynamic' icon: (self iconNamed: #nautilus) provider: [ SpDynamicWidgetChange new ]
]

{ #category : 'initialization' }
Expand All @@ -79,7 +79,7 @@ SpDemoNotebookPresenter >> objectClassPage [

^ (SpNotebookPage
title: 'Object class'
icon: (self iconNamed: #nautilusIcon)
icon: (self iconNamed: #nautilus)
provider: [
SpDemoMessageBrowser new
messages: Object methods;
Expand All @@ -91,7 +91,7 @@ SpDemoNotebookPresenter >> objectClassPage [
{ #category : 'pages' }
SpDemoNotebookPresenter >> objectInspectorPage [

^ SpNotebookPage title: 'Object inspector' icon: (self iconNamed: #nautilusIcon) provider: [
^ SpNotebookPage title: 'Object inspector' icon: (self iconNamed: #nautilus) provider: [
SpObjectInspector new
inspect: Object;
yourself ]
Expand Down
8 changes: 2 additions & 6 deletions src/Spec2-Layout/SpExecutableLayout.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -336,17 +336,13 @@ SpExecutableLayout >> unsubscribe [
{ #category : 'events' }
SpExecutableLayout >> whenChildrenAddedDo: aBlock [

self announcer
when: SpChildrenAdded
do: aBlock
self announcer when: SpChildrenAdded do: aBlock for: aBlock receiver
]

{ #category : 'events' }
SpExecutableLayout >> whenChildrenRemovedDo: aBlock [

self announcer
when: SpChildrenRemoved
do: aBlock
self announcer when: SpChildrenRemoved do: aBlock for: aBlock receiver
]

{ #category : 'private' }
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Morphic/SpDatePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ SpDatePresenter >> display: aBlock [
{ #category : 'private' }
SpDatePresenter >> iconMorph [

^ ImageMorph new form: (self iconNamed: #calendarIcon)
^ ImageMorph new form: (self iconNamed: #calendar)
]

{ #category : 'initialization' }
Expand Down
Loading