Creating a confirmation button in importer UI.

This commit is contained in:
ruidajo 2025-03-12 20:07:19 -05:00
parent bd7fa11363
commit 3fffd37e8f

View File

@ -31,20 +31,28 @@ LeMiniDocsImport >> createDropdownExpandedHandleButton [
{ #category : #accessing } { #category : #accessing }
LeMiniDocsImport >> createURLeditable [ LeMiniDocsImport >> createURLeditable [
| base editable | | base editable button |
base := BlElement new base := BlElement new
background: (Color white); background: Color white;
size: 200 @ 30; size: 300 @55;
margin: (BlInsets all: 10); margin: (BlInsets all: 10);
yourself. yourself.
editable := BrEditableLabel new editable := BrEditableLabel new
aptitude: BrGlamorousEditableLabelAptitude new glamorousRegularFontAndSize; aptitude: BrGlamorousEditableLabelAptitude new glamorousRegularFontAndSize;
text: 'Document link'; text: 'Document link';
switchToEditor. fitContent;
editable when: BrEditorAcceptWish do: [ :aWish | switchToEditor.
self importDocumentFrom: aWish text asString. editable
]. when: BrEditorAcceptWish
do: [ :aWish | self importDocumentFrom: aWish text asString ].
button := BrButton new
label: 'ok';
aptitude: BrGlamorousButtonWithLabelAptitude;
fitContent;
relocate: 0 @ 30.
button action: [ :aButton | editable acceptEdition ].
base addChild: editable. base addChild: editable.
base addChild: button.
^ base ^ base
] ]
@ -71,11 +79,9 @@ LeMiniDocsImport >> initialize [
icon: BrGlamorousVectorIcons downwards; icon: BrGlamorousVectorIcons downwards;
label: 'Add MiniDocs'; label: 'Add MiniDocs';
aptitude: BrGlamorousButtonWithIconAndLabelAptitude. aptitude: BrGlamorousButtonWithIconAndLabelAptitude.
self addAptitude: (BrGlamorousWithDropdownAptitude self addAptitude: (BrGlamorousWithExplicitDropdownAptitude
handle: [ self createDropdownExpandedHandleButton ] handle: [ self createDropdownExpandedHandleButton ]
content: [ self createURLeditable ]). content: [ self createURLeditable ]).
self aptitude - BrGlamorousButtonExteriorAptitude.
] ]
{ #category : #accessing } { #category : #accessing }