diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index b6585c4e1f..bca274dd82 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -35,7 +35,7 @@ import RoomListStore from '../../../stores/RoomListStore'; import GroupStore from '../../../stores/GroupStore'; import ResizeHandle from '../elements/ResizeHandle'; -import {Resizer, CollapseDistributor} from '../../../resizer' +import {Resizer, FixedDistributor, FlexSizer} from '../../../resizer' const HIDE_CONFERENCE_CHANS = true; const STANDARD_TAGS_REGEX = /^(m\.(favourite|lowpriority|server_notice)|im\.vector\.fake\.(invite|recent|direct|archived))$/; diff --git a/src/resizer/index.js b/src/resizer/index.js index f0c5878a1d..df7a839b9b 100644 --- a/src/resizer/index.js +++ b/src/resizer/index.js @@ -14,13 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -import {Sizer} from "./sizer"; +import {Sizer, FlexSizer} from "./sizer"; import {FixedDistributor, CollapseDistributor, PercentageDistributor} from "./distributors"; import {Resizer} from "./resizer"; module.exports = { Resizer, Sizer, + FlexSizer, FixedDistributor, CollapseDistributor, PercentageDistributor, diff --git a/src/resizer/sizer.js b/src/resizer/sizer.js index b8d1c55dd0..fb4e860d4e 100644 --- a/src/resizer/sizer.js +++ b/src/resizer/sizer.js @@ -97,4 +97,11 @@ class Sizer { } } -module.exports = {Sizer}; +class FlexSizer extends Sizer { + setItemSize(item, size) { + item.style.flexGrow = '0'; + item.style.flexBasis = `${Math.round(size)}px`; + } +} + +module.exports = {Sizer, FlexSizer};