[squeak-dev] The Trunk: Morphic-mt.1874.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Feb 7 12:10:13 UTC 2022


This looks so much more modern! Thank you! :-)


By the way, Cmd + L is not working in these mini-editors. But this is not a regression.


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Montag, 7. Februar 2022 11:04:15
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: Morphic-mt.1874.mcz

Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1874.mcz

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

Name: Morphic-mt.1874
Author: mt
Time: 7 February 2022, 11:04:09.494414 am
UUID: a70b7bc5-e1e8-a743-9ef9-d1f84ea1315c
Ancestors: Morphic-mt.1873

Fixes visual appearance of mini editor for StringMorph. For example, the one that comes when you SHIFT+Red-click a window title.

Pull up #caretColor(:), #selectionColor(:), and #unfocusedSelectionColor(:) from TextMorphForEditView to TextMorph.

=============== Diff against Morphic-mt.1873 ===============

Item was changed:
  ----- Method: StringMorph>>drawOn: (in category 'drawing') -----
  drawOn: aCanvas

+        | drawBounds |
+        drawBounds := self innerBounds. "within border, no other (layout) inset"
+        drawBounds := drawBounds origin + (0 @ self fontToUse lineGapSliceForMorphs) corner: drawBounds corner.
+
         aCanvas
                 drawString: self contents
+                in: drawBounds
-                in: self innerBounds
                 font: self fontToUse
                 color: self color.!

Item was removed:
- ----- Method: StringMorph>>innerBounds (in category 'geometry - layout') -----
- innerBounds
-        "Overwritten to respect the receiver's font's #lineGap."
-
-        | b |
-        b := super innerBounds.
-        ^ b origin + (0 @ self fontToUse lineGapSliceForMorphs) corner: b corner!

Item was changed:
  ----- Method: StringMorph>>launchMiniEditor: (in category 'editing') -----
  launchMiniEditor: evt

         | textMorph |
         hasFocus := true.  "Really only means edit in progress for this morph"
         textMorph := StringMorphEditor new contentsAsIs: contents.
+        textMorph font: self fontToUse.
+        textMorph color: self color.
+        textMorph innerBounds: self innerBounds.
-        textMorph beAllFont: self fontToUse.
-        textMorph bounds: (self bounds expandBy: 0 at 2).
         self addMorphFront: textMorph.
         evt hand newKeyboardFocus: textMorph.
         textMorph editor selectFrom: 1 to: textMorph paragraph text string size!

Item was removed:
- ----- Method: StringMorphEditor>>drawOn: (in category 'drawing') -----
- drawOn: aCanvas
-
-        aCanvas fillRectangle: self bounds color: Color yellow muchLighter.
-        ^ super drawOn: aCanvas!

Item was changed:
  ----- Method: StringMorphEditor>>initialize (in category 'display') -----
  initialize
         "Initialize the receiver.  Give it a white background"

         super initialize.
+        self setDefaultParameters.!
-        self backgroundColor: Color white.
-        self textColor: Color red.!

Item was added:
+ ----- Method: StringMorphEditor>>setDefaultParameters (in category 'display') -----
+ setDefaultParameters
+        "Based on PluggableTextMorph >> #setDefaultParameters."
+
+        self
+                backgroundColor: ((UserInterfaceTheme current get: #color for: #ScrollPane) ifNil: [Color white]);
+                borderStyle: ((UserInterfaceTheme current get: #borderStyle for: #ScrollPane) ifNil: [BorderStyle simple]) copy;
+                borderColor: ((UserInterfaceTheme current get: #borderColor for: #ScrollPane) ifNil: [Color gray: 0.6]);
+                borderWidth: (((UserInterfaceTheme current get: #borderWidth for: #ScrollPane) ifNil: [1]) * RealEstateAgent scaleFactor) truncated.
+
+        self
+                caretColor: ((UserInterfaceTheme current get: #caretColor for: #PluggableTextMorph) ifNil: [Color red]);
+                selectionColor: ((UserInterfaceTheme current get: #selectionColor for: #PluggableTextMorph) ifNil: [TranslucentColor r: 0.0 g: 0.0 b: 0.8 alpha: 0.2]).
+
+        self setProperty: #indicateKeyboardFocus toValue: #never.!

Item was added:
+ ----- Method: TextMorph>>caretColor (in category 'accessing') -----
+ caretColor
+        ^ self valueOfProperty: #caretColor ifAbsent: [Color red]!

Item was added:
+ ----- Method: TextMorph>>caretColor: (in category 'accessing') -----
+ caretColor: aColor
+        self
+                setProperty: #caretColor
+                toValue: aColor.!

Item was changed:
  ----- Method: TextMorph>>createParagraph (in category 'private') -----
  createParagraph

         self setProperty: #CreatingParagraph toValue: true.

         [
                 self setDefaultContentsIfNil.

                 "...Code here to recreate the paragraph..."
                 paragraph := (self paragraphClass new textOwner: self owner).
                 paragraph wantsColumnBreaks: successor notNil.
                 paragraph
                         compose: text
                         style: textStyle copy
                         from: self startingIndex
                         in: self container.
                 wrapFlag ifFalse:
                         ["Was given huge container at first... now adjust"
                         paragraph adjustRightX].
                 paragraph focused: (self currentHand keyboardFocus == self).
+
+                paragraph
+                        caretColor: self caretColor;
+                        selectionColor: self selectionColor;
+                        unfocusedSelectionColor: self unfocusedSelectionColor.
+
-
                 self fit.
         ] ensure: [self removeProperty: #CreatingParagraph].

         ^ paragraph!

Item was added:
+ ----- Method: TextMorph>>selectionColor (in category 'accessing') -----
+ selectionColor
+        ^ self valueOfProperty: #selectionColor ifAbsent: [Color blue muchLighter]!

Item was added:
+ ----- Method: TextMorph>>selectionColor: (in category 'accessing') -----
+ selectionColor: aColor
+
+        self
+                setProperty: #selectionColor
+                toValue: aColor.!

Item was added:
+ ----- Method: TextMorph>>unfocusedSelectionColor (in category 'accessing') -----
+ unfocusedSelectionColor
+        ^ self valueOfProperty: #unfocusedSelectionColor ifAbsent: [Color blue muchLighter]!

Item was added:
+ ----- Method: TextMorph>>unfocusedSelectionColor: (in category 'accessing') -----
+ unfocusedSelectionColor: aColor
+
+        self
+                setProperty: #unfocusedSelectionColor
+                toValue: aColor.!

Item was removed:
- ----- Method: TextMorphForEditView>>caretColor (in category 'accessing') -----
- caretColor
-        ^ self valueOfProperty: #caretColor ifAbsent: [Color red]!

Item was removed:
- ----- Method: TextMorphForEditView>>caretColor: (in category 'accessing') -----
- caretColor: aColor
-        self
-                setProperty: #caretColor
-                toValue: aColor.!

Item was removed:
- ----- Method: TextMorphForEditView>>createParagraph (in category 'private') -----
- createParagraph
-
-        super createParagraph.
-
-        paragraph
-                caretColor: self caretColor;
-                selectionColor: self selectionColor;
-                unfocusedSelectionColor: self unfocusedSelectionColor.
-
-        ^ paragraph!

Item was removed:
- ----- Method: TextMorphForEditView>>selectionColor (in category 'accessing') -----
- selectionColor
-        ^ self valueOfProperty: #selectionColor ifAbsent: [Color blue muchLighter]!

Item was removed:
- ----- Method: TextMorphForEditView>>selectionColor: (in category 'accessing') -----
- selectionColor: aColor
-
-        self
-                setProperty: #selectionColor
-                toValue: aColor.!

Item was removed:
- ----- Method: TextMorphForEditView>>unfocusedSelectionColor (in category 'accessing') -----
- unfocusedSelectionColor
-        ^ self valueOfProperty: #unfocusedSelectionColor ifAbsent: [Color blue muchLighter]!

Item was removed:
- ----- Method: TextMorphForEditView>>unfocusedSelectionColor: (in category 'accessing') -----
- unfocusedSelectionColor: aColor
-
-        self
-                setProperty: #unfocusedSelectionColor
-                toValue: aColor.!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220207/03e562dc/attachment.html>


More information about the Squeak-dev mailing list