瀏覽代碼

feat: add ability to toggle toolbox from tile view

master
Bettenbuk Zoltan 5 年之前
父節點
當前提交
4c3ed190f3

+ 2
- 21
react/features/conference/components/native/Conference.js 查看文件

111
      */
111
      */
112
     _toolboxVisible: boolean,
112
     _toolboxVisible: boolean,
113
 
113
 
114
-    /**
115
-     * The indicator which determines whether the Toolbox is always visible.
116
-     *
117
-     * @private
118
-     */
119
-    _toolboxAlwaysVisible: boolean,
120
-
121
     /**
114
     /**
122
      * The redux {@code dispatch} function.
115
      * The redux {@code dispatch} function.
123
      */
116
      */
298
      * @returns {void}
291
      * @returns {void}
299
      */
292
      */
300
     _onClick() {
293
     _onClick() {
301
-        if (this.props._toolboxAlwaysVisible) {
302
-            return;
303
-        }
304
-
305
         this._setToolboxVisible(!this.props._toolboxVisible);
294
         this._setToolboxVisible(!this.props._toolboxVisible);
306
     }
295
     }
307
 
296
 
407
         leaving
396
         leaving
408
     } = state['features/base/conference'];
397
     } = state['features/base/conference'];
409
     const { reducedUI } = state['features/base/responsive-ui'];
398
     const { reducedUI } = state['features/base/responsive-ui'];
410
-    const { alwaysVisible, visible } = state['features/toolbox'];
399
+    const { visible } = state['features/toolbox'];
411
 
400
 
412
     // XXX There is a window of time between the successful establishment of the
401
     // XXX There is a window of time between the successful establishment of the
413
     // XMPP connection and the subsequent commencement of joining the MUC during
402
     // XMPP connection and the subsequent commencement of joining the MUC during
484
          * @private
473
          * @private
485
          * @type {boolean}
474
          * @type {boolean}
486
          */
475
          */
487
-        _toolboxVisible: visible,
488
-
489
-        /**
490
-         * The indicator which determines whether the Toolbox is always visible.
491
-         *
492
-         * @private
493
-         * @type {boolean}
494
-         */
495
-        _toolboxAlwaysVisible: alwaysVisible
476
+        _toolboxVisible: visible
496
     };
477
     };
497
 }
478
 }
498
 
479
 

+ 17
- 14
react/features/filmstrip/components/native/Thumbnail.js 查看文件

21
 import { ConnectionIndicator } from '../../../connection-indicator';
21
 import { ConnectionIndicator } from '../../../connection-indicator';
22
 import { DisplayNameLabel } from '../../../display-name';
22
 import { DisplayNameLabel } from '../../../display-name';
23
 import { RemoteVideoMenu } from '../../../remote-video-menu';
23
 import { RemoteVideoMenu } from '../../../remote-video-menu';
24
+import { toggleToolboxVisible } from '../../../toolbox';
24
 
25
 
25
 import AudioMutedIndicator from './AudioMutedIndicator';
26
 import AudioMutedIndicator from './AudioMutedIndicator';
26
 import DominantSpeakerIndicator from './DominantSpeakerIndicator';
27
 import DominantSpeakerIndicator from './DominantSpeakerIndicator';
74
      */
75
      */
75
     _videoTrack: Object,
76
     _videoTrack: Object,
76
 
77
 
77
-    /**
78
-     * If true, tapping on the thumbnail will not pin the participant to large
79
-     * video. By default tapping does pin the participant.
80
-     */
81
-    disablePin?: boolean,
82
-
83
     /**
78
     /**
84
      * If true, there will be no color overlay (tint) on the thumbnail
79
      * If true, there will be no color overlay (tint) on the thumbnail
85
      * indicating the participant associated with the thumbnail is displayed on
80
      * indicating the participant associated with the thumbnail is displayed on
105
     /**
100
     /**
106
      * Optional styling to add or override on the Thumbnail component root.
101
      * Optional styling to add or override on the Thumbnail component root.
107
      */
102
      */
108
-    styleOverrides?: Object
103
+    styleOverrides?: Object,
104
+
105
+    /**
106
+     * If true, it tells the thumbnail that it needs to behave differently. E.g. react differently to a single tap.
107
+     */
108
+    tileView?: boolean
109
 };
109
 };
110
 
110
 
111
 /**
111
 /**
130
             _onShowRemoteVideoMenu,
130
             _onShowRemoteVideoMenu,
131
             _styles,
131
             _styles,
132
             _videoTrack: videoTrack,
132
             _videoTrack: videoTrack,
133
-            disablePin,
134
             disableTint,
133
             disableTint,
135
             participant,
134
             participant,
136
-            renderDisplayName
135
+            renderDisplayName,
136
+            tileView
137
         } = this.props;
137
         } = this.props;
138
 
138
 
139
         // We don't render audio in any of the following:
139
         // We don't render audio in any of the following:
152
 
152
 
153
         return (
153
         return (
154
             <Container
154
             <Container
155
-                onClick = { disablePin ? undefined : _onClick }
155
+                onClick = { _onClick }
156
                 onLongPress = {
156
                 onLongPress = {
157
                     showRemoteVideoMenu
157
                     showRemoteVideoMenu
158
                         ? _onShowRemoteVideoMenu : undefined }
158
                         ? _onShowRemoteVideoMenu : undefined }
159
                 style = { [
159
                 style = { [
160
                     styles.thumbnail,
160
                     styles.thumbnail,
161
-                    participant.pinned && !disablePin
161
+                    participant.pinned && !tileView
162
                         ? _styles.thumbnailPinned : null,
162
                         ? _styles.thumbnailPinned : null,
163
                     this.props.styleOverrides || null
163
                     this.props.styleOverrides || null
164
                 ] }
164
                 ] }
234
          * @returns {void}
234
          * @returns {void}
235
          */
235
          */
236
         _onClick() {
236
         _onClick() {
237
-            const { participant } = ownProps;
237
+            const { participant, tileView } = ownProps;
238
 
238
 
239
-            dispatch(
240
-                pinParticipant(participant.pinned ? null : participant.id));
239
+            if (tileView) {
240
+                dispatch(toggleToolboxVisible());
241
+            } else {
242
+                dispatch(pinParticipant(participant.pinned ? null : participant.id));
243
+            }
241
         },
244
         },
242
 
245
 
243
         /**
246
         /**

+ 2
- 2
react/features/filmstrip/components/native/TileView.js 查看文件

298
         return this._getSortedParticipants()
298
         return this._getSortedParticipants()
299
             .map(participant => (
299
             .map(participant => (
300
                 <Thumbnail
300
                 <Thumbnail
301
-                    disablePin = { true }
302
                     disableTint = { true }
301
                     disableTint = { true }
303
                     key = { participant.id }
302
                     key = { participant.id }
304
                     participant = { participant }
303
                     participant = { participant }
305
                     renderDisplayName = { true }
304
                     renderDisplayName = { true }
306
-                    styleOverrides = { styleOverrides } />));
305
+                    styleOverrides = { styleOverrides }
306
+                    tileView = { true } />));
307
     }
307
     }
308
 
308
 
309
     /**
309
     /**

+ 9
- 0
react/features/toolbox/actionTypes.js 查看文件

102
  * }
102
  * }
103
  */
103
  */
104
 export const SET_TOOLBOX_VISIBLE = 'SET_TOOLBOX_VISIBLE';
104
 export const SET_TOOLBOX_VISIBLE = 'SET_TOOLBOX_VISIBLE';
105
+
106
+/**
107
+ * The type of the redux action which toggles the toolbox visibility regardless of it's current state.
108
+ *
109
+ * {
110
+ *     type: TOGGLE_TOOLBOX_VISIBLE
111
+ * }
112
+ */
113
+export const TOGGLE_TOOLBOX_VISIBLE = 'TOGGLE_TOOLBOX_VISIBLE';

+ 15
- 1
react/features/toolbox/actions.native.js 查看文件

8
     SET_TOOLBOX_ENABLED,
8
     SET_TOOLBOX_ENABLED,
9
     SET_TOOLBOX_TIMEOUT,
9
     SET_TOOLBOX_TIMEOUT,
10
     SET_TOOLBOX_TIMEOUT_MS,
10
     SET_TOOLBOX_TIMEOUT_MS,
11
-    SET_TOOLBOX_VISIBLE
11
+    SET_TOOLBOX_VISIBLE,
12
+    TOGGLE_TOOLBOX_VISIBLE
12
 } from './actionTypes';
13
 } from './actionTypes';
13
 
14
 
14
 
15
 
144
         visible
145
         visible
145
     };
146
     };
146
 }
147
 }
148
+
149
+/**
150
+ * Action to toggle the toolbox visibility.
151
+ *
152
+ * @returns {{
153
+ *     type: TOGGLE_TOOLBOX_VISIBLE
154
+ * }}
155
+ */
156
+export function toggleToolboxVisible() {
157
+    return {
158
+        type: TOGGLE_TOOLBOX_VISIBLE
159
+    };
160
+}

+ 6
- 2
react/features/toolbox/reducer.js 查看文件

11
     SET_TOOLBOX_ENABLED,
11
     SET_TOOLBOX_ENABLED,
12
     SET_TOOLBOX_TIMEOUT,
12
     SET_TOOLBOX_TIMEOUT,
13
     SET_TOOLBOX_TIMEOUT_MS,
13
     SET_TOOLBOX_TIMEOUT_MS,
14
-    SET_TOOLBOX_VISIBLE
14
+    SET_TOOLBOX_VISIBLE,
15
+    TOGGLE_TOOLBOX_VISIBLE
15
 } from './actionTypes';
16
 } from './actionTypes';
16
 
17
 
17
 declare var interfaceConfig: Object;
18
 declare var interfaceConfig: Object;
165
             };
166
             };
166
 
167
 
167
         case SET_TOOLBOX_VISIBLE:
168
         case SET_TOOLBOX_VISIBLE:
168
-            return set(state, 'visible', action.visible);
169
+            return set(state, 'visible', state.alwaysVisible || action.visible);
170
+
171
+        case TOGGLE_TOOLBOX_VISIBLE:
172
+            return set(state, 'visible', state.alwaysVisible || !state.visible);
169
         }
173
         }
170
 
174
 
171
         return state;
175
         return state;

Loading…
取消
儲存