Changes on the menu

This commit is contained in:
Santiago Bragagnolo 2020-03-26 13:27:00 +00:00 committed by Offray Luna
parent 633613c3bc
commit 146d54363a
2 changed files with 18 additions and 8 deletions

View File

@ -13,12 +13,12 @@ Class {
{ #category : #'world menu' } { #category : #'world menu' }
GfWorldMenu class >> helpMenuOn: aBuilder [ GfWorldMenu class >> helpMenuOn: aBuilder [
<worldMenu> <worldMenu>
(aBuilder item: #GfManual) (aBuilder item: #GfManual)
label: 'Manual'; label: 'Manual';
order: 1; order: 1;
parent: #GfHelpAndDocs; parent: #GfHelpAndDocs;
action: [ GrafoscopioNewNotebook open: GrafoscopioDocs manual ]. action: [ GrafoscopioNotebook open: GrafoscopioDocs manual ].
(aBuilder item: #GfManualPDF) (aBuilder item: #GfManualPDF)
label: 'Manual (PDF)'; label: 'Manual (PDF)';
order: 2; order: 2;
@ -28,12 +28,12 @@ GfWorldMenu class >> helpMenuOn: aBuilder [
label: 'Dataviz'; label: 'Dataviz';
order: 3; order: 3;
parent: #GfHelpAndDocs; parent: #GfHelpAndDocs;
action: [ GrafoscopioNewNotebook open: DatavizDocs introNotebook ]. action: [ GrafoscopioNotebook open: DatavizDocs introNotebook ].
(aBuilder item: #GfHelpDevNotes) (aBuilder item: #GfHelpDevNotes)
label: 'Devs''s notes'; label: 'Devs''s notes';
order: 4; order: 4;
parent: #GfHelpAndDocs; parent: #GfHelpAndDocs;
action: [ GrafoscopioNewNotebook open: GrafoscopioDocs devNotes ]. action: [ GrafoscopioNotebook open: GrafoscopioDocs devNotes ].
(aBuilder item: #GfHelpAbout) (aBuilder item: #GfHelpAbout)
label: 'About Grafoscopio'; label: 'About Grafoscopio';
order: 5; order: 5;
@ -122,13 +122,13 @@ GfWorldMenu class >> mainMenuItemsOn: aBuilder [
GfWorldMenu class >> openRecentMenu: aBuilder [ GfWorldMenu class >> openRecentMenu: aBuilder [
<worldMenu> <worldMenu>
GrafoscopioNewNotebook recents GrafoscopioNotebook recents
do: [ :f | do: [ :f |
(aBuilder item: #'Open', f basename ) (aBuilder item: #'Open', f basename )
label: 'Open ', f basename; label: 'Open ', f basename;
order: 1; order: 1;
parent: #GfLaunchOpenRecent; parent: #GfLaunchOpenRecent;
action: [ GrafoscopioNewNotebook open: f ] ] action: [ GrafoscopioNotebook open: f ] ]
] ]
{ #category : #'world menu' } { #category : #'world menu' }

View File

@ -5,13 +5,15 @@ Class {
'up', 'up',
'down', 'down',
'delete', 'delete',
'editionMode' 'editionMode',
'lastHeightUsed'
], ],
#category : 'Grafoscopio-New-UI' #category : 'Grafoscopio-New-UI'
} }
{ #category : #initialization } { #category : #initialization }
GrafoscopioNewTextModel >> createLayoutFor: aGrafoscopioNodeContent [ GrafoscopioNewTextModel >> createLayoutFor: aGrafoscopioNodeContent [
lastHeightUsed := (self heightFor: aGrafoscopioNodeContent).
^ editionMode ^ editionMode
ifTrue: [ self editionLayoutFor: aGrafoscopioNodeContent ] ifTrue: [ self editionLayoutFor: aGrafoscopioNodeContent ]
ifFalse: [ self normalLayoutFor: aGrafoscopioNodeContent ] ifFalse: [ self normalLayoutFor: aGrafoscopioNodeContent ]
@ -50,7 +52,7 @@ GrafoscopioNewTextModel >> initializeWidgets [
{ #category : #initialization } { #category : #initialization }
GrafoscopioNewTextModel >> newTextComponent [ GrafoscopioNewTextModel >> newTextComponent [
^ self newText ^ self newText
whenTextChangedDo: [ model text: body text ]; whenTextChangedDo: [ self textChanged ];
autoAccept: true; autoAccept: true;
yourself yourself
] ]
@ -62,6 +64,14 @@ GrafoscopioNewTextModel >> normalLayoutFor: aGrafoscopioNodeContent [
height: (self heightFor: aGrafoscopioNodeContent) height: (self heightFor: aGrafoscopioNodeContent)
] ]
{ #category : #initialization }
GrafoscopioNewTextModel >> textChanged [
model text: body text.
(lastHeightUsed - (self heightFor: model text )) abs
> (lastHeightUsed * 0.1)
ifTrue: [ self modelChanged ]
]
{ #category : #initialization } { #category : #initialization }
GrafoscopioNewTextModel >> toogleEditionMode [ GrafoscopioNewTextModel >> toogleEditionMode [
editionMode := editionMode not. editionMode := editionMode not.