From 3853c3e9fc9eb4395953ed3af21c0193d7ea05b7 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Wed, 25 Aug 2021 15:35:36 -0500 Subject: [PATCH] Minor Tweet UI/UX improvements. --- .../Tweet.class/instance/asCardElement.st | 39 +------------------ .../Tweet.class/instance/asTestCardElement.st | 4 +- .../Tweet.class/instance/id.st | 3 ++ .../Tweet.class/instance/webView.st | 3 ++ .../instance/gtTweetsFor..st | 9 ++--- 5 files changed, 14 insertions(+), 44 deletions(-) create mode 100644 Datanalitica.package/Tweet.class/instance/id.st create mode 100644 Datanalitica.package/Tweet.class/instance/webView.st diff --git a/Datanalitica.package/Tweet.class/instance/asCardElement.st b/Datanalitica.package/Tweet.class/instance/asCardElement.st index afbddfd..e840bb5 100644 --- a/Datanalitica.package/Tweet.class/instance/asCardElement.st +++ b/Datanalitica.package/Tweet.class/instance/asCardElement.st @@ -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 ] \ No newline at end of file + + ^ self asTestCardElement \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/instance/asTestCardElement.st b/Datanalitica.package/Tweet.class/instance/asTestCardElement.st index d2d1336..4173c83 100644 --- a/Datanalitica.package/Tweet.class/instance/asTestCardElement.st +++ b/Datanalitica.package/Tweet.class/instance/asTestCardElement.st @@ -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 ]. } } } \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/instance/id.st b/Datanalitica.package/Tweet.class/instance/id.st new file mode 100644 index 0000000..41241a3 --- /dev/null +++ b/Datanalitica.package/Tweet.class/instance/id.st @@ -0,0 +1,3 @@ +accessing +id + ^ id \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/instance/webView.st b/Datanalitica.package/Tweet.class/instance/webView.st new file mode 100644 index 0000000..d02a1cb --- /dev/null +++ b/Datanalitica.package/Tweet.class/instance/webView.st @@ -0,0 +1,3 @@ +accessing +webView + WebBrowser openOn: 'https://twitter.com/', self user userName, '/status/', self id \ No newline at end of file diff --git a/Datanalitica.package/TweetsCollection.class/instance/gtTweetsFor..st b/Datanalitica.package/TweetsCollection.class/instance/gtTweetsFor..st index 8706c4c..19ace39 100644 --- a/Datanalitica.package/TweetsCollection.class/instance/gtTweetsFor..st +++ b/Datanalitica.package/TweetsCollection.class/instance/gtTweetsFor..st @@ -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].