From d2b2e69a5a996bee04d4d663bc4dacf144728c6d Mon Sep 17 00:00:00 2001 From: Oscar Nierstrasz Date: Mon, 2 Sep 2024 18:01:56 +0200 Subject: [PATCH] Renamed GtTitleWithFootersLiveSlide --- .../GtProtoLiveSlide.class.st | 8 +- .../GtTitleWithFooterLiveSlide.class.st | 7 +- ...t => GtTitleWithFootersLiveSlide.class.st} | 83 +++++++++---------- 3 files changed, 47 insertions(+), 51 deletions(-) rename src/GToolkit-Presenter/{GtTitleWithCenteredTextsSlide.class.st => GtTitleWithFootersLiveSlide.class.st} (61%) diff --git a/src/GToolkit-Presenter/GtProtoLiveSlide.class.st b/src/GToolkit-Presenter/GtProtoLiveSlide.class.st index d565e5c5..17b0e2c8 100644 --- a/src/GToolkit-Presenter/GtProtoLiveSlide.class.st +++ b/src/GToolkit-Presenter/GtProtoLiveSlide.class.st @@ -246,14 +246,14 @@ GtProtoLiveSlide >> title [ ] { #category : #decorating } -GtProtoLiveSlide >> titleWithCenteredTexts [ - ^ GtTitleWithCenteredTextsSlide new +GtProtoLiveSlide >> titleWithFooter [ + ^ GtTitleWithFooterLiveSlide new definingMethod: (GtPhlowDefiningMethodsCollector forContext: thisContext) collect ] { #category : #decorating } -GtProtoLiveSlide >> titleWithFooter [ - ^ GtTitleWithFooterLiveSlide new +GtProtoLiveSlide >> titleWithFooters [ + ^ GtTitleWithFootersLiveSlide new definingMethod: (GtPhlowDefiningMethodsCollector forContext: thisContext) collect ] diff --git a/src/GToolkit-Presenter/GtTitleWithFooterLiveSlide.class.st b/src/GToolkit-Presenter/GtTitleWithFooterLiveSlide.class.st index 2a70cd72..a59fccf4 100644 --- a/src/GToolkit-Presenter/GtTitleWithFooterLiveSlide.class.st +++ b/src/GToolkit-Presenter/GtTitleWithFooterLiveSlide.class.st @@ -3,10 +3,7 @@ Superseded by GtTitleWithCenteredTextsSlide. Retain this only for compatibility. " Class { #name : #GtTitleWithFooterLiveSlide, - #superclass : #GtTitleWithCenteredTextsSlide, - #instVars : [ - 'footer' - ], + #superclass : #GtTitleWithFootersLiveSlide, #category : #'GToolkit-Presenter' } @@ -20,5 +17,5 @@ GtTitleWithFooterLiveSlide >> footer: aString [ { #category : #accessing } GtTitleWithFooterLiveSlide >> footerWithFormat: aText [ - self newTextWithFormat: aText + self newFooterWithFormat: aText ] diff --git a/src/GToolkit-Presenter/GtTitleWithCenteredTextsSlide.class.st b/src/GToolkit-Presenter/GtTitleWithFootersLiveSlide.class.st similarity index 61% rename from src/GToolkit-Presenter/GtTitleWithCenteredTextsSlide.class.st rename to src/GToolkit-Presenter/GtTitleWithFootersLiveSlide.class.st index 22c8528b..a515b473 100644 --- a/src/GToolkit-Presenter/GtTitleWithCenteredTextsSlide.class.st +++ b/src/GToolkit-Presenter/GtTitleWithFootersLiveSlide.class.st @@ -2,19 +2,18 @@ Like a title slide but with as many centred texts below as you like. " Class { - #name : #GtTitleWithCenteredTextsSlide, + #name : #GtTitleWithFootersLiveSlide, #superclass : #GtTitleLiveSlide, #instVars : [ - 'texts', - 'textMargin', 'subtitleBottomPadding', - 'textBottomPadding' + 'footers', + 'footerBottomPadding' ], #category : #'GToolkit-Presenter' } { #category : #'api - instantiation' } -GtTitleWithCenteredTextsSlide >> create [ +GtTitleWithFootersLiveSlide >> create [ | container textContainer | container := BlElement new constraintsDo: [ :c | @@ -42,79 +41,79 @@ GtTitleWithCenteredTextsSlide >> create [ top: 40; bottom: self subtitleBottomPadding); text: subtitle) ]. - texts + footers do: [ :aText | textContainer addChild: (BlTextElement new constraintsDo: [ :c | c linear horizontal alignCenter ]; padding: (BlInsets top: 40; - bottom: self textBottomPadding); + bottom: self footerBottomPadding); text: aText) ]. container addChild: textContainer. ^ container ] { #category : #initialization } -GtTitleWithCenteredTextsSlide >> defaultSubtitleBottomPadding [ - ^ 40 +GtTitleWithFootersLiveSlide >> defaultFooterBottomPadding [ + ^ 10 ] { #category : #initialization } -GtTitleWithCenteredTextsSlide >> defaultTextBottomPadding [ - ^ 10 +GtTitleWithFootersLiveSlide >> defaultSubtitleBottomPadding [ + ^ 40 ] -{ #category : #acccessing } -GtTitleWithCenteredTextsSlide >> defaultTextMargin [ - ^ 50 +{ #category : #accessing } +GtTitleWithFootersLiveSlide >> footerBottomPadding [ + ^ footerBottomPadding +] + +{ #category : #accessing } +GtTitleWithFootersLiveSlide >> footerBottomPadding: anObject [ + footerBottomPadding := anObject ] { #category : #initialization } -GtTitleWithCenteredTextsSlide >> initialize [ +GtTitleWithFootersLiveSlide >> initialize [ super initialize. self subtitleBottomPadding: self defaultSubtitleBottomPadding. - self textBottomPadding: self defaultTextBottomPadding. - self textMargin: self defaultTextMargin. - texts := OrderedCollection new + self footerBottomPadding: self defaultFooterBottomPadding. + footers := OrderedCollection new ] { #category : #acccessing } -GtTitleWithCenteredTextsSlide >> newText: aRopedText [ - self newTextWithFormat: (aRopedText asRopedText glamorousRegularFont; fontSize: 20) +GtTitleWithFootersLiveSlide >> newFooter: aRopedText [ + self + newFooterWithFormat: (aRopedText asRopedText + glamorousRegularFont; + fontSize: 20) ] { #category : #acccessing } -GtTitleWithCenteredTextsSlide >> newTextWithFormat: aRopedText [ - texts add: aRopedText asRopedText +GtTitleWithFootersLiveSlide >> newFooterWithFormat: aRopedText [ + footers add: aRopedText asRopedText ] -{ #category : #accessing } -GtTitleWithCenteredTextsSlide >> subtitleBottomPadding [ - ^ subtitleBottomPadding +{ #category : #acccessing } +GtTitleWithFootersLiveSlide >> newText: aRopedText [ + self deprecated: 'use newFooter:'. + + self newTextWithFormat: (aRopedText asRopedText glamorousRegularFont; fontSize: 20) ] -{ #category : #accessing } -GtTitleWithCenteredTextsSlide >> subtitleBottomPadding: anObject [ - subtitleBottomPadding := anObject +{ #category : #acccessing } +GtTitleWithFootersLiveSlide >> newTextWithFormat: aRopedText [ +self deprecated: 'use newFooterWithFormat:'. + footers add: aRopedText asRopedText ] { #category : #accessing } -GtTitleWithCenteredTextsSlide >> textBottomPadding [ - ^ textBottomPadding +GtTitleWithFootersLiveSlide >> subtitleBottomPadding [ + ^ subtitleBottomPadding ] { #category : #accessing } -GtTitleWithCenteredTextsSlide >> textBottomPadding: anObject [ - textBottomPadding := anObject -] - -{ #category : #acccessing } -GtTitleWithCenteredTextsSlide >> textMargin [ - ^ textMargin -] - -{ #category : #acccessing } -GtTitleWithCenteredTextsSlide >> textMargin: aNumber [ - textMargin := aNumber +GtTitleWithFootersLiveSlide >> subtitleBottomPadding: anObject [ + subtitleBottomPadding := anObject ]