glimmer-cs-gladiator 0.8.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,244 +1,244 @@
1
- # Copyright (c) 2020-2021 Andy Maleh
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining
4
- # a copy of this software and associated documentation files (the
5
- # "Software"), to deal in the Software without restriction, including
6
- # without limitation the rights to use, copy, modify, merge, publish,
7
- # distribute, sublicense, and/or sell copies of the Software, and to
8
- # permit persons to whom the Software is furnished to do so, subject to
9
- # the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be
12
- # included in all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
-
22
- module Glimmer
23
- class Gladiator
24
- class FileExplorerTree
25
- include Glimmer::UI::CustomWidget
26
-
27
- options :gladiator, :foreground_color
28
-
29
- body {
30
- tree {
31
- #visible bind(self, 'project_dir.filter') {|f| !f}
32
- items bind(self, :project_dir), tree_properties(children: :children, text: :name)
33
- foreground foreground_color
34
- drag_source(:drop_copy) {
35
- transfer :text
36
- on_drag_set_data { |event|
37
- Gladiator.drag = true
38
- tree = event.widget.getControl
39
- tree_item = tree.getSelection.first
40
- event.data = tree_item.getData.path
41
- }
42
- }
43
-
44
- menu {
45
- @open_menu_item = menu_item {
46
- text 'Open'
47
- on_widget_selected {
48
- project_dir.selected_child_path = extract_tree_item_path(swt_widget.getSelection.first)
49
- }
50
- }
51
- menu_item(:separator)
52
- menu_item {
53
- text 'Delete'
54
- on_widget_selected {
55
- tree_item = swt_widget.getSelection.first
56
- delete_tree_item(tree_item)
57
- }
58
- }
59
- menu_item {
60
- text 'Refresh'
61
- on_widget_selected {
62
- project_dir.refresh
63
- }
64
- }
65
- menu_item {
66
- text 'Rename'
67
- on_widget_selected {
68
- rename_selected_tree_item
69
- }
70
- }
71
- menu_item {
72
- text 'New Directory'
73
- on_widget_selected {
74
- add_new_directory_to_selected_tree_item
75
- }
76
- }
77
- menu_item {
78
- text 'New File'
79
- on_widget_selected {
80
- add_new_file_to_selected_tree_item
81
- }
82
- }
83
- }
84
-
85
- on_swt_menudetect { |event|
86
- path = extract_tree_item_path(swt_widget.getSelection.first)
87
- @open_menu_item.swt_widget.setEnabled(!::Dir.exist?(path)) if path
88
- }
89
- on_mouse_up {
90
- if Gladiator.drag_and_drop
91
- Gladiator.drag_and_drop = false
92
- else
93
- project_dir.selected_child_path = extract_tree_item_path(swt_widget.getSelection&.first)
94
- gladiator.current_text_editor&.text_widget&.setFocus
95
- end
96
- }
97
- on_key_pressed { |key_event|
98
- if Glimmer::SWT::SWTProxy.include?(key_event.keyCode, :cr)
99
- project_dir.selected_child_path = extract_tree_item_path(swt_widget.getSelection&.first)
100
- gladiator.current_text_editor&.text_widget&.setFocus
101
- end
102
- }
103
- on_paint_control {
104
- root_item = swt_widget.getItems.first
105
- if root_item && !root_item.getExpanded
106
- root_item.setExpanded(true)
107
- end
108
- }
109
-
110
- }
111
- }
112
-
113
- def project_dir
114
- gladiator.project_dir
115
- end
116
-
117
- def current_text_editor
118
- gladiator.current_text_editor
119
- end
120
-
121
- def extract_tree_item_path(tree_item)
122
- return if tree_item.nil?
123
- if tree_item.getParentItem
124
- ::File.join(extract_tree_item_path(tree_item.getParentItem), tree_item.getText)
125
- else
126
- project_dir.path
127
- end
128
- end
129
-
130
- def select_tree_item
131
- return unless project_dir.selected_child&.name
132
- tree_items_to_select = body_root.depth_first_search { |ti| ti.getData.path == project_dir.selected_child.path }
133
- swt_widget.setSelection(tree_items_to_select)
134
- end
135
-
136
- def delete_tree_item(tree_item)
137
- return if tree_item.nil?
138
- file = tree_item.getData
139
- parent_path = ::File.dirname(file.path)
140
- if file.is_a?(Gladiator::Dir)
141
- file_paths = file.all_children.select {|f| f.is_a?(Gladiator::File)}.map(&:path)
142
- file.remove_all_observers
143
- else
144
- file_paths = [file.path]
145
- end
146
- file_paths.each do |file_path|
147
- found_tab_item = gladiator.find_tab_item(file_path)
148
- if found_tab_item
149
- project_dir.selected_child_path_history.delete(found_tab_item.getData('file_path'))
150
- found_tab_item.getData('proxy')&.dispose
151
- end
152
- end
153
- file.delete! # TODO consider supporting command undo/redo
154
- project_dir.refresh(async: false)
155
- parent_tree_item = body_root.depth_first_search {|ti| ti.getData.path == parent_path}.first
156
- swt_widget.showItem(parent_tree_item)
157
- parent_tree_item.setExpanded(true)
158
- rescue => e
159
- puts e.full_message
160
- end
161
-
162
- def add_new_directory_to_selected_tree_item
163
- project_dir.pause_refresh
164
- tree_item = swt_widget.getSelection.first
165
- directory_path = extract_tree_item_path(tree_item)
166
- return if directory_path.nil?
167
- if !::Dir.exist?(directory_path)
168
- tree_item = tree_item.getParentItem
169
- directory_path = ::File.dirname(directory_path)
170
- end
171
- new_directory_path = ::File.expand_path(::File.join(directory_path, 'new_directory'))
172
- FileUtils.mkdir_p(new_directory_path)
173
- project_dir.refresh(async: false, force: true)
174
- new_tree_item = body_root.depth_first_search {|ti| ti.getData.path == new_directory_path}.first
175
- swt_widget.showItem(new_tree_item)
176
- rename_tree_item(new_tree_item)
177
- end
178
-
179
- def add_new_file_to_selected_tree_item
180
- project_dir.pause_refresh
181
- tree_item = swt_widget.getSelection.first
182
- directory_path = extract_tree_item_path(tree_item)
183
- if !::Dir.exist?(directory_path)
184
- tree_item = tree_item.getParentItem
185
- directory_path = ::File.dirname(directory_path)
186
- end
187
- new_file_path = ::File.expand_path(::File.join(directory_path, 'new_file'))
188
- FileUtils.touch(new_file_path)
189
- # TODO look into refreshing only the parent directory to avoid slowdown
190
- project_dir.refresh(async: false, force: true)
191
- new_tree_item = body_root.depth_first_search {|ti| ti.getData.path == new_file_path}.first
192
- swt_widget.showItem(new_tree_item)
193
- rename_tree_item(new_tree_item, true)
194
- end
195
-
196
- def rename_selected_tree_item
197
- project_dir.pause_refresh
198
- tree_item = swt_widget.getSelection.first
199
- rename_tree_item(tree_item)
200
- end
201
-
202
- def rename_tree_item(tree_item, new_file = false)
203
- original_file = tree_item.getData
204
- current_file = project_dir.selected_child_path == original_file.path
205
- found_tab_item = gladiator.find_tab_item(original_file.path)
206
- found_text_editor = found_tab_item&.getData('text_editor')
207
- body_root.edit_tree_item(
208
- tree_item,
209
- after_write: -> (edited_tree_item) {
210
- file = edited_tree_item.getData
211
- file_path = file.path
212
- file.name
213
- if ::File.file?(file_path)
214
- if new_file
215
- project_dir.selected_child_path = file_path
216
- else
217
- found_text_editor&.file = file
218
- found_tab_item&.setData('file', file)
219
- found_tab_item&.setData('file_path', file.path)
220
- found_tab_item&.setText(file.name)
221
- body_root.pack_same_size
222
- if current_file
223
- project_dir.selected_child_path = file_path
224
- else
225
- selected_tab_item&.getData('text_editor')&.text_widget&.setFocus
226
- end
227
- async_exec {
228
- swt_widget.showItem(edited_tree_item)
229
- }
230
- end
231
- end
232
- project_dir.resume_refresh
233
- },
234
- after_cancel: -> {
235
- project_dir.resume_refresh
236
- }
237
- )
238
- end
239
-
240
- end
241
-
242
- end
243
-
244
- end
1
+ # Copyright (c) 2020-2022 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ module Glimmer
23
+ class Gladiator
24
+ class FileExplorerTree
25
+ include Glimmer::UI::CustomWidget
26
+
27
+ options :gladiator, :foreground_color
28
+
29
+ body {
30
+ tree {
31
+ #visible bind(self, 'project_dir.filter') {|f| !f}
32
+ items bind(self, :project_dir), tree_properties(children: :children, text: :name)
33
+ foreground foreground_color
34
+ drag_source(:drop_copy) {
35
+ transfer :text
36
+ on_drag_set_data { |event|
37
+ Gladiator.drag = true
38
+ tree = event.widget.getControl
39
+ tree_item = tree.getSelection.first
40
+ event.data = tree_item.getData.path
41
+ }
42
+ }
43
+
44
+ menu {
45
+ @open_menu_item = menu_item {
46
+ text 'Open'
47
+ on_widget_selected {
48
+ project_dir.selected_child_path = extract_tree_item_path(swt_widget.getSelection.first)
49
+ }
50
+ }
51
+ menu_item(:separator)
52
+ menu_item {
53
+ text 'Delete'
54
+ on_widget_selected {
55
+ tree_item = swt_widget.getSelection.first
56
+ delete_tree_item(tree_item)
57
+ }
58
+ }
59
+ menu_item {
60
+ text 'Refresh'
61
+ on_widget_selected {
62
+ project_dir.refresh
63
+ }
64
+ }
65
+ menu_item {
66
+ text 'Rename'
67
+ on_widget_selected {
68
+ rename_selected_tree_item
69
+ }
70
+ }
71
+ menu_item {
72
+ text 'New Directory'
73
+ on_widget_selected {
74
+ add_new_directory_to_selected_tree_item
75
+ }
76
+ }
77
+ menu_item {
78
+ text 'New File'
79
+ on_widget_selected {
80
+ add_new_file_to_selected_tree_item
81
+ }
82
+ }
83
+ }
84
+
85
+ on_swt_menudetect { |event|
86
+ path = extract_tree_item_path(swt_widget.getSelection.first)
87
+ @open_menu_item.swt_widget.setEnabled(!::Dir.exist?(path)) if path
88
+ }
89
+ on_mouse_up {
90
+ if Gladiator.drag_and_drop
91
+ Gladiator.drag_and_drop = false
92
+ else
93
+ project_dir.selected_child_path = extract_tree_item_path(swt_widget.getSelection&.first)
94
+ gladiator.current_text_editor&.text_widget&.setFocus
95
+ end
96
+ }
97
+ on_key_pressed { |key_event|
98
+ if Glimmer::SWT::SWTProxy.include?(key_event.keyCode, :cr)
99
+ project_dir.selected_child_path = extract_tree_item_path(swt_widget.getSelection&.first)
100
+ gladiator.current_text_editor&.text_widget&.setFocus
101
+ end
102
+ }
103
+ on_paint_control {
104
+ root_item = swt_widget.getItems.first
105
+ if root_item && !root_item.getExpanded
106
+ root_item.setExpanded(true)
107
+ end
108
+ }
109
+
110
+ }
111
+ }
112
+
113
+ def project_dir
114
+ gladiator.project_dir
115
+ end
116
+
117
+ def current_text_editor
118
+ gladiator.current_text_editor
119
+ end
120
+
121
+ def extract_tree_item_path(tree_item)
122
+ return if tree_item.nil?
123
+ if tree_item.getParentItem
124
+ ::File.join(extract_tree_item_path(tree_item.getParentItem), tree_item.getText)
125
+ else
126
+ project_dir.path
127
+ end
128
+ end
129
+
130
+ def select_tree_item
131
+ return unless project_dir.selected_child&.name
132
+ tree_items_to_select = body_root.depth_first_search { |ti| ti.getData.path == project_dir.selected_child.path }
133
+ swt_widget.setSelection(tree_items_to_select)
134
+ end
135
+
136
+ def delete_tree_item(tree_item)
137
+ return if tree_item.nil?
138
+ file = tree_item.getData
139
+ parent_path = ::File.dirname(file.path)
140
+ if file.is_a?(Gladiator::Dir)
141
+ file_paths = file.all_children.select {|f| f.is_a?(Gladiator::File)}.map(&:path)
142
+ file.remove_all_observers
143
+ else
144
+ file_paths = [file.path]
145
+ end
146
+ file_paths.each do |file_path|
147
+ found_tab_item = gladiator.find_tab_item(file_path)
148
+ if found_tab_item
149
+ project_dir.selected_child_path_history.delete(found_tab_item.getData('file_path'))
150
+ found_tab_item.getData('proxy')&.dispose
151
+ end
152
+ end
153
+ file.remove! # TODO consider supporting command undo/redo
154
+ project_dir.refresh(async: false)
155
+ parent_tree_item = body_root.depth_first_search {|ti| ti.getData.path == parent_path}.first
156
+ swt_widget.showItem(parent_tree_item)
157
+ parent_tree_item.setExpanded(true)
158
+ rescue => e
159
+ puts e.full_message
160
+ end
161
+
162
+ def add_new_directory_to_selected_tree_item
163
+ project_dir.pause_refresh
164
+ tree_item = swt_widget.getSelection.first
165
+ directory_path = extract_tree_item_path(tree_item)
166
+ return if directory_path.nil?
167
+ if !::Dir.exist?(directory_path)
168
+ tree_item = tree_item.getParentItem
169
+ directory_path = ::File.dirname(directory_path)
170
+ end
171
+ new_directory_path = ::File.expand_path(::File.join(directory_path, 'new_directory'))
172
+ FileUtils.mkdir_p(new_directory_path)
173
+ project_dir.refresh(async: false, force: true)
174
+ new_tree_item = body_root.depth_first_search {|ti| ti.getData.path == new_directory_path}.first
175
+ swt_widget.showItem(new_tree_item)
176
+ rename_tree_item(new_tree_item)
177
+ end
178
+
179
+ def add_new_file_to_selected_tree_item
180
+ project_dir.pause_refresh
181
+ tree_item = swt_widget.getSelection.first
182
+ directory_path = extract_tree_item_path(tree_item)
183
+ if !::Dir.exist?(directory_path)
184
+ tree_item = tree_item.getParentItem
185
+ directory_path = ::File.dirname(directory_path)
186
+ end
187
+ new_file_path = ::File.expand_path(::File.join(directory_path, 'new_file'))
188
+ FileUtils.touch(new_file_path)
189
+ # TODO look into refreshing only the parent directory to avoid slowdown
190
+ project_dir.refresh(async: false, force: true)
191
+ new_tree_item = body_root.depth_first_search {|ti| ti.getData.path == new_file_path}.first
192
+ swt_widget.showItem(new_tree_item)
193
+ rename_tree_item(new_tree_item, true)
194
+ end
195
+
196
+ def rename_selected_tree_item
197
+ project_dir.pause_refresh
198
+ tree_item = swt_widget.getSelection.first
199
+ rename_tree_item(tree_item)
200
+ end
201
+
202
+ def rename_tree_item(tree_item, new_file = false)
203
+ original_file = tree_item.getData
204
+ current_file = project_dir.selected_child_path == original_file.path
205
+ found_tab_item = gladiator.find_tab_item(original_file.path)
206
+ found_text_editor = found_tab_item&.getData('text_editor')
207
+ body_root.edit_tree_item(
208
+ tree_item,
209
+ after_write: -> (edited_tree_item) {
210
+ file = edited_tree_item.getData
211
+ file_path = file.path
212
+ file.name
213
+ if ::File.file?(file_path)
214
+ if new_file
215
+ project_dir.selected_child_path = file_path
216
+ else
217
+ found_text_editor&.file = file
218
+ found_tab_item&.setData('file', file)
219
+ found_tab_item&.setData('file_path', file.path)
220
+ found_tab_item&.setText(file.name)
221
+ if current_file
222
+ project_dir.selected_child_path = file_path
223
+ else
224
+ gladiator.selected_tab_item&.getData('text_editor')&.text_widget&.setFocus
225
+ end
226
+ async_exec {
227
+ swt_widget.showItem(edited_tree_item)
228
+ gladiator.body_root.pack_same_size
229
+ }
230
+ end
231
+ end
232
+ project_dir.resume_refresh
233
+ },
234
+ after_cancel: -> {
235
+ project_dir.resume_refresh
236
+ }
237
+ )
238
+ end
239
+
240
+ end
241
+
242
+ end
243
+
244
+ end
@@ -1,64 +1,63 @@
1
- # Copyright (c) 2020-2021 Andy Maleh
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining
4
- # a copy of this software and associated documentation files (the
5
- # "Software"), to deal in the Software without restriction, including
6
- # without limitation the rights to use, copy, modify, merge, publish,
7
- # distribute, sublicense, and/or sell copies of the Software, and to
8
- # permit persons to whom the Software is furnished to do so, subject to
9
- # the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be
12
- # included in all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
-
22
- module Glimmer
23
- class Gladiator
24
- class FileLookupList
25
- include Glimmer::UI::CustomWidget
26
-
27
- options :gladiator, :foreground_color
28
-
29
- body {
30
- list(:border, :h_scroll, :v_scroll) {
31
- selection bind(project_dir, :filtered_path)
32
- # visible bind(project_dir, 'filter') {|f| pd swt_widget&.get_shell&.get_data('proxy'); swt_widget&.get_shell&.get_data('proxy')&.pack_same_size; !!f}
33
- foreground foreground_color
34
- on_mouse_up {
35
- project_dir.selected_child_path = swt_widget.getSelection.first
36
- }
37
- on_key_pressed { |key_event|
38
- if Glimmer::SWT::SWTProxy.include?(key_event.keyCode, :cr)
39
- project_dir.selected_child_path = swt_widget.getSelection.first
40
- current_text_editor&.text_widget&.setFocus
41
- end
42
- }
43
- drag_source(DND::DROP_COPY) {
44
- transfer :text
45
- on_drag_set_data { |event|
46
- Gladiator.drag = true
47
- list = event.widget.getControl
48
- event.data = list.getSelection.first
49
- }
50
- }
51
- }
52
- }
53
-
54
- def project_dir
55
- gladiator.project_dir
56
- end
57
-
58
- def current_text_editor
59
- gladiator.current_text_editor
60
- end
61
-
62
- end
63
- end
64
- end
1
+ # Copyright (c) 2020-2022 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ module Glimmer
23
+ class Gladiator
24
+ class FileLookupList
25
+ include Glimmer::UI::CustomWidget
26
+
27
+ options :gladiator, :foreground_color
28
+
29
+ body {
30
+ list(:border, :h_scroll, :v_scroll) {
31
+ selection bind(project_dir, :filtered_path)
32
+ foreground foreground_color
33
+ on_mouse_up {
34
+ project_dir.selected_child_path = swt_widget.getSelection.first
35
+ }
36
+ on_key_pressed { |key_event|
37
+ if Glimmer::SWT::SWTProxy.include?(key_event.keyCode, :cr)
38
+ project_dir.selected_child_path = swt_widget.getSelection.first
39
+ current_text_editor&.text_widget&.setFocus
40
+ end
41
+ }
42
+ drag_source(DND::DROP_COPY) {
43
+ transfer :text
44
+ on_drag_set_data { |event|
45
+ Gladiator.drag = true
46
+ list = event.widget.getControl
47
+ event.data = list.getSelection.first
48
+ }
49
+ }
50
+ }
51
+ }
52
+
53
+ def project_dir
54
+ gladiator.project_dir
55
+ end
56
+
57
+ def current_text_editor
58
+ gladiator.current_text_editor
59
+ end
60
+
61
+ end
62
+ end
63
+ end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020-2021 Andy Maleh
1
+ # Copyright (c) 2020-2022 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -32,7 +32,7 @@ module Glimmer
32
32
  text '&File'
33
33
 
34
34
  menu_item {
35
- text 'New &Scratchpad'
35
+ text 'Open &Scratchpad'
36
36
  accelerator COMMAND_KEY, :shift, :s
37
37
  enabled editing
38
38
  on_widget_selected {
@@ -49,7 +49,7 @@ module Glimmer
49
49
  menu_item(:separator)
50
50
  menu_item {
51
51
  text '&Quit Project'
52
- accelerator COMMAND_KEY, :alt, :q
52
+ accelerator :alt, :f4
53
53
  on_widget_selected {
54
54
  gladiator.save_config
55
55
  project_dir.selected_child&.write_dirty_content
@@ -191,8 +191,8 @@ module Glimmer
191
191
 
192
192
  styled_text(:border, :h_scroll, :v_scroll) {
193
193
  layout_data {
194
- width body_root.bounds.width*0.75
195
- height body_root.bounds.height*0.75
194
+ width gladiator.bounds.width*0.75
195
+ height gladiator.bounds.height*0.75
196
196
  }
197
197
 
198
198
  text message