diff --git a/src/Toplo-LookAndFeel/ToTheme.class.st b/src/Toplo-LookAndFeel/ToTheme.class.st index 58fd9e8c5..e09b39782 100644 --- a/src/Toplo-LookAndFeel/ToTheme.class.st +++ b/src/Toplo-LookAndFeel/ToTheme.class.st @@ -317,12 +317,25 @@ ToTheme >> controlHeightSM [ ] { #category : #border } -ToTheme >> dashed [ +ToTheme >> dashArray [ "dashed rendering equivalent in web UI" ^ #( 3 3 ) ] +{ #category : #border } +ToTheme >> dashed [ + "dashed rendering equivalent in web UI" + + + self + deprecated: 'Please use dashArray instead.' + transformWith: '`@receiver dashed' + -> '`@receiver dashArray'. + + ^ self dashArray +] + { #category : #settings } ToTheme >> defaultColorPrimary [ diff --git a/src/Toplo/ToBackgroundLook.class.st b/src/Toplo/ToBackgroundLook.class.st index 45b4cf248..134c653fd 100644 --- a/src/Toplo/ToBackgroundLook.class.st +++ b/src/Toplo/ToBackgroundLook.class.st @@ -16,9 +16,9 @@ ToBackgroundLook >> hoverBg [ ] { #category : #accessing } -ToBackgroundLook >> hoverBg: aBackground [ +ToBackgroundLook >> hoverBg: aValuable [ - hoverBg := aBackground + hoverBg := aValuable ] { #category : #'event handling' } @@ -36,9 +36,9 @@ ToBackgroundLook >> initialBg [ ] { #category : #accessing } -ToBackgroundLook >> initialBg: anObject [ +ToBackgroundLook >> initialBg: aValuable [ - initialBg := anObject + initialBg := aValuable ] { #category : #'event handling' } @@ -56,9 +56,9 @@ ToBackgroundLook >> pressedBg [ ] { #category : #accessing } -ToBackgroundLook >> pressedBg: aBackground [ +ToBackgroundLook >> pressedBg: aValuable [ - pressedBg := aBackground + pressedBg := aValuable ] { #category : #'event handling' } diff --git a/src/Toplo/ToBorderLook.class.st b/src/Toplo/ToBorderLook.class.st index 0480c6b09..6dcb3c85c 100644 --- a/src/Toplo/ToBorderLook.class.st +++ b/src/Toplo/ToBorderLook.class.st @@ -5,7 +5,9 @@ Class { 'builder', 'pressedPaint', 'hoverPaint', - 'initialPaint' + 'initialPaint', + 'width', + 'dashArray' ], #category : #'Toplo-Core-Theme-Looks' } @@ -41,9 +43,15 @@ ToBorderLook >> clickLookEvent: anEvent [ ] { #category : #accessing } -ToBorderLook >> dashArray: anArray [ +ToBorderLook >> dashArray [ - self builder dashArray: anArray + ^ dashArray +] + +{ #category : #accessing } +ToBorderLook >> dashArray: aValuable [ + + dashArray := aValuable ] { #category : #initialization } @@ -64,9 +72,9 @@ ToBorderLook >> hoverPaint [ ] { #category : #accessing } -ToBorderLook >> hoverPaint: aPaint [ +ToBorderLook >> hoverPaint: aValuable [ - hoverPaint := aPaint + hoverPaint := aValuable ] { #category : #'event handling' } @@ -76,6 +84,8 @@ ToBorderLook >> hoveredLookEvent: anEvent [ self hoverPaint ifNil: [ ^ self ]. anEvent elementDo: [ :e | e border: (self builder + dashArray: (self dashArray value: e); + width: (self width value: e); paint: (self hoverPaint value: e); build) ] ] @@ -87,6 +97,8 @@ ToBorderLook >> initialLookEvent: anEvent [ self initialPaint ifNil: [ ^ self ]. anEvent elementDo: [ :e | e border: (self builder + dashArray: (self dashArray value: e); + width: (self width value: e); paint: (self initialPaint value: e); build) ] ] @@ -98,16 +110,18 @@ ToBorderLook >> initialPaint [ ] { #category : #accessing } -ToBorderLook >> initialPaint: aPaint [ +ToBorderLook >> initialPaint: aValuable [ - initialPaint := aPaint + initialPaint := aValuable ] { #category : #initialization } ToBorderLook >> initialize [ super initialize. - builder := self defaultBuilder + builder := self defaultBuilder. + dashArray := [ :e | #() ]. + width := [ :e | 0 ] ] { #category : #'event handling' } @@ -117,6 +131,8 @@ ToBorderLook >> pressedLookEvent: anEvent [ self pressedPaint ifNil: [ ^ self ]. anEvent elementDo: [ :e | e border: (self builder + dashArray: (self dashArray value: e); + width: (self width value: e); paint: (self pressedPaint value: e); build) ] ] @@ -128,13 +144,19 @@ ToBorderLook >> pressedPaint [ ] { #category : #accessing } -ToBorderLook >> pressedPaint: aPaint [ +ToBorderLook >> pressedPaint: aValuable [ - pressedPaint := aPaint + pressedPaint := aValuable ] { #category : #accessing } -ToBorderLook >> width: aNumber [ +ToBorderLook >> width [ - self builder width: aNumber + ^ width +] + +{ #category : #accessing } +ToBorderLook >> width: aValuable [ + + width := aValuable ] diff --git a/src/Toplo/ToButtonDefaultType.class.st b/src/Toplo/ToButtonDefaultType.class.st index 864197126..f9d1739d6 100644 --- a/src/Toplo/ToButtonDefaultType.class.st +++ b/src/Toplo/ToButtonDefaultType.class.st @@ -12,19 +12,20 @@ ToButtonDefaultType >> borderLookIn: anElement [ | borderLook | borderLook := ToBorderLook new. - self dashed ifTrue: [ borderLook dashArray: anElement toTheme dashed ]. + self dashed ifTrue: [ + borderLook dashArray: [ :e | e toTheme dashArray ] ]. self danger ifTrue: [ borderLook - initialPaint: [ :e | e toTheme colorError]; - hoverPaint: [ :e | e toTheme colorErrorHover]; - pressedPaint: [ :e | e toTheme colorErrorHover darker] ] + initialPaint: [ :e | e toTheme colorError ]; + hoverPaint: [ :e | e toTheme colorErrorHover ]; + pressedPaint: [ :e | e toTheme colorErrorHover darker ] ] ifFalse: [ borderLook - initialPaint: [ :e | e toTheme colorBorder]; - hoverPaint: [ :e | e toTheme colorPrimaryHover]; + initialPaint: [ :e | e toTheme colorBorder ]; + hoverPaint: [ :e | e toTheme colorPrimaryHover ]; pressedPaint: [ :e | e toTheme colorPrimaryPressed ] ]. - borderLook width: anElement toTheme lineWidth. + borderLook width: [ :e | e toTheme lineWidth ]. ^ borderLook ] @@ -46,9 +47,9 @@ ToButtonDefaultType >> regularFormLookIn: anElement [ | formLook | formLook := ToImageFormLook new. formLook - initialColor: anElement toTheme colorText; - hoverColor: anElement toTheme colorPrimary; - pressedColor: anElement toTheme colorPrimaryPressed. + initialColor: [ :e | e toTheme colorText]; + hoverColor: [ :e | e toTheme colorPrimary]; + pressedColor: [ :e | e toTheme colorPrimaryPressed]. ^ formLook ] diff --git a/src/Toplo/ToButtonLinkType.class.st b/src/Toplo/ToButtonLinkType.class.st index 789041032..853486839 100644 --- a/src/Toplo/ToButtonLinkType.class.st +++ b/src/Toplo/ToButtonLinkType.class.st @@ -10,9 +10,9 @@ ToButtonLinkType >> regularFormLookIn: anElement [ | formLook | formLook := ToImageFormLook new. formLook - initialColor: anElement toTheme colorLink; - hoverColor: anElement toTheme colorLinkHover; - pressedColor: anElement toTheme colorPrimaryPressed. + initialColor: [ :e | e toTheme colorLink]; + hoverColor: [ :e | e toTheme colorLinkHover]; + pressedColor: [ :e | e toTheme colorPrimaryPressed]. ^ formLook ] diff --git a/src/Toplo/ToButtonPrimaryType.class.st b/src/Toplo/ToButtonPrimaryType.class.st index 36b55ad4d..bc79823be 100644 --- a/src/Toplo/ToButtonPrimaryType.class.st +++ b/src/Toplo/ToButtonPrimaryType.class.st @@ -38,7 +38,7 @@ ToButtonPrimaryType >> labelLookIn: anElement [ ToButtonPrimaryType >> regularFormLookIn: anElement [ ^ ToImageFormLook new - initialColor: anElement toTheme colorImageLightSolid; + initialColor: [ :e | e toTheme colorImageLightSolid ]; yourself ] diff --git a/src/Toplo/ToButtonTextType.class.st b/src/Toplo/ToButtonTextType.class.st index b52756f4f..dfe43b3bc 100644 --- a/src/Toplo/ToButtonTextType.class.st +++ b/src/Toplo/ToButtonTextType.class.st @@ -28,9 +28,9 @@ ToButtonTextType >> regularFormLookIn: anElement [ | formLook | formLook := ToImageFormLook new. formLook - initialColor: anElement toTheme colorText; - hoverColor: anElement toTheme colorText; - pressedColor: anElement toTheme colorText. + initialColor: [ :e | e toTheme colorText]; + hoverColor: [ :e | e toTheme colorText]; + pressedColor: [ :e | e toTheme colorText]. ^ formLook ] diff --git a/src/Toplo/ToButtonType.class.st b/src/Toplo/ToButtonType.class.st index c6a8200f5..0d5026257 100644 --- a/src/Toplo/ToButtonType.class.st +++ b/src/Toplo/ToButtonType.class.st @@ -37,9 +37,9 @@ ToButtonType >> dangerFormLookIn: anElement [ | formLook | formLook := ToImageFormLook new. formLook - initialColor: anElement toTheme colorError; - hoverColor: anElement toTheme colorErrorHover; - pressedColor: anElement toTheme colorError darker. + initialColor: [ :e | e toTheme colorError]; + hoverColor: [ :e | e toTheme colorErrorHover]; + pressedColor: [ :e | e toTheme colorError darker]. ^ formLook ] diff --git a/src/Toplo/ToCheckboxImageSkin.class.st b/src/Toplo/ToCheckboxImageSkin.class.st index 0068d78c3..f234c4a95 100644 --- a/src/Toplo/ToCheckboxImageSkin.class.st +++ b/src/Toplo/ToCheckboxImageSkin.class.st @@ -14,7 +14,7 @@ ToCheckboxImageSkin >> onSkinInstalledIn: anElement [ initialPaint: [ :e | e toTheme colorBorder]; hoverPaint: [ :e | e toTheme colorPrimaryHover]; pressedPaint: [ :e | e toTheme colorPrimaryPressed]; - width: 1. + width: [ :e | e toTheme lineWidth ]. self addLook: borderLook. diff --git a/src/Toplo/ToImageFormLook.class.st b/src/Toplo/ToImageFormLook.class.st index 59e779bfd..c70d9953e 100644 --- a/src/Toplo/ToImageFormLook.class.st +++ b/src/Toplo/ToImageFormLook.class.st @@ -27,9 +27,9 @@ ToImageFormLook >> hoverColor [ ] { #category : #accessing } -ToImageFormLook >> hoverColor: aColor [ +ToImageFormLook >> hoverColor: aValuable [ - hoverColor := aColor + hoverColor := aValuable ] { #category : #'event handling' } @@ -38,7 +38,7 @@ ToImageFormLook >> hoveredLookEvent: anEvent [ super hoveredLookEvent: anEvent. self hoverColor ifNil: [ ^ self ]. anEvent elementDo: [ :e | - self adaptForegroundIn: e withColor: self hoverColor ] + self adaptForegroundIn: e withColor: (self hoverColor value: e) ] ] { #category : #accessing } @@ -48,9 +48,9 @@ ToImageFormLook >> initialColor [ ] { #category : #accessing } -ToImageFormLook >> initialColor: aColor [ +ToImageFormLook >> initialColor: aValuable [ - initialColor := aColor + initialColor := aValuable ] { #category : #'event handling' } @@ -59,7 +59,7 @@ ToImageFormLook >> initialLookEvent: anEvent [ super initialLookEvent: anEvent. self initialColor ifNil: [ ^ self ]. anEvent elementDo: [ :e | - self adaptForegroundIn: e withColor: self initialColor ] + self adaptForegroundIn: e withColor: (self initialColor value: e) ] ] { #category : #accessing } @@ -69,9 +69,9 @@ ToImageFormLook >> pressedColor [ ] { #category : #accessing } -ToImageFormLook >> pressedColor: aColor [ +ToImageFormLook >> pressedColor: aValuable [ - pressedColor := aColor + pressedColor := aValuable ] { #category : #'event handling' } @@ -80,5 +80,5 @@ ToImageFormLook >> pressedLookEvent: anEvent [ super pressedLookEvent: anEvent. self pressedColor ifNil: [ ^ self ]. anEvent elementDo: [ :e | - self adaptForegroundIn: e withColor: self pressedColor ] + self adaptForegroundIn: e withColor: (self pressedColor value: e)] ] diff --git a/src/Toplo/ToRadioImageSkin.class.st b/src/Toplo/ToRadioImageSkin.class.st index d91f8c31b..a1acb02a5 100644 --- a/src/Toplo/ToRadioImageSkin.class.st +++ b/src/Toplo/ToRadioImageSkin.class.st @@ -15,7 +15,7 @@ ToRadioImageSkin >> onSkinInstalledIn: anElement [ initialPaint: [ :e | e toTheme colorBorder]; hoverPaint: [ :e | e toTheme colorPrimaryHover]; pressedPaint: [ :e | e toTheme colorPrimaryPressed]; - width: 1. + width: [ :e | e toTheme lineWidth ]. self addLook: borderLook.