浏览代码

fix(tile-view) reduce margins, take 2

Due to how the filmstrip size if computed I don't think there is a good way to
animate the change in size, so just ignore the toolbar, it will be hidden soon
enough.
master
Saúl Ibarra Corretgé 4 年前
父节点
当前提交
aefd13ab1b

+ 0
- 10
css/filmstrip/_tile_view.scss 查看文件

109
     .has-overflow .videocontainer {
109
     .has-overflow .videocontainer {
110
         align-self: baseline;
110
         align-self: baseline;
111
     }
111
     }
112
-
113
-    /**
114
-     * Firefox flex acts a little differently. To make sure the bottom row of
115
-     * thumbnails is not overlapped by the horizontal toolbar, margin is added
116
-     * to the local thumbnail to keep it from the bottom of the screen. It is
117
-     * assumed the local thumbnail will always be on the bottom row.
118
-     */
119
-    .has-overflow #localVideoContainer {
120
-        margin-bottom: 100px !important;
121
-    }
122
 }
112
 }

+ 4
- 10
react/features/filmstrip/actions.web.js 查看文件

6
 import { calculateThumbnailSizeForHorizontalView, calculateThumbnailSizeForTileView } from './functions';
6
 import { calculateThumbnailSizeForHorizontalView, calculateThumbnailSizeForTileView } from './functions';
7
 
7
 
8
 /**
8
 /**
9
- * The size of the side margins for each tile as set in CSS.
9
+ * The size of the side margins for the entire tile view area.
10
  */
10
  */
11
-const TILE_VIEW_SIDE_MARGINS = 10 * 2;
11
+const TILE_VIEW_SIDE_MARGINS = 20;
12
 
12
 
13
 /**
13
 /**
14
  * Sets the dimensions of the tile view grid.
14
  * Sets the dimensions of the tile view grid.
24
  *     dimensions: Object
24
  *     dimensions: Object
25
  * }}
25
  * }}
26
  */
26
  */
27
-export function setTileViewDimensions(
28
-        dimensions: Object, windowSize: Object, isChatOpen: boolean, isToolboxVisible: boolean) {
27
+export function setTileViewDimensions(dimensions: Object, windowSize: Object, isChatOpen: boolean) {
29
     const { clientWidth, clientHeight } = windowSize;
28
     const { clientWidth, clientHeight } = windowSize;
30
-    let heightToUse = clientHeight;
29
+    const heightToUse = clientHeight;
31
     let widthToUse = clientWidth;
30
     let widthToUse = clientWidth;
32
 
31
 
33
     if (isChatOpen) {
32
     if (isChatOpen) {
34
         widthToUse -= CHAT_SIZE;
33
         widthToUse -= CHAT_SIZE;
35
     }
34
     }
36
 
35
 
37
-    if (isToolboxVisible) {
38
-        // The distance from the top and bottom of the screen, to avoid overlapping UI elements.
39
-        heightToUse -= 150;
40
-    }
41
-
42
     const thumbnailSize = calculateThumbnailSizeForTileView({
36
     const thumbnailSize = calculateThumbnailSizeForTileView({
43
         ...dimensions,
37
         ...dimensions,
44
         clientWidth: widthToUse,
38
         clientWidth: widthToUse,

+ 6
- 7
react/features/filmstrip/functions.web.js 查看文件

10
 
10
 
11
 declare var interfaceConfig: Object;
11
 declare var interfaceConfig: Object;
12
 
12
 
13
+// Minimum space to keep between the sides of the tiles and the sides
14
+// of the window.
15
+const TILE_VIEW_SIDE_MARGINS = 20;
16
+
13
 /**
17
 /**
14
  * Returns true if the filmstrip on mobile is visible, false otherwise.
18
  * Returns true if the filmstrip on mobile is visible, false otherwise.
15
  *
19
  *
94
     clientWidth,
98
     clientWidth,
95
     clientHeight
99
     clientHeight
96
 }: Object) {
100
 }: Object) {
97
-    // Minimum space to keep between the sides of the tiles and the sides
98
-    // of the window.
99
-    const sideMargins = 30 * 2;
100
-
101
-    const verticalMargins = visibleRows * 10;
102
-    const viewWidth = clientWidth - sideMargins;
103
-    const viewHeight = clientHeight - verticalMargins;
101
+    const viewWidth = clientWidth - TILE_VIEW_SIDE_MARGINS;
102
+    const viewHeight = clientHeight - TILE_VIEW_SIDE_MARGINS;
104
     const initialWidth = viewWidth / columns;
103
     const initialWidth = viewWidth / columns;
105
     const aspectRatioHeight = initialWidth / TILE_ASPECT_RATIO;
104
     const aspectRatioHeight = initialWidth / TILE_ASPECT_RATIO;
106
     const height = Math.floor(Math.min(aspectRatioHeight, viewHeight / visibleRows));
105
     const height = Math.floor(Math.min(aspectRatioHeight, viewHeight / visibleRows));

+ 1
- 3
react/features/filmstrip/middleware.web.js 查看文件

30
             const { gridDimensions } = state['features/filmstrip'].tileViewDimensions;
30
             const { gridDimensions } = state['features/filmstrip'].tileViewDimensions;
31
             const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
31
             const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
32
             const { isOpen } = state['features/chat'];
32
             const { isOpen } = state['features/chat'];
33
-            const { visible } = state['features/toolbox'];
34
 
33
 
35
             store.dispatch(
34
             store.dispatch(
36
                 setTileViewDimensions(
35
                 setTileViewDimensions(
39
                         clientHeight,
38
                         clientHeight,
40
                         clientWidth
39
                         clientWidth
41
                     },
40
                     },
42
-                    isOpen,
43
-                    visible
41
+                    isOpen
44
                 )
42
                 )
45
             );
43
             );
46
             break;
44
             break;

+ 3
- 36
react/features/filmstrip/subscriber.web.js 查看文件

22
             if (!equals(gridDimensions, oldGridDimensions)) {
22
             if (!equals(gridDimensions, oldGridDimensions)) {
23
                 const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
23
                 const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
24
                 const { isOpen } = state['features/chat'];
24
                 const { isOpen } = state['features/chat'];
25
-                const { visible } = state['features/toolbox'];
26
 
25
 
27
                 store.dispatch(
26
                 store.dispatch(
28
                     setTileViewDimensions(
27
                     setTileViewDimensions(
31
                             clientHeight,
30
                             clientHeight,
32
                             clientWidth
31
                             clientWidth
33
                         },
32
                         },
34
-                        isOpen,
35
-                        visible
33
+                        isOpen
36
                     )
34
                     )
37
                 );
35
                 );
38
             }
36
             }
51
         case LAYOUTS.TILE_VIEW: {
49
         case LAYOUTS.TILE_VIEW: {
52
             const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
50
             const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
53
             const { isOpen } = state['features/chat'];
51
             const { isOpen } = state['features/chat'];
54
-            const { visible } = state['features/toolbox'];
55
 
52
 
56
             store.dispatch(
53
             store.dispatch(
57
                 setTileViewDimensions(
54
                 setTileViewDimensions(
60
                         clientHeight,
57
                         clientHeight,
61
                         clientWidth
58
                         clientWidth
62
                     },
59
                     },
63
-                    isOpen,
64
-                    visible
60
+                    isOpen
65
                 )
61
                 )
66
             );
62
             );
67
             break;
63
             break;
114
         if (shouldDisplayTileView(state)) {
110
         if (shouldDisplayTileView(state)) {
115
             const gridDimensions = getTileViewGridDimensions(state);
111
             const gridDimensions = getTileViewGridDimensions(state);
116
             const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
112
             const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
117
-            const { visible } = state['features/toolbox'];
118
 
113
 
119
             store.dispatch(
114
             store.dispatch(
120
                 setTileViewDimensions(
115
                 setTileViewDimensions(
123
                         clientHeight,
118
                         clientHeight,
124
                         clientWidth
119
                         clientWidth
125
                     },
120
                     },
126
-                    isChatOpen,
127
-                    visible
128
-                )
129
-            );
130
-        }
131
-    });
132
-
133
-/**
134
- * Listens for changes in the chat state to calculate the dimensions of the tile view grid and the tiles.
135
- */
136
-StateListenerRegistry.register(
137
-    /* selector */ state => state['features/toolbox'].visible,
138
-    /* listener */ (visible, store) => {
139
-        const state = store.getState();
140
-
141
-        if (shouldDisplayTileView(state)) {
142
-            const gridDimensions = getTileViewGridDimensions(state);
143
-            const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
144
-            const { isOpen } = state['features/chat'];
145
-
146
-            store.dispatch(
147
-                setTileViewDimensions(
148
-                    gridDimensions,
149
-                    {
150
-                        clientHeight,
151
-                        clientWidth
152
-                    },
153
-                    isOpen,
154
-                    visible
121
+                    isChatOpen
155
                 )
122
                 )
156
             );
123
             );
157
         }
124
         }

正在加载...
取消
保存