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 accessing
asCardElement asCardElement
| aModeLook anEditor textInfoPane | | aModeLook anEditor textInfoPane buttonsPane |
aModeLook := BrEditorModeAptitude new aModeLook := BrEditorModeAptitude new
editableFocused: [ :aWidget | aWidget border: (BlBorder paint: BrGlamorousColors focusedEditorBorderColor width: 1) ]; editableFocused: [ :aWidget | aWidget border: (BlBorder paint: BrGlamorousColors focusedEditorBorderColor width: 1) ];
@ -20,23 +20,8 @@ asCardElement
aptitude: BrGlamorousLabelAptitude; aptitude: BrGlamorousLabelAptitude;
text: '@' , self user userName , ' | ' , self created asString; text: '@' , self user userName , ' | ' , self created asString;
beSmallSize); beSmallSize);
addChild: anEditor. addChild: anEditor.
buttonsPane := BrHorizontalPane new
^ 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
fitContent; fitContent;
cellSpacing: 5; cellSpacing: 5;
addChildren: { addChildren: {
@ -56,6 +41,22 @@ asCardElement
aptitude: BrGlamorousButtonWithLabelAptitude new; aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Web view'; label: 'Web view';
action: [ self webView ]. 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 accessing
asCardElement asCardElement
| aModeLook anEditor textInfoPane | | aModeLook anEditor textInfoPane buttonsPane |
aModeLook := BrEditorModeAptitude new aModeLook := BrEditorModeAptitude new
editableFocused: [ :aWidget | aWidget border: (BlBorder paint: BrGlamorousColors focusedEditorBorderColor width: 1) ]; editableFocused: [ :aWidget | aWidget border: (BlBorder paint: BrGlamorousColors focusedEditorBorderColor width: 1) ];
@ -27,7 +27,20 @@ asCardElement
addChild: (BrLabel new addChild: (BrLabel new
aptitude: BrGlamorousLabelAptitude; aptitude: BrGlamorousLabelAptitude;
text: 'Joined: ' , self createdAtShorted ); 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 ^ BrHorizontalPane new
padding: (BlInsets all: 15); padding: (BlInsets all: 15);
@ -42,19 +55,7 @@ asCardElement
hMatchParent; hMatchParent;
vFitContent; vFitContent;
addChildren: { addChildren: {
buttonsPane.
textInfoPane. 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", "description",
"metrics", "metrics",
"tweets", "tweets",
"createdAt" "createdAt",
"groups"
], ],
"name" : "TwitterUser", "name" : "TwitterUser",
"type" : "normal" "type" : "normal"