# HG changeset patch # User Claus Gittinger # Date 1256135072 -7200 # Node ID aa7dd2f074004c1250ed31a84f165d3897da6e74 # Parent f605cc13731eb122cd61f3cb0671a80c74c66c36 computeLabelSize refactorings diff -r f605cc13731e -r aa7dd2f07400 Button.st --- a/Button.st Wed Oct 21 16:24:31 2009 +0200 +++ b/Button.st Wed Oct 21 16:24:32 2009 +0200 @@ -1947,23 +1947,35 @@ "Modified: / 9.9.1998 / 20:22:01 / cg" ! -computeLabelSize - "compute the extent needed to hold the label (plus the return form)" - - super computeLabelSize. - ((isReturnButton or:[defaultable]) and:[shadowForm notNil]) ifTrue:[ - labelWidth := labelWidth + (hSpace * 2) + shadowForm width. - labelHeight := labelHeight max: (shadowForm height "+ vSpace") - ] - - "Modified: / 3.11.1997 / 09:15:52 / cg" -! - getLabelFromLabelChannel passiveLogo := labelChannel value. super getLabelFromLabelChannel. ! +rawLabelSizeOf:aLogo + "compute the extent needed to hold the label (plus the return form)" + + |ext| + + ext := super rawLabelSizeOf:aLogo. + + (activeLogo notNil and:[activeLogo ~~ logo]) ifTrue:[ + ext := ext max:(super rawLabelSizeOf:activeLogo). + ]. + (passiveLogo notNil and:[passiveLogo ~~ logo]) ifTrue:[ + ext := ext max:(super rawLabelSizeOf:passiveLogo). + ]. + + ((isReturnButton or:[defaultable]) and:[shadowForm notNil]) ifTrue:[ + ^ (ext x + (hSpace * 2) + shadowForm width) + @ + (ext y max: (shadowForm height "+ vSpace")) + ]. + ^ ext + + "Modified: / 3.11.1997 / 09:15:52 / cg" +! + shiftLabelWhenPressed ^ self class == Button ! ! @@ -2356,5 +2368,9 @@ !Button class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg/Button.st,v 1.144 2009-09-18 12:43:37 cg Exp $' + ^ '$Header: /cvs/stx/stx/libwidg/Button.st,v 1.145 2009-10-21 14:24:32 cg Exp $' +! + +version_CVS + ^ '$Header: /cvs/stx/stx/libwidg/Button.st,v 1.145 2009-10-21 14:24:32 cg Exp $' ! !