UI: Placement and modularity. Starting user groups.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2021-08-27 17:32:28 -05:00
parent 3134c006e6
commit fc5f13e8d2
6 changed files with 47 additions and 35 deletions

View File

@ -1,6 +1,6 @@
accessing
asCardElement
| aModeLook anEditor textInfoPane |
| aModeLook anEditor textInfoPane buttonsPane |
aModeLook := BrEditorModeAptitude new
editableFocused: [ :aWidget | aWidget border: (BlBorder paint: BrGlamorousColors focusedEditorBorderColor width: 1) ];
@ -20,23 +20,8 @@ asCardElement
aptitude: BrGlamorousLabelAptitude;
text: '@' , self user userName , ' | ' , self created asString;
beSmallSize);
addChild: anEditor.
^ BrHorizontalPane new
padding: (BlInsets all: 15);
margin: (BlInsets all: 10);
cellSpacing: 5;
hMatchParent;
vFitContent;
addChildren: {
(self user profileImage asElement asScalableElement size: 64 @ 64).
BrVerticalPane new
cellSpacing: 5;
hMatchParent;
vFitContent;
addChildren: {
textInfoPane.
BrHorizontalPane new
addChild: anEditor.
buttonsPane := BrHorizontalPane new
fitContent;
cellSpacing: 5;
addChildren: {
@ -56,6 +41,22 @@ asCardElement
aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Web view';
action: [ self webView ].
}.
^ BrHorizontalPane new
padding: (BlInsets all: 15);
margin: (BlInsets all: 10);
cellSpacing: 5;
hMatchParent;
vFitContent;
addChildren: {
(self user profileImage asElement asScalableElement size: 64 @ 64).
BrVerticalPane new
cellSpacing: 5;
hMatchParent;
vFitContent;
addChildren: {
buttonsPane.
textInfoPane.
}
}
}

View File

@ -0,0 +1,3 @@
accessing
addToGroup: aTwitterUsersGroup
self groups add: aTwitterUsersGroup

View File

@ -1,6 +1,6 @@
accessing
asCardElement
| aModeLook anEditor textInfoPane |
| aModeLook anEditor textInfoPane buttonsPane |
aModeLook := BrEditorModeAptitude new
editableFocused: [ :aWidget | aWidget border: (BlBorder paint: BrGlamorousColors focusedEditorBorderColor width: 1) ];
@ -27,7 +27,20 @@ asCardElement
addChild: (BrLabel new
aptitude: BrGlamorousLabelAptitude;
text: 'Joined: ' , self createdAtShorted );
addChild: anEditor.
addChild: anEditor.
buttonsPane := BrHorizontalPane new
fitContent;
cellSpacing: 5;
addChildren: {
BrButton new
aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Tweets';
action: [ :e | e phlow spawnObject: self tweets ].
BrButton new
aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Web view';
action: [ self webView ].
}.
^ BrHorizontalPane new
padding: (BlInsets all: 15);
@ -42,19 +55,7 @@ asCardElement
hMatchParent;
vFitContent;
addChildren: {
buttonsPane.
textInfoPane.
BrHorizontalPane new
fitContent;
cellSpacing: 5;
addChildren: {
BrButton new
aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Tweets';
action: [ :e | e phlow spawnObject: self tweets ].
BrButton new
aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Web view';
action: [ self webView ].
}
}
}

View File

@ -0,0 +1,3 @@
accessing
groups: aTwitterUsersGroupCollection
groups := aTwitterUsersGroupCollection

View File

@ -0,0 +1,3 @@
accessing
groups
^ groups ifNil: [ groups := OrderedCollection new]

View File

@ -13,7 +13,8 @@
"description",
"metrics",
"tweets",
"createdAt"
"createdAt",
"groups"
],
"name" : "TwitterUser",
"type" : "normal"