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

Marcel Taeumel marcel.taeumel at hpi.de
Mon Feb 14 10:04:39 UTC 2022


Hi Christoph --

I wouldn't complicate the control flow too much here. Editing a label in an inactive window seems like a rare edge case.

Give than you have

[ ] Mouse over for keyboard focus
[x] Windows' controls are always active 

It might happen a little bit more often. Yet, the basic implementation is within StringMorph. The current approach with #acceptContents indicates that talking to the outer scope (i.e., the window) is rather ugly. So, don't treat the way I did it there as a "free ticket" so add more such strange stuff. Instead, assess the relevance of such issue. Regarding this window-color thing ... I don't think it is important enough.

Just leave it be for now. :-)

Best,
Marcel
Am 13.02.2022 00:45:08 schrieb christoph.thiede at student.hpi.uni-potsdam.de <christoph.thiede at student.hpi.uni-potsdam.de>:
Hi Marcel,

I noticed that when you launch a mini-editor on a non-focused window that has a grey label color instead of a black label color, the grey color will also be used in the mini-editor.

If you deem this worth a fix: Where would be the right place for such a fix? Use a mouse event filter in SystemWindow and update the label color (#lookFocused) preliminary? Hm ... :-)

Best,
Christoph

---
Sent from Squeak Inbox Talk [https://github.com/hpi-swa-lab/squeak-inbox-talk]

On 2022-02-07T12:10:13+00:00, christoph.thiede at student.hpi.uni-potsdam.de wrote:

> 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>
>
>
["passiveLabelColor.png"]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220214/cca1368b/attachment-0001.html>


More information about the Squeak-dev mailing list