Skip to content

Instantly share code, notes, and snippets.

@duncanmak
Last active August 29, 2015 14:27
Show Gist options
  • Save duncanmak/a45114d653fd66828c3c to your computer and use it in GitHub Desktop.
Save duncanmak/a45114d653fd66828c3c to your computer and use it in GitHub Desktop.
Make list headers in CodePackageListWindow adjust to Morph height (discovered when using Large Fonts)
'From Cuis 4.2 of 25 July 2013 [latest update: #2463] on 22 August 2015 at 12:41:10.210446 pm'!
!LayoutMorph methodsFor: 'convenience methods' stamp: 'DM 8/21/2015 17:23'!
addMorphKeepMorphHeight: aMorph
"Convenience method.
Add others as necessary."
self addMorph: aMorph layoutSpec: (LayoutSpec new useMorphHeight)! !
!CodePackageListWindow methodsFor: 'GUI building' stamp: 'DM 8/21/2015 17:23'!
buildMorphicWindow
"
CodePackageListWindow open: CodePackageList new
"
| dirtyFlags names fileNames upperRow description summary backColor labelBackground |
backColor := self textBackgroundColor.
labelBackground := Theme current background.
dirtyFlags := PluggableListMorph
model: model
listGetter: #packageDirtyFlags
indexGetter: #selectionIndex
indexSetter: #selectionIndex:.
dirtyFlags color: backColor.
dirtyFlags := LayoutMorph newColumn
color: labelBackground;
addMorph: (RectangleLikeMorph new color: Color transparent) fixedHeight: 4;
addMorphKeepMorphHeight: (StringMorph new contents: ' Unsaved?');
addMorphUseAll: dirtyFlags.
names := PluggableListMorph
model: model
listGetter: #packageNames
indexGetter: #selectionIndex
indexSetter: #selectionIndex:.
names color: backColor.
names := LayoutMorph newColumn
color: labelBackground;
addMorph: (RectangleLikeMorph new color: Color transparent) fixedHeight: 4;
addMorphKeepMorphHeight: (StringMorph new contents: ' Package Name');
addMorphUseAll: names.
fileNames := PluggableListMorph
model: model
listGetter: #packageFullNames
indexGetter: #selectionIndex
indexSetter: #selectionIndex:.
fileNames color: backColor.
fileNames := LayoutMorph newColumn
color: labelBackground;
addMorph: (RectangleLikeMorph new color: Color transparent) fixedHeight: 4;
addMorphKeepMorphHeight: (StringMorph new contents: ' File Name');
addMorphUseAll: fileNames.
upperRow := LayoutMorph newRow.
upperRow
addMorph: dirtyFlags proportionalWidth: 0.13;
addAdjusterAndMorph: names proportionalWidth: 0.27;
addAdjusterAndMorph: fileNames proportionalWidth: 0.6.
description := TextModelMorph
textProvider: model
textGetter: #description
textSetter: #description:.
summary := TextModelMorph
textProvider: model
textGetter: #summary.
self layoutMorph
addMorph: upperRow proportionalHeight: 0.5;
addAdjusterAndMorph: self buildButtonPane proportionalHeight: 0.1;
addAdjusterAndMorph: summary proportionalHeight: 0.18;
addAdjusterAndMorph: description proportionalHeight: 0.22;
addAdjusterAndMorph: self buildRequirementsPane proportionalHeight: 0.2.
self setLabel: 'Installed Packages'! !
!ChangeSorterWindow methodsFor: 'GUI building' stamp: 'DM 8/22/2015 12:34'!
buildMorphicWindow
"Add a set of change sorter views to the given top view offset by the given amount. To create a single change sorter, call this once with an offset of 0@0. To create a dual change sorter, call it twice with offsets of 0@0 and 0.5@0."
| dirtyFlags changeSetList classList messageList upperPanes backColor labelBackground |
backColor _ self textBackgroundColor.
labelBackground _ Theme current background.
model myChangeSet ifNil: [
self flag: #ojo. "Or whatever was last changed, or is top of list, or whatever"
model myChangeSet: ChangeSet changeSetForBaseSystem ].
dirtyFlags _ PluggableListMorph
model: model
listGetter: #changeSetDirtyFlags
indexGetter: nil
indexSetter: nil.
dirtyFlags color: backColor.
dirtyFlags _ LayoutMorph newColumn
color: Theme current background;
addMorph: (RectangleLikeMorph new color: Color transparent) fixedHeight: 4;
addMorphKeepMorphHeight: (StringMorph new contents: ' Unsaved?');
addMorphUseAll: dirtyFlags.
changeSetList _ (PluggableListMorphByItem
model: model
listGetter: #changeSetList
indexGetter: #currentCngSet
indexSetter: #showChangeSetNamed:
mainView: self
menuGetter: #changeSetMenu
keystrokeAction: #changeSetListKey:from:)
autoDeselect: false.
changeSetList color: backColor.
changeSetList _ LayoutMorph newColumn
color: labelBackground;
addMorph: (RectangleLikeMorph new color: Color transparent) fixedHeight: 4;
addMorphKeepMorphHeight: (StringMorph new contents: 'Change Set name');
addMorphUseAll: changeSetList.
classList _ PluggableListMorphByItem
model: model
listGetter: #classList
indexGetter: #currentClassName
indexSetter: #currentClassName:
mainView: self
menuGetter: #classListMenu
keystrokeAction: #classListKey:from:.
classList color: backColor.
classList _ LayoutMorph newColumn
color: labelBackground;
addMorph: (RectangleLikeMorph new color: Color transparent) fixedHeight: 4;
addMorphKeepMorphHeight: (StringMorph new contents: 'Classes');
addMorphUseAll: classList.
upperPanes _ LayoutMorph newRow.
upperPanes
addMorph: dirtyFlags proportionalWidth: 0.13;
addAdjusterAndMorph: changeSetList proportionalWidth: 0.47;
addAdjusterAndMorph: classList proportionalWidth: 0.4.
messageList _ PluggableListMorphByItem
model: model
listGetter: #messageList
indexGetter: #currentSelector
indexSetter: #currentSelector:
mainView: self
menuGetter: #messageMenu
keystrokeAction: #messageListKey:from:.
messageList color: backColor.
messageList _ LayoutMorph newColumn
color: labelBackground;
addMorph: (RectangleLikeMorph new color: Color transparent) fixedHeight: 4;
addMorphKeepMorphHeight: (StringMorph new contents: 'Methods');
addMorphUseAll: messageList.
self layoutMorph
addMorph: upperPanes proportionalHeight: 0.25;
addAdjusterAndMorph: messageList proportionalHeight: 0.2;
addAdjusterAndMorph: self buildLowerPanes proportionalHeight: 0.55.
self setLabel: model labelString! !
!methodRemoval: LayoutMorph #addMorphKeepMorphHeight:useMorphHeight:!
LayoutMorph removeSelector: #addMorphKeepMorphHeight:useMorphHeight:!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment