Minor Tweet UI/UX improvements.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2021-08-25 15:35:36 -05:00
parent c7e5d66f10
commit 3853c3e9fc
5 changed files with 14 additions and 44 deletions

View File

@ -1,39 +1,4 @@
accessing
asCardElement
^ BrHorizontalPane new
hFitContent;
vFitContent;
padding: (BlInsets all: 15);
margin: (BlInsets all: 10);
addChild:
(self user profileImage asElement asScalableElement size: 64 @ 64);
addChild: (BrVerticalPane new
exact: 250;
margin: (BlInsets left: 20);
addChild: (BrLabel new
aptitude: BrGlamorousLabelAptitude;
text: '@' , self user userName , ' | ' , self created asString;
beSmallSize);
addChild: (BrEditor new
aptitude: BrGlamorousRegularEditorAptitude new;
beReadOnlyWithSelection;
text: self text);
addChild:(BrHorizontalPane new
fitContent;
cellSpacing: 5;
addChildren: {
BrButton new
aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Toggle subtopics';
action: [ "anEditor beEditable" ].
BrButton new
aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Add subtopic keyword';
action: [ "anEditor beReadOnlyWithSelection" ].
BrButton new
aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Web view';
action: [ "anEditor beReadOnlyWithoutSelection" ]
}));
when: BlClickEvent do: [ :e | e target phlow spawnObject: self ]
^ self asTestCardElement

View File

@ -52,11 +52,11 @@ asTestCardElement
BrButton new
aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Details';
action: [ anEditor beReadOnlyWithSelection ].
action: [ :e | e phlow spawnObject: self ].
BrButton new
aptitude: BrGlamorousButtonWithLabelAptitude new;
label: 'Web view';
action: [ anEditor beReadOnlyWithoutSelection ].
action: [ self webView ].
}
}
}

View File

@ -0,0 +1,3 @@
accessing
id
^ id

View File

@ -0,0 +1,3 @@
accessing
webView
WebBrowser openOn: 'https://twitter.com/', self user userName, '/status/', self id

View File

@ -14,12 +14,11 @@ gtTweetsFor: aView
self tweets do: [ :each |
imageContainer := BlLazyElement new
withGlamorousPreview;
aptitude: BrShadowAptitude new;
background: Color white;
margin: (BlInsets all: 20);
aptitude: BrShadowAptitude new;
background: Color white;
margin: (BlInsets all: 10);
constraintsDo: [ :c |
c vertical exact: 200.
c vertical exact: 135.
c horizontal matchParent ];
elementBuilder: [ each asTestCardElement margin: (BlInsets all: 20) ].
container addChild: imageContainer].