Commit Graph

86 Commits

Author SHA1 Message Date
Michael Telatynski
4e93452275 Tweak resizer collapse distributor behaviour to work with the expanding space panel 2021-03-02 14:02:03 +00:00
Michael Telatynski
a5468c918e Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/feat/widgets
 Conflicts:
	src/resizer/distributors/collapse.ts
	src/resizer/distributors/fixed.ts
	src/resizer/index.ts
	src/resizer/item.ts
	src/resizer/resizer.ts
	src/resizer/sizer.ts
2020-10-21 09:56:22 +01:00
Michael Telatynski
01498653d8 update copyrights 2020-10-20 23:42:12 +01:00
Michael Telatynski
329ded92c1 Convert resizer to Typescript
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-20 11:03:03 +01:00
Michael Telatynski
f198b95579 Iterate PR; tidy and improve widget context menu
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-15 15:24:42 +01:00
Michael Telatynski
a6c81a903c Iterate with new buttons and resize locking
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-15 11:14:48 +01:00
Michael Telatynski
447ea9eb23 Relax flexboxes in resizer on window resize
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-13 16:11:58 +01:00
Michael Telatynski
1a45d18b94 Iterate the resizer
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-13 12:28:23 +01:00
Michael Telatynski
340e79179e Convert Resizer to Typescript and create a Percentage based sizer
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-12 16:47:04 +01:00
Michael Telatynski
cffe902504 Add feature to ResizeNotifier to maintain isResizing state and use it to skip onScroll handling 2020-09-02 12:00:35 +01:00
Michael Telatynski
ae65ed5c2e Merge branch 'develop' of https://github.com/matrix-org/matrix-react-sdk into resizable-appsdrawer
 Conflicts:
	res/css/views/rooms/_AppsDrawer.scss
2020-08-20 10:26:35 +01:00
Travis Ralston
52219a8341 Remove legacy resizing code 2020-07-17 15:18:42 -06:00
Pauli Virtanen
11438aeee6 Fix resizer/sizer.js mouse event offset calculation
The event coordinates are document coordinates, so the offset they are
compared to should also be the document one.

Signed-off-by: Pauli Virtanen <pav@iki.fi>
2020-04-30 20:14:48 +03:00
Travis Ralston
0b0fe92b17 Convert resizer to ES6 2019-12-22 20:57:46 -07:00
J. Ryan Stinnett
1dc2ae007f Fix soft crash on room join
This fixes a soft crash that can happen on room join if you keep the right panel
open (which is the default). The `MainSplit` component was not properly testing
for the edge cases of when the resize container would be mounted.

Fixes https://github.com/vector-im/riot-web/issues/10997
2019-10-08 15:43:57 +01:00
Bruno Windels
f029aad9fa rename to getLayout 2019-02-04 18:38:31 +00:00
Bruno Windels
d30ff13c18 pass the layout to the resizer as a lamba to avoid having the wrong layout when filtering 2019-02-04 15:09:44 +00:00
Bruno Windels
529c48d1b0 avoid whitespace and expand all matching section when filtering 2019-01-29 10:01:55 +01:00
Bruno Windels
8d1e105b50 add option for whitespace behaviour and handle height 2019-01-28 18:02:36 +01:00
Bruno Windels
88f25dec4d don't over-constraint layout while resizing
adapting the approach taken in the prototype
2019-01-28 17:52:46 +01:00
Bruno Windels
b0bb4eb5ab better naming 2019-01-28 16:30:34 +01:00
Bruno Windels
d833174d68 floor default section height 2019-01-28 16:29:34 +01:00
Bruno Windels
6e55ebdab7 better naming for anchor 2019-01-28 16:10:50 +01:00
Bruno Windels
dab1f30ab4 remove obsolete logging and comments 2019-01-28 16:08:38 +01:00
Bruno Windels
87720bac2e add comments to fields 2019-01-28 16:03:08 +01:00
Bruno Windels
d56f77debe ignore updates that don't change anything 2019-01-28 16:02:56 +01:00
Bruno Windels
14485b60be assign default height after assigning new sections
also apply it to sections with value null
2019-01-28 16:00:28 +01:00
Bruno Windels
eaf212dd89 fix lint - bis bis 2019-01-28 15:28:56 +01:00
Bruno Windels
f103e60d1d fix lint - bis 2019-01-28 15:22:05 +01:00
Bruno Windels
d08216e857 fix lint 2019-01-28 14:56:14 +01:00
Bruno Windels
bfb1031a6b unify heights stored by id and index, to avoid them getting out of sync
effectively get rid of _originalHeights and calculate the array
from the dictionary when needed
2019-01-28 14:52:40 +01:00
Bruno Windels
0a5e8e6cfe WIP on persisting height across collapse/expand 2019-01-28 14:35:04 +01:00
Bruno Windels
8ffeee6a98 add matthews new resize algo 2019-01-25 18:47:34 +01:00
Bruno Windels
4eb2555fc1 initial support for collapsing 2019-01-24 18:18:10 +01:00
Bruno Windels
b230e65e74 prevent height doubling when resizing
caused by mixing up absolute height with incremental height
2019-01-24 16:44:36 +01:00
Bruno Windels
1092244bbf more fixes for updates/resizing 2019-01-24 15:43:23 +01:00
Bruno Windels
5bddf62d54 WIP to port prototype code 2019-01-23 18:30:51 +01:00
Bruno Windels
313bbaaeaa remove obsolete comments 2019-01-16 11:33:41 +01:00
Travis Ralston
fed256cbaa
Update src/resizer/distributors/roomsublist.js
Co-Authored-By: bwindels <bruno@windels.cloud>
2019-01-16 10:29:30 +00:00
Travis Ralston
98aa657052
Update src/resizer/distributors/collapse.js
Co-Authored-By: bwindels <bruno@windels.cloud>
2019-01-16 10:29:22 +00:00
Travis Ralston
2bd65e14b7
Update src/resizer/distributors/fixed.js
Co-Authored-By: bwindels <bruno@windels.cloud>
2019-01-16 10:29:15 +00:00
Travis Ralston
a5424f32a5
Update src/resizer/item.js
Co-Authored-By: bwindels <bruno@windels.cloud>
2019-01-16 10:29:05 +00:00
Bruno Windels
3c7bed97ac size all items to rendered height when starting drag operation
before, we'd only normalize the sublists that had already been
sized manually. As non-sized items still have flex-basis: auto,
they would claim all the space, and mixing sized and unsized items
would be badly broken.

Now, on the first click, all items are sized to their rendered size
which means they won't flex anymore, but at least the resizing works
this way

Another downside is that when resizing while a sublist is
collapsed, it's reverted to 100px and if a size had been set before,
it's forgotten. No way around this with this approach I'm afraid.
2019-01-15 12:56:48 +01:00
Bruno Windels
aa90e9591a fix min & max size for empty sublists 2019-01-15 12:56:33 +01:00
Bruno Windels
7e395f0fb6 cleanup - part II
reshuffle file structure to make more sense
2019-01-14 20:33:33 +01:00
Bruno Windels
9ecb23ce71 cleanup
- move some methods to ResizeItem subclass
- allow distributor to instanciate sizer and resizeitem it needs
  through static factory methods, instead of passing in another ctor
  a distributor can only function with the right item and sizer anyways.
- use consistent import/export style
- remove obsolete code
2019-01-14 20:24:54 +01:00
Bruno Windels
136dd4a556 stop resize operation when cursor leaves viewport
as mouseup can't be detected outside of viewport
2019-01-11 18:20:34 +01:00
Bruno Windels
a413f358f7 normalize sizes when starting drag operation 2019-01-11 17:17:58 +01:00
Bruno Windels
9456fc040d fix typo 2019-01-11 16:10:35 +01:00
Bruno Windels
92b9a8cc1f persist cleared size sublists 2019-01-10 18:40:26 +01:00