Skip to content

Commit

Permalink
fix column view resizable columns on morphic backend
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanlm committed Nov 27, 2024
1 parent f11ba64 commit 9f3e143
Show file tree
Hide file tree
Showing 3 changed files with 25 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
21 changes: 20 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,25 @@ SpEasyColumnViewPresenter class >> exampleActivateOnDoubleClick [
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 9f3e143

Please sign in to comment.