Pārlūkot izejas kodu

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 gadus atpakaļ
vecāks
revīzija
aefd13ab1b

+ 0
- 10
css/filmstrip/_tile_view.scss Parādīt failu

@@ -109,14 +109,4 @@
109 109
     .has-overflow .videocontainer {
110 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 Parādīt failu

@@ -6,9 +6,9 @@ import { SET_HORIZONTAL_VIEW_DIMENSIONS, SET_TILE_VIEW_DIMENSIONS } from './acti
6 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 14
  * Sets the dimensions of the tile view grid.
@@ -24,21 +24,15 @@ const TILE_VIEW_SIDE_MARGINS = 10 * 2;
24 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 28
     const { clientWidth, clientHeight } = windowSize;
30
-    let heightToUse = clientHeight;
29
+    const heightToUse = clientHeight;
31 30
     let widthToUse = clientWidth;
32 31
 
33 32
     if (isChatOpen) {
34 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 36
     const thumbnailSize = calculateThumbnailSizeForTileView({
43 37
         ...dimensions,
44 38
         clientWidth: widthToUse,

+ 6
- 7
react/features/filmstrip/functions.web.js Parādīt failu

@@ -10,6 +10,10 @@ import { TILE_ASPECT_RATIO } from './constants';
10 10
 
11 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 18
  * Returns true if the filmstrip on mobile is visible, false otherwise.
15 19
  *
@@ -94,13 +98,8 @@ export function calculateThumbnailSizeForTileView({
94 98
     clientWidth,
95 99
     clientHeight
96 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 103
     const initialWidth = viewWidth / columns;
105 104
     const aspectRatioHeight = initialWidth / TILE_ASPECT_RATIO;
106 105
     const height = Math.floor(Math.min(aspectRatioHeight, viewHeight / visibleRows));

+ 1
- 3
react/features/filmstrip/middleware.web.js Parādīt failu

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

+ 3
- 36
react/features/filmstrip/subscriber.web.js Parādīt failu

@@ -22,7 +22,6 @@ StateListenerRegistry.register(
22 22
             if (!equals(gridDimensions, oldGridDimensions)) {
23 23
                 const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
24 24
                 const { isOpen } = state['features/chat'];
25
-                const { visible } = state['features/toolbox'];
26 25
 
27 26
                 store.dispatch(
28 27
                     setTileViewDimensions(
@@ -31,8 +30,7 @@ StateListenerRegistry.register(
31 30
                             clientHeight,
32 31
                             clientWidth
33 32
                         },
34
-                        isOpen,
35
-                        visible
33
+                        isOpen
36 34
                     )
37 35
                 );
38 36
             }
@@ -51,7 +49,6 @@ StateListenerRegistry.register(
51 49
         case LAYOUTS.TILE_VIEW: {
52 50
             const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
53 51
             const { isOpen } = state['features/chat'];
54
-            const { visible } = state['features/toolbox'];
55 52
 
56 53
             store.dispatch(
57 54
                 setTileViewDimensions(
@@ -60,8 +57,7 @@ StateListenerRegistry.register(
60 57
                         clientHeight,
61 58
                         clientWidth
62 59
                     },
63
-                    isOpen,
64
-                    visible
60
+                    isOpen
65 61
                 )
66 62
             );
67 63
             break;
@@ -114,7 +110,6 @@ StateListenerRegistry.register(
114 110
         if (shouldDisplayTileView(state)) {
115 111
             const gridDimensions = getTileViewGridDimensions(state);
116 112
             const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
117
-            const { visible } = state['features/toolbox'];
118 113
 
119 114
             store.dispatch(
120 115
                 setTileViewDimensions(
@@ -123,35 +118,7 @@ StateListenerRegistry.register(
123 118
                         clientHeight,
124 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
         }

Notiek ielāde…
Atcelt
Saglabāt