diff --git a/Diya/Diya2DNode.class.st b/Diya/Diya2DNode.class.st index 5c6c828..7e001ca 100644 --- a/Diya/Diya2DNode.class.st +++ b/Diya/Diya2DNode.class.st @@ -45,7 +45,7 @@ Diya2DNode >> initialize [ vbuffer := nil. ] -{ #category : #'as yet unclassified' } +{ #category : #accessing } Diya2DNode >> inner: aPoint [ ^ self boundingBox containsPoint: (self local: aPoint) ] @@ -57,7 +57,7 @@ Diya2DNode >> local: aPoint [ ] -{ #category : #'as yet unclassified' } +{ #category : #accessing } Diya2DNode >> recFromBuffer [ |maxX maxY minX minY x y| maxX := minX := vbuffer at: 1. diff --git a/Diya/DiyaButton.class.st b/Diya/DiyaButton.class.st index 6a523b8..801fc19 100644 --- a/Diya/DiyaButton.class.st +++ b/Diya/DiyaButton.class.st @@ -14,9 +14,9 @@ DiyaButton class >> text: string [ ] { #category : #accessing } -DiyaButton >> icon: id [ - label icon: id. - label updateLayout. +DiyaButton >> icon: ico [ + label icon: ico. + label setDirty. ] { #category : #accessing } @@ -48,8 +48,9 @@ DiyaButton >> text: string [ ] { #category : #accessing } -DiyaButton >> updateLayout [ +DiyaButton >> update [ rec extent: self extent. label position: 0@0. label extent: self extent. + ^true ] diff --git a/Diya/DiyaLabel.class.st b/Diya/DiyaLabel.class.st index 4186f02..98e5bfa 100644 --- a/Diya/DiyaLabel.class.st +++ b/Diya/DiyaLabel.class.st @@ -79,7 +79,7 @@ DiyaLabel >> txt: anObject [ ] { #category : #accessing } -DiyaLabel >> updateLayout [ +DiyaLabel >> update [ |offset isize align| offset := 0. icon ifNotNil: [ @@ -96,5 +96,6 @@ DiyaLabel >> updateLayout [ icon ifNil: [ ^self ]. "{ offset. txt extent. txt maxLineWidth. align } inspect." icon position: (align @( (self extent y - self iconSize ) >> 1)). + ^ true ] diff --git a/Diya/DiyaNode.class.st b/Diya/DiyaNode.class.st index 0ea40b5..99771c0 100644 --- a/Diya/DiyaNode.class.st +++ b/Diya/DiyaNode.class.st @@ -89,7 +89,7 @@ DiyaNode >> initialize [ id := Random new nextInt: 1e6 ] -{ #category : #'as yet unclassified' } +{ #category : #accessing } DiyaNode >> inner: aPoint [ ^ self subclassResponsibility ] @@ -140,7 +140,7 @@ DiyaNode >> register: aBlock to: eventName [ DiyaNode >> render [ dirty ifTrue:[ dirty := self update not]. - shader ifNotNil: [ self setUpShader ]. + shader ifNotNil: [self setUpShader]. self draw. children ifNil: [ ^self ]. children do: [:c | c render ]. @@ -178,6 +178,16 @@ DiyaNode >> scale: anObject [ self updateTF. ] +{ #category : #initialization } +DiyaNode >> setClean [ + dirty := false +] + +{ #category : #initialization } +DiyaNode >> setDirty [ + dirty := true +] + { #category : #accessing } DiyaNode >> setUpShader [ |mem| @@ -227,7 +237,7 @@ DiyaNode >> tf [ ^ tf ] -{ #category : #'as yet unclassified' } +{ #category : #'event handling' } DiyaNode >> trigger: evt [ evt enable ifFalse:[^self]. ehandlers at: evt mapped type ifPresent:[:handler| handler value: evt]. diff --git a/Diya/DiyaTableLayout.class.st b/Diya/DiyaTableLayout.class.st index a7ff5de..809c220 100644 --- a/Diya/DiyaTableLayout.class.st +++ b/Diya/DiyaTableLayout.class.st @@ -1,5 +1,5 @@ Class { #name : #DiyaTableLayout, - #superclass : #DiyaWidget, + #superclass : #DiyaLayout, #category : #'Diya-Widgets' } diff --git a/Diya/DiyaWidget.class.st b/Diya/DiyaWidget.class.st index 9f1729d..9b9a6a7 100644 --- a/Diya/DiyaWidget.class.st +++ b/Diya/DiyaWidget.class.st @@ -43,14 +43,3 @@ DiyaWidget >> extent: size [ DiyaWidget >> initialize [ super initialize. ] - -{ #category : #accessing } -DiyaWidget >> update [ - self updateLayout. - ^ true -] - -{ #category : #accessing } -DiyaWidget >> updateLayout [ - self subclassResponsibility -]