Skip to content

Commit

Permalink
plugged ToThemeChangedEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
plantec committed Jul 20, 2023
1 parent d453795 commit a3bcbf2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 10 additions & 2 deletions src/Toplo/ToSandBox.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1087,10 +1087,18 @@ ToSandBox class >> example_ToButtonWithDefaultDangerSkin [
ToSandBox class >> example_ToButtonWithDefaultSkin [


| space button1 |
| space button1 themeSwitcher |

space := BlSpace new.

space root layout: (BlLinearLayout vertical cellSpacing: 10).
themeSwitcher := ToChoiceBox new.
themeSwitcher data addAll: { ToThemeLight. ToThemeDark }.

themeSwitcher whenSelectedIndexChangedDo: [ space toTheme: themeSwitcher selectedData new ].
themeSwitcher selectData: space toTheme class.

space root addChild: themeSwitcher.

button1 := ToButton new.
button1 label: (ToLabel text: 'Primary button').
button1 icon: (ToImage new innerImage: (ToThemeIcons iconSearchOutlined16x16)).
Expand Down
6 changes: 3 additions & 3 deletions src/Toplo/ToWidgetSkin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ToWidgetSkin >> addLook: aLook [
self privateLook: aLook
]

{ #category : #'as yet unclassified' }
{ #category : #'event handling' }
ToWidgetSkin >> elementAddedToSceneGraphEvent: anEvent [

self whenAddedToSpace: anEvent in: anEvent currentTarget
Expand All @@ -27,7 +27,7 @@ ToWidgetSkin >> elementLookEvent: anEvent [
anEvent sendTo: self look
]

{ #category : #'as yet unclassified' }
{ #category : #'event handling' }
ToWidgetSkin >> elementRemovedFromSceneGraphEvent: anEvent [

self whenRemovedFromSpace: anEvent in: anEvent currentTarget
Expand All @@ -42,7 +42,7 @@ ToWidgetSkin >> elementSkinChangedEvent: anEvent [
{ #category : #'api - accessing' }
ToWidgetSkin >> eventsToHandle [

^ { BlElementAddedToSceneGraphEvent. BlElementRemovedFromSceneGraphEvent . ToElementLookEvent }
^ { ToThemeChangedEvent. BlElementAddedToSceneGraphEvent. BlElementRemovedFromSceneGraphEvent . ToElementLookEvent }
]

{ #category : #accessing }
Expand Down

0 comments on commit a3bcbf2

Please sign in to comment.