[squeak-dev] The Trunk: PreferenceBrowser-mt.126.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Jan 12 12:25:51 UTC 2022
Marcel Taeumel uploaded a new version of PreferenceBrowser to project The Trunk:
http://source.squeak.org/trunk/PreferenceBrowser-mt.126.mcz
==================== Summary ====================
Name: PreferenceBrowser-mt.126
Author: mt
Time: 12 January 2022, 1:25:48.885628 pm
UUID: 06cc4c6d-4125-44b8-b2c2-ff3298747d5a
Ancestors: PreferenceBrowser-mt.125
Minor fix in wizard regarding scaling and visibility. It's still a mess. :-)
=============== Diff against PreferenceBrowser-mt.125 ===============
Item was changed:
----- Method: PreferenceWizardMorph>>updateFromChangedScaleFactor (in category 'display scale') -----
updateFromChangedScaleFactor
previewWorld delete.
previewWorld := nil.
DisplayScreen displayIsFullScreen ifFalse: [
DisplayScreen setNewScreenSize: (self defaultExtent * RealEstateAgent scaleFactor) rounded].
checkmark := nil.
radiomark := nil.
self
layoutInset: (self defaultFont widthOf: $x) * 2;
cellGap: (self defaultFont widthOf: $x).
titleMorph
font: (UserInterfaceTheme current get: #wizardTitleFont);
margins: (self cellGap @ 0 corner: self cellGap @ self cellGap).
titleMorph layoutFrame
bottomOffset: titleMorph height.
self updateLowPerformanceLabel: lowPerformanceMorph contents.
"buttons"
{startButton. skipButton. previousButton. nextButton. doneButton},
(pages gather: [:page | page allMorphs select: [:ea | ea isButton]])
do: [:button |
((button owner hasProperty: #isRadioButton)
or: [button owner hasProperty: #isCheckbox])
ifTrue: [
button
"layoutInset: 0;"
extent: (TextStyle defaultFont height * 1.75) asPoint;
update: button getLabelSelector.
button owner cellGap: (TextStyle defaultFont widthOf: $x).
button owner balloonText ifNotNil: [:text |
text addAttribute: (TextFontReference toFont: (UserInterfaceTheme current get: #wizardHelpFont))]]
ifFalse: [
button
layoutInset: self defaultButtonMargins].
button
borderWidth: (2 * RealEstateAgent scaleFactor) truncated;
font: (UserInterfaceTheme current get: #wizardButtonFont);
updateMinimumExtent "Font might not change but PPI did."].
self fullBounds.
(startButton minimumWidth max: skipButton minimumWidth) in: [:w |
startButton hResizing: #rigid; width: w.
skipButton hResizing: #rigid; width: w.
startButton layoutFrame leftOffset: 2*w negated.
skipButton layoutFrame rightOffset: 2*w].
(previousButton minimumWidth max: nextButton minimumWidth) in: [:w |
previousButton hResizing: #rigid; width: w.
nextButton hResizing: #rigid; width: w].
pagesLabel
margins: (self layoutInset at 0 corner: self layoutInset at 0);
font: (UserInterfaceTheme current get: #wizardStandardFont).
buttonRowMorph
cellGap: self cellGap;
layoutInset: (0 at self layoutInset corner: 0 at 0).
buttonRowMorph layoutFrame
topOffset: buttonRowMorph fullBounds height negated.
"labels"
{controlMorph firstSubmorph}, (pages gather: [:page | page allMorphs select: [:ea | ea isTextMorph]])
do: [:label |
label
font: (UserInterfaceTheme current get: #wizardStandardFont);
margins: self defaultTextMargins
"No need for #releaseParagraph because window resizing will happen anyway."].
"controlMorph"
controlMorph layoutInset: (0 at 0 corner: self cellGap at 0).
controlMorph layoutFrame
topOffset: titleMorph height;
bottomOffset: buttonRowMorph height negated.
"scroll panes in pages"
pages do: [:page | | scrollPane |
page
layoutInset: (self layoutInset asPoint corner: self cellGap at 0);
cellGap: self cellGap.
scrollPane := page submorphs second.
scrollPane scrollBarThickness: self layoutInset.
scrollPane scroller firstSubmorph
cellGap: self cellGap;
layoutInset: (0 at 0 corner: self cellGap at 0).
(scrollPane vScrollBar instVarNamed: #slider)
borderWidth: (2 * RealEstateAgent scaleFactor) truncated].
"previewWorld"
self initializePreviewWorld.
self addMorph: previewWorld.
+ self bounds: self world bounds.
+ self updateWindowBounds.
+ self updatePageVisibility.!
- self step.
- " previewWorld borderWidth: (2 * RealEstateAgent scaleFactor) truncated.
- previewWorld layoutFrame
- topOffset: titleMorph height;
- bottomOffset: buttonRowMorph height negated.
- " !
Item was changed:
----- Method: PreferenceWizardMorph>>updatePageVisibility (in category 'layout') -----
updatePageVisibility
"Hide extra labels if page has not enough space."
| currentPage scrollPane enoughRoom topText bottomText firstItem |
controlMorph ifNil: [^ self].
controlMorph submorphs size > 1 ifFalse: [^ self].
+
+ self fullBounds.
+
currentPage := controlMorph lastSubmorph.
scrollPane := currentPage submorphs second.
topText := controlMorph firstSubmorph.
bottomText := currentPage lastSubmorph isTextMorph
ifTrue: [currentPage lastSubmorph].
firstItem := scrollPane scroller firstSubmorph firstSubmorph. "checkbox"
enoughRoom := topText visible
+ ifTrue: [(firstItem height * 3) <= scrollPane height]
+ ifFalse: [(firstItem height * 3) <= (scrollPane height
- ifTrue: [firstItem height <= scrollPane height]
- ifFalse: [firstItem height <= (scrollPane height
- topText height - (bottomText ifNil: [0] ifNotNil: [:t | t height]))].
enoughRoom not
ifTrue: [
+ topText
- controlMorph firstSubmorph
visible: false;
disableLayout: true.
+ bottomText ifNotNil: [
+ bottomText
+ visible: false;
+ disableLayout: true]]
- currentPage lastSubmorph isTextMorph
- ifTrue: [
- currentPage lastSubmorph
- visible: false;
- disableLayout: true]]
ifFalse: [
+ topText
- controlMorph firstSubmorph
visible: true;
disableLayout: false.
+ bottomText ifNotNil: [
+ currentPage lastSubmorph
+ visible: true;
+ disableLayout: false]]!
- currentPage lastSubmorph isTextMorph
- ifTrue: [
- currentPage lastSubmorph
- visible: true;
- disableLayout: false]]!
More information about the Squeak-dev
mailing list
|