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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
# File 'app/view/image_frame.rb', line 4
def image_frame(root: , image: )
image_label = output_location_entry = image_index_spinbox = style_options_container_frame = nil
frame {
label {
text 'Collection:'
}
combobox {
readonly true
values <= [image, :collection_options]
text <=> [image, :collection]
}
label {
text 'Image Index:'
}
image_index_spinbox = spinbox {
from 0
to image.images[image.collection].size - 1
text <=> [image, :image_index]
}
label {
text 'Zoom:'
}
spinbox {
from 1
to 72
text <=> [image, :zoom]
}
label {
text 'Palette:'
}
combobox {
readonly true
text <=> [image, :palette]
}
label {
text 'Style:'
}
combobox {
readonly true
text <=> [image, :style, after_write: ->(val) {add_style_options(style_options_container_frame: style_options_container_frame, image: image)}]
}
style_options_container_frame = frame {
padding 0
}
frame {
padding 0
checkbutton {
grid row: 0, column: 0, column_weight: 0
variable <=> [image, :mirror]
}
label {
grid row: 0, column: 1
text 'Mirror'
on('Button-1') do
image.mirror = !image.mirror
end
}
checkbutton {
grid row: 0, column: 2
variable <=> [image, :flip]
}
label {
grid row: 0, column: 3
text 'Flip'
on('Button-1') do
image.flip = !image.flip
end
}
}
label {
text 'Output Location:'
}
frame {
padding 0
output_location_entry = entry {
grid row: 0, column: 0
readonly true
width 47
}
button {
grid row: 0, column: 1
text '...'
width 1.1
on('command') do
change_output_location(root: root, image: image)
end
}
}
image_label = label {
grid row_weight: 1
}
}
register_image_frame_observers(image_label: image_label, output_location_entry: output_location_entry, image_index_spinbox: image_index_spinbox, image: image)
end
|