@@ -12,16 +12,16 @@ const PluginControls = function (grid, x, y, xSpan, ySpan) {
12
12
mouse : true ,
13
13
interactive : true ,
14
14
keys : true ,
15
-
15
+ vi : true ,
16
+ // alwaysScroll: true,
16
17
padding : { left : 1 , right : 1 } ,
17
- mouse : true ,
18
+
19
+ scrollable : true ,
20
+ focusable : true ,
18
21
scrollbar : {
19
22
ch : " " ,
20
23
inverse : true ,
21
24
} ,
22
- scrollable : true ,
23
- focusable : true ,
24
-
25
25
style : {
26
26
border : { fg : "#7ea87f" } ,
27
27
focus : {
@@ -31,6 +31,14 @@ const PluginControls = function (grid, x, y, xSpan, ySpan) {
31
31
} ,
32
32
} ) ;
33
33
34
+ pluginControls . key ( [ "pageup" ] , ( c , x ) => {
35
+ pluginControls . scroll ( - pluginControls . height ) ;
36
+ } ) ;
37
+
38
+ pluginControls . key ( [ "pagedown" ] , ( c , x ) => {
39
+ pluginControls . scroll ( pluginControls . height ) ;
40
+ } ) ;
41
+
34
42
pluginControls . key ( [ "down" ] , ( e , x ) => {
35
43
Layout . focusNext ( ) ;
36
44
} ) ;
@@ -66,7 +74,8 @@ const PluginControls = function (grid, x, y, xSpan, ySpan) {
66
74
values [ control . symbol ] ,
67
75
y ,
68
76
control ,
69
- plugin
77
+ plugin ,
78
+ pluginControls
70
79
) ;
71
80
pluginControls . append ( controlWidget ) ;
72
81
pluginControls . scrollable = true ;
@@ -106,7 +115,7 @@ const PluginControls = function (grid, x, y, xSpan, ySpan) {
106
115
* @param {pluginInstance } pluginInstance
107
116
* @returns Returns the progress control blessed widget.
108
117
*/
109
- function progressControl ( value , top , pluginControl , pluginInstance ) {
118
+ function progressControl ( value , top , pluginControl , pluginInstance , parent ) {
110
119
const {
111
120
comment,
112
121
designation,
@@ -121,24 +130,22 @@ function progressControl(value, top, pluginControl, pluginInstance) {
121
130
units,
122
131
} = pluginControl ;
123
132
124
- var box = blessed . box ( {
133
+ let box = blessed . box ( {
125
134
interactive : false ,
126
- focusable : false ,
135
+ focusable : true ,
136
+
127
137
top : top ,
138
+ height : 3 ,
139
+ // bg: "green",
140
+ right : 2 ,
141
+ left : 2 ,
142
+ // alwaysScroll: true,
143
+ scrollable : true ,
128
144
} ) ;
129
145
130
146
box . value = parseControlValue ( pluginControl , value ) ;
131
147
const valuePercent = getControlValuePercent ( pluginControl , box . value ) ;
132
148
133
- // Control Label
134
- var label = blessed . text ( {
135
- content : shortName ,
136
- left : 1 ,
137
- top : 1 ,
138
- interactive : false ,
139
- focusable : false ,
140
- } ) ;
141
-
142
149
// Progress Widget
143
150
var progress = blessed . progressbar ( {
144
151
border : {
@@ -166,6 +173,18 @@ function progressControl(value, top, pluginControl, pluginInstance) {
166
173
right : "8" ,
167
174
filled : parseInt ( valuePercent . toString ( ) ) ,
168
175
width : "65%" ,
176
+
177
+ // alwaysScroll: true,
178
+ scrollable : true ,
179
+ } ) ;
180
+
181
+ // Control Label
182
+ let label = blessed . text ( {
183
+ content : shortName ,
184
+ left : 1 ,
185
+ top : 1 ,
186
+ // alwaysScroll: true,
187
+ scrollable : true ,
169
188
} ) ;
170
189
171
190
const valueLabelValue = getControlValueLabel (
@@ -177,8 +196,8 @@ function progressControl(value, top, pluginControl, pluginInstance) {
177
196
content : valueLabelValue ,
178
197
right : 4 ,
179
198
top : 1 ,
180
- interactive : false ,
181
- focusable : false ,
199
+ // alwaysScroll: true ,
200
+ scrollable : true ,
182
201
} ) ;
183
202
184
203
box . append ( label ) ;
@@ -225,6 +244,15 @@ function progressControl(value, top, pluginControl, pluginInstance) {
225
244
"pagedown" ,
226
245
] ,
227
246
function ( e , keys ) {
247
+ if ( keys . name === "pageup" ) {
248
+ parent . scroll ( - 25 ) ;
249
+ return ;
250
+ }
251
+ if ( keys . name === "pagedown" ) {
252
+ parent . scroll ( 25 ) ;
253
+ return ;
254
+ }
255
+
228
256
let newValue = 0 ;
229
257
230
258
// if it is a toggle button, just send 0 or 1
@@ -261,8 +289,8 @@ function progressControl(value, top, pluginControl, pluginInstance) {
261
289
262
290
if ( keys . shift ) step /= 10 ;
263
291
if ( keys . ctrl ) step *= 5 ;
264
- if ( keys . name === "pageup" ) step = - ranges . maximum / 5 ;
265
- if ( keys . name === "pagedown" ) step = ranges . maximum / 5 ;
292
+ // if (keys.name === "pageup") step = -ranges.maximum / 5;
293
+ // if (keys.name === "pagedown") step = ranges.maximum / 5;
266
294
if ( keys . name === "left" ) step = - step ;
267
295
newValue = box . value + step ;
268
296
0 commit comments