/
FTTableRowMorph.class.st
89 lines (71 loc) · 1.67 KB
/
FTTableRowMorph.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
"
I'm a row for a table.
All my work is to keep cells.
"
Class {
#name : #FTTableRowMorph,
#superclass : #Morph,
#instVars : [
'selectionColor'
],
#category : #'Morphic-Widgets-FastTable'
}
{ #category : #'instance creation' }
FTTableRowMorph class >> new [
self error: 'Use #table:'
]
{ #category : #'instance creation' }
FTTableRowMorph class >> table: aTableMorph [
^ self basicNew
initializeTable: aTableMorph;
yourself
]
{ #category : #initialize }
FTTableRowMorph >> defaultColor [
^Color transparent
]
{ #category : #'event handling' }
FTTableRowMorph >> handlesMouseOver: evt [
^true
]
{ #category : #initialization }
FTTableRowMorph >> initialize [
super initialize.
self
clipSubmorphs:true;
layoutPolicy: FTRowLayout new.
selectionColor := self defaultColor
]
{ #category : #initialization }
FTTableRowMorph >> initializeTable: tableMorph [
self initialize.
self
cellInset: tableMorph intercellSpacing";
layoutInset: tableMorph intercellSpacing".
self flag: #todo. "Check if layout inset works better"
]
{ #category : #'event handling' }
FTTableRowMorph >> mouseEnter: evt [
self color: (
selectionColor isTransparent
ifTrue: [ self mouseOverColor ]
ifFalse: [ self mouseOverColor mixed: 0.5 with: selectionColor ]
)
]
{ #category : #'event handling' }
FTTableRowMorph >> mouseLeave: evt [
self color: self selectionColor
]
{ #category : #initialize }
FTTableRowMorph >> mouseOverColor [
^ self theme lightBackgroundColor
]
{ #category : #initialize }
FTTableRowMorph >> selectionColor [
^selectionColor
]
{ #category : #accessing }
FTTableRowMorph >> selectionColor: aColor [
selectionColor := aColor.
self color: selectionColor
]