Skip to content

Commit

Permalink
Passivate on minimize.
Browse files Browse the repository at this point in the history
Fix protocol.
Fix close script
  • Loading branch information
Nyan11 committed Nov 5, 2023
1 parent 93e26bd commit 5938aff
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ MolGeoButtonElementAbstract >> defaultFontSize [
^ 16
]

{ #category : #'as yet unclassified' }
{ #category : #'accessing - colors' }
MolGeoButtonElementAbstract >> hoverColor [

^ self shouldBeImplemented
Expand Down Expand Up @@ -322,13 +322,13 @@ MolGeoButtonElementAbstract >> makeNewLabelElement: aString [
^ rope asElement
]

{ #category : #'as yet unclassified' }
{ #category : #'accessing - colors' }
MolGeoButtonElementAbstract >> primaryColor [

^ self shouldBeImplemented
]

{ #category : #'as yet unclassified' }
{ #category : #'accessing - colors' }
MolGeoButtonElementAbstract >> secondaryColor [

^ self shouldBeImplemented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ MolGeoButtonElementNotSelected class >> example [
openInNewSpace
]

{ #category : #'as yet unclassified' }
{ #category : #'accessing - colors' }
MolGeoButtonElementNotSelected >> hoverColor [

^ Color fromHexString: '#bebdbf'
]

{ #category : #'as yet unclassified' }
{ #category : #'accessing - colors' }
MolGeoButtonElementNotSelected >> primaryColor [

^ Color fromHexString: '#6c757d'
]

{ #category : #'as yet unclassified' }
{ #category : #'accessing - colors' }
MolGeoButtonElementNotSelected >> secondaryColor [

^ Color transparent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ MolGeoButtonElementSelected class >> example [
openInNewSpace
]

{ #category : #'as yet unclassified' }
{ #category : #'accessing - colors' }
MolGeoButtonElementSelected >> hoverColor [

^ Color fromHexString: '#78A7D6'
]

{ #category : #accessing }
{ #category : #'accessing - text' }
MolGeoButtonElementSelected >> makeNewLabelElement: aString [

| rope |
Expand All @@ -31,13 +31,13 @@ MolGeoButtonElementSelected >> makeNewLabelElement: aString [
^ rope asElement
]

{ #category : #'as yet unclassified' }
{ #category : #'accessing - colors' }
MolGeoButtonElementSelected >> primaryColor [

^ Color fromHexString: '#0D3151'
]

{ #category : #'as yet unclassified' }
{ #category : #'accessing - colors' }
MolGeoButtonElementSelected >> secondaryColor [

^ Color fromHexString: '#8DBEF1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ MolGeoConnectedSwitchesElement class >> example [
openInNewSpace
]

{ #category : #accessing }
{ #category : #control }
MolGeoConnectedSwitchesElement >> deactivateAllSwitchesExcept: aMolGeoSwitchElement [

self switches do: [ :each | aMolGeoSwitchElement = each ifFalse: [ each state: false ] ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Class {

{ #category : #'instance creation' }
MolGeoPosApplication class >> close [
<script>

<script>
| current |
current := MolUtils instanceOf: self class.
current ifNotNil:[ current space close ].
current := MolUtils instanceOf: MolGeoPosMapReceiver.
current ifNotNil: [ current space close ].

"Clean previous opened version if necessary"
MolComponentManager cleanUp.
MolComponentManager cleanUp
]

{ #category : #'instance creation' }
Expand All @@ -30,6 +30,12 @@ MolGeoPosApplication class >> open [
^ self new openApplication
]

{ #category : #'component control' }
MolGeoPosApplication >> activateMapComponent [

self mapComponent componentActivate
]

{ #category : #private }
MolGeoPosApplication >> iconSize [

Expand Down Expand Up @@ -138,6 +144,13 @@ MolGeoPosApplication >> makeWiFiButton [
yourself
]

{ #category : #private }
MolGeoPosApplication >> mapComponent [

^ MolComponentManager default locatorServices searchComponentTypeImplementorFor:
MolGeoPosReceiverType
]

{ #category : #private }
MolGeoPosApplication >> mapForm [

Expand All @@ -160,9 +173,20 @@ MolGeoPosApplication >> openApplication [

space root addChild: self.

"When space close, we remove the components"
space
when: BlSpaceClosedEvent
do: [ :evt | MolComponentManager cleanUp ].
do: [ :evt | self removeComponents ].

"When space minimize, we passivate the map component"
space
when: BlSpaceResizedEvent
do: [ :evt | self passivateMapComponent ].

"When space focus in (resize), we activate the map component"
space
when: BlSpaceFocusInEvent
do: [ :evt | self activateMapComponent ].

space enqueueTask: (BlTaskAction new
action: [ space center ];
Expand All @@ -174,6 +198,18 @@ MolGeoPosApplication >> openApplication [
space show
]

{ #category : #'component control' }
MolGeoPosApplication >> passivateMapComponent [

self mapComponent passivateComponent
]

{ #category : #'component control' }
MolGeoPosApplication >> removeComponents [

MolComponentManager cleanUp
]

{ #category : #private }
MolGeoPosApplication >> stopGeoPosEquipement [
"stops every possible component if it's launched"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ MolGeoPosMapReceiver class >> pystonSpec [
]'
]

{ #category : #'as yet unclassified' }
{ #category : #'background - image' }
MolGeoPosMapReceiver >> backgroundForm: aForm [

(self childWithId: #map) background: aForm.
Expand Down

0 comments on commit 5938aff

Please sign in to comment.