Skip to content

Commit

Permalink
Merge pull request #1675 from pharo-spec/dev-3.0
Browse files Browse the repository at this point in the history
fix column view resizable columns
  • Loading branch information
estebanlm authored Nov 27, 2024
2 parents 36582b7 + 404bb4e commit 8132c2e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SpMorphicColumnViewAdapter >> addModelTo: tableMorph [
{ #category : 'testing' }
SpMorphicColumnViewAdapter >> isResizable [

^ true
^ self presenter isResizable
]

{ #category : 'private - factory' }
Expand Down
7 changes: 4 additions & 3 deletions src/Spec2-ListView/SpColumnViewPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ SpColumnViewPresenter class >> example [
SpColumnViewPresenter class >> exampleActivateOnDoubleClick [

^ self new
application: (SpApplication new useBackend: #Gtk);
application: SpApplication new;
isActiveOnDoubleClick;
addColumnTitle: 'Class'
setup: [ :aPresenter | aPresenter newLabel ]
Expand All @@ -51,7 +51,7 @@ SpColumnViewPresenter class >> exampleActivateOnDoubleClick [
SpColumnViewPresenter class >> exampleResizableColumns [

^ self new
application: (SpApplication new useBackend: #Gtk);
application: SpApplication new;
beResizable;
items: Smalltalk allClasses;
addColumnTitle: 'Class'
Expand All @@ -67,7 +67,7 @@ SpColumnViewPresenter class >> exampleResizableColumns [
SpColumnViewPresenter class >> exampleWithIcons [

^ self new
application: (SpApplication new useBackend: #Gtk);
application: SpApplication new;
addColumnTitle: 'Class'
setup: [ :aPresenter |
| presenter |
Expand Down Expand Up @@ -159,6 +159,7 @@ SpColumnViewPresenter >> initialize [
super initialize.
self initializeTSearchable.
self showColumnHeaders.
self beNotResizable.
columns := #()
]

Expand Down
40 changes: 39 additions & 1 deletion src/Spec2-ListView/SpEasyColumnViewPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SpEasyColumnViewPresenter class >> example [
"This example show the simples list view you can make: A list with a label"

self new
application: (SpApplication new useBackend: #Gtk);
application: SpApplication new;
items: self environment allClasses;
addColumn: (SpStringTableColumn new
title: 'Class';
Expand Down Expand Up @@ -44,6 +44,44 @@ SpEasyColumnViewPresenter class >> exampleActivateOnDoubleClick [
open
]

{ #category : 'examples' }
SpEasyColumnViewPresenter class >> exampleResizableColumns [
"This example show the simples list view you can make: A list with a label"

self new
application: SpApplication new;
items: self environment allClasses;
beResizable;
addColumn: (SpStringTableColumn new
title: 'Class';
evaluated: [ :each | each name ];
yourself);
addColumn: (SpStringTableColumn new
title: 'Lines of code';
evaluated: [ :each | each linesOfCode ];
yourself);
open
]

{ #category : 'examples' }
SpEasyColumnViewPresenter class >> exampleWithColumnWidth [
"This example show the simples list view you can make: A list with a label"

self new
application: SpApplication new;
items: self environment allClasses;
addColumn: (SpStringTableColumn new
title: 'Class';
evaluated: [ :each | each name ];
yourself);
addColumn: (SpStringTableColumn new
title: 'Lines of code';
evaluated: [ :each | each linesOfCode ];
width: 50;
yourself);
open
]

{ #category : 'api' }
SpEasyColumnViewPresenter >> addColumn: aColumn [

Expand Down

0 comments on commit 8132c2e

Please sign in to comment.