[squeak-dev] The Trunk: Morphic-ar.165.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] The Trunk: Morphic-ar.165.mcz

commits-2
Andreas Raab uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ar.165.mcz

==================== Summary ====================

Name: Morphic-ar.165
Author: ar
Time: 31 August 2009, 8:14:46 am
UUID: 2f9b8fc0-01c7-6942-98bd-ce0775a45e9f
Ancestors: Morphic-ar.164

Disable style choices in the font chooser dialog for now since its users don't expect the font to be emphasized already. This will need more work and is too confusing at this point (and too easy to break).

=============== Diff against Morphic-ar.164 ===============

Item was changed:
  ----- Method: FontChooserTool>>buildWith: (in category 'toolbuilder') -----
  buildWith: builder
  "Create the ui for the browser"
  "ToolBuilder open: self"
  | windowSpec |
+ self offerStyleList ifTrue:[
+ windowSpec := self buildWindowWith: builder specs: {
+ (0@0 corner: 0.4@0.4) -> [self buildFontListWith: builder].
+ (0.4@0 corner: 0.8@0.4) -> [self buildStyleListWith: builder].
+ (0.8@0 corner: 1.0@0.4) -> [self buildPointSizeListWith: builder].
+ (0.0@0.4 corner: 1.0@0.88) -> [self buildPreviewPaneWith: builder].
+ (0.0@0.88 corner: 1@1) -> [self buildButtonBarWith: builder].
+ }.
+ ] ifFalse:[
+ windowSpec := self buildWindowWith: builder specs: {
+ (0@0 corner: 0.7@0.4) -> [self buildFontListWith: builder].
+ " (0.4@0 corner: 0.8@0.4) -> [self buildStyleListWith: builder]."
+ (0.7@0 corner: 1.0@0.4) -> [self buildPointSizeListWith: builder].
+ (0.0@0.4 corner: 1.0@0.8) -> [self buildPreviewPaneWith: builder].
+ (0.0@0.8 corner: 1@1) -> [self buildButtonBarWith: builder].
+ }.
+ ].
+ windowSpec extent: self initialExtent.
- windowSpec := self buildWindowWith: builder specs: {
- (0@0 corner: 0.4@0.4) -> [self buildFontListWith: builder].
- (0.4@0 corner: 0.8@0.4) -> [self buildStyleListWith: builder].
- (0.8@0 corner: 1.0@0.4) -> [self buildPointSizeListWith: builder].
- (0.0@0.4 corner: 1.0@0.88) -> [self buildPreviewPaneWith: builder].
- (0.0@0.88 corner: 1@1) -> [self buildButtonBarWith: builder].
- }.
- windowSpec extent: 400@300.
  window := builder build: windowSpec.
+ "Yes, that's a hack. But it looks ugly with line breaks."
+ (builder widgetAt: #preview) textMorph wrapFlag: false.
  ^window!

Item was added:
+ ----- Method: FontChooserTool>>offerStyleList (in category 'initialize') -----
+ offerStyleList
+ "Whether to offer a choice of styles with the font.
+ Currently disabled since most of the text machinery doesn't like emphasis
+ already being applied to the font. Would have to decompose font/emphasis
+ in order for that to work."
+ ^false!

Item was changed:
  ----- Method: FontChooserTool>>contents (in category 'toolbuilder') -----
  contents
  | sample i c f |
  sample := WriteStream on: ''.
  f := self selectedFont ifNil:[^Text new].
  f isSymbolFont ifFalse:[
  sample
  nextPutAll: 'the quick brown fox jumps over the lazy dog' ;cr;
  nextPutAll:  'THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.' ;cr;cr;
  nextPutAll: '0123456789'; cr; cr;
+ nextPutAll:
+ 'Lorem ipsum dolor sit amet, consectetur adipisicing elit,
+ sed do eiusmod tempor incididunt ut labore et dolore
+ magna aliqua. Ut enim ad minim veniam, quis nostrud
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo
+ consequat. Duis aute irure dolor in reprehenderit in voluptate
+ velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
+ sint occaecat cupidatat non proident, sunt in culpa qui
+ officia deserunt mollit anim id est laborum.';
- nextPutAll: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
  yourself.
  ] ifTrue:[
  i := 0.
  33 to: 255 do:[:ci |
  sample nextPut: (c:=Character value: ci).
  i := i + 1.
  (('@Z`z' includes:c) or:[i = 30])
  ifTrue:[i :=0. sample cr]].
  ].
  sample := sample contents asText.
  sample addAttribute: (TextFontReference toFont: f).
  ^sample!

Item was changed:
  ----- Method: FontChooserTool>>buildPreviewPaneWith: (in category 'toolbuilder') -----
  buildPreviewPaneWith: builder
  "Build the preview panel"
  | textSpec |
  textSpec := builder pluggableTextSpec new.
  textSpec
+ name: #preview;
  model: self;
  getText: #contents.
  ^textSpec!

Item was changed:
  ----- Method: FontChooserTool>>initialExtent (in category 'initialize') -----
  initialExtent
+ ^self offerStyleList ifTrue:[400@300] ifFalse:[300@200].!
- ^400@300!