Skip to content

Commit

Permalink
Map component is paused when window is minimize.
Browse files Browse the repository at this point in the history
Add missing protocols
  • Loading branch information
Nyan11 committed Nov 5, 2023
1 parent 5a788fe commit e8c7ea3
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 37 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 @@ -15,7 +15,17 @@ MolGeoPosApplication class >> open [
^ self new openApplication
]

{ #category : #'as yet unclassified' }
{ #category : #accessing }
MolGeoPosApplication >> getMapComponent [

| manager |
manager := MolComponentManager default.

^ manager locatorServices searchComponentTypeImplementorFor:
MolGeoPosReceiverType
]

{ #category : #'accessing - resources' }
MolGeoPosApplication >> iconSize [

^ 28 @ 28
Expand All @@ -25,7 +35,8 @@ MolGeoPosApplication >> iconSize [
MolGeoPosApplication >> initialize [

super initialize.
map := self makeAndStartMapComponent.
MolGeoPositionMapReicever start.
map := self makeMapComponent.
menu := self makeComponentsSelectionMenu.
self addChildren: {
map.
Expand All @@ -36,18 +47,7 @@ MolGeoPosApplication >> initialize [
c horizontal fitContent ]
]

{ #category : #'as yet unclassified' }
MolGeoPosApplication >> makeAndStartMapComponent [

| mapElement |
MolGeoPositionMapReicever start.
mapElement := MolUtils instanceOf: MolGeoPositionMapReicever.
mapElement backgroundForm: self mapForm.
mapElement margin: (BlInsets bottom: 16).
^ mapElement
]

{ #category : #'as yet unclassified' }
{ #category : #factory }
MolGeoPosApplication >> makeComponentsSelectionMenu [

| galileo gps gpsInacurate gsm wifi |
Expand All @@ -66,7 +66,7 @@ MolGeoPosApplication >> makeComponentsSelectionMenu [
yourself
]

{ #category : #'as yet unclassified' }
{ #category : #factory }
MolGeoPosApplication >> makeGPSButton [

^ MolGeoSwitchElement new
Expand All @@ -78,7 +78,7 @@ MolGeoPosApplication >> makeGPSButton [
yourself
]

{ #category : #'as yet unclassified' }
{ #category : #factory }
MolGeoPosApplication >> makeGPSInaccurateButton [

^ MolGeoSwitchElement new
Expand All @@ -90,7 +90,7 @@ MolGeoPosApplication >> makeGPSInaccurateButton [
yourself
]

{ #category : #'as yet unclassified' }
{ #category : #factory }
MolGeoPosApplication >> makeGSMButton [

^ MolGeoSwitchElement new
Expand All @@ -102,7 +102,7 @@ MolGeoPosApplication >> makeGSMButton [
yourself
]

{ #category : #'as yet unclassified' }
{ #category : #factory }
MolGeoPosApplication >> makeGalileoButton [

^ MolGeoSwitchElement new
Expand All @@ -114,7 +114,17 @@ MolGeoPosApplication >> makeGalileoButton [
yourself
]

{ #category : #'as yet unclassified' }
{ #category : #factory }
MolGeoPosApplication >> makeMapComponent [

| mapElement |
mapElement := MolUtils instanceOf: MolGeoPositionMapReicever.
mapElement backgroundForm: self mapForm.
mapElement margin: (BlInsets bottom: 16).
^ mapElement
]

{ #category : #factory }
MolGeoPosApplication >> makeWiFiButton [

^ MolGeoSwitchElement new
Expand All @@ -126,19 +136,19 @@ MolGeoPosApplication >> makeWiFiButton [
yourself
]

{ #category : #'as yet unclassified' }
{ #category : #'accessing - resources' }
MolGeoPosApplication >> mapForm [

^ MolGeoRessource map asForm: self maximumMapSize
]

{ #category : #'as yet unclassified' }
{ #category : #'accessing - resources' }
MolGeoPosApplication >> maximumMapSize [

^ 500 @ 500
]

{ #category : #'as yet unclassified' }
{ #category : #control }
MolGeoPosApplication >> openApplication [

| space |
Expand All @@ -148,9 +158,18 @@ MolGeoPosApplication >> openApplication [

space root addChild: self.

"When Space Close : stop all components"
space when: BlSpaceClosedEvent do: [ :evt | self stopAllComponents ].

"When BlSpaceFocusOutEvent : pause all components"
space
when: BlSpaceResizedEvent
do: [ :evt | self pauseMapComponent ].

"When BlSpaceFocusInEvent : unpause all components"
space
when: BlSpaceClosedEvent
do: [ :evt | MolComponentManager cleanUp ].
when: BlSpaceFocusInEvent
do: [ :evt | self unpauseMapComponent ].

space enqueueTask: (BlTaskAction new
action: [ space center ];
Expand All @@ -162,7 +181,19 @@ MolGeoPosApplication >> openApplication [
space show
]

{ #category : #'as yet unclassified' }
{ #category : #control }
MolGeoPosApplication >> pauseMapComponent [

self getMapComponent componentPassivate
]

{ #category : #control }
MolGeoPosApplication >> stopAllComponents [

MolComponentManager cleanUp
]

{ #category : #control }
MolGeoPosApplication >> stopGeoPosEquipement [
"stops every possible component if it's launched"

Expand All @@ -179,3 +210,9 @@ MolGeoPosApplication >> stopGeoPosEquipement [
"One component to stop."
component class stop
]

{ #category : #control }
MolGeoPosApplication >> unpauseMapComponent [

self getMapComponent componentActivate
]
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ MolGeoPositionMapReicever class >> pystonSpec [
]'
]

{ #category : #'as yet unclassified' }
{ #category : #accessing }
MolGeoPositionMapReicever >> backgroundForm: aForm [

(self childWithId: #map) background: aForm.
Expand All @@ -249,10 +249,15 @@ MolGeoPositionMapReicever >> componentActivate [
{ #category : #'life cycle' }
MolGeoPositionMapReicever >> componentPassivate [

self space ifNotNil: [ :s | s close ].
self getMolGeoPosEquipmentEventsSubscriber unsubscribe: self
]

{ #category : #'life cycle' }
MolGeoPositionMapReicever >> componentRemove [

self space ifNotNil: [ :s | s close ].
]

{ #category : #events }
MolGeoPositionMapReicever >> currentPositionChanged: aGeoPosition [

Expand Down

0 comments on commit e8c7ea3

Please sign in to comment.