Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale down dragged Participants in Call (#190) #191

Merged
merged 16 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ All user visible changes to this project will be documented in this file. This p
- UI:
- Home page:
- Redesigned chats tab. ([#142])
- Media panel:
- Video resizing when dragged. ([#191], [#190])

### Fixed

Expand All @@ -26,6 +28,8 @@ All user visible changes to this project will be documented in this file. This p
- Context menu not opening over video previews. ([#198], [#196])

[#142]: /../../pull/142
[#190]: /../../issues/190
[#191]: /../../pull/191
[#192]: /../../issues/192
[#193]: /../../pull/193
[#196]: /../../issues/196
Expand Down
21 changes: 19 additions & 2 deletions lib/ui/page/call/component/desktop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,15 @@ Widget _primaryView(CallController c) {
});
},
decoratorBuilder: (_) => const ParticipantDecoratorWidget(),
itemConstraints: (_DragData data) {
if (data.participant.video.value != null ||
data.participant.user.value?.user.value.callCover != null) {
final double size = (c.size.longestSide * 0.33).clamp(100, 250);
return BoxConstraints(maxWidth: size, maxHeight: size);
}

return null;
},
itemBuilder: (_DragData data) {
var participant = data.participant;
return Obx(() {
Expand Down Expand Up @@ -1849,8 +1858,16 @@ Widget _secondaryView(CallController c, BuildContext context) {
);
});
},
decoratorBuilder: (_DragData item) =>
const ParticipantDecoratorWidget(),
decoratorBuilder: (_) => const ParticipantDecoratorWidget(),
itemConstraints: (_DragData data) {
if (data.participant.video.value != null ||
data.participant.user.value?.user.value.callCover != null) {
final double size = (c.size.longestSide * 0.33).clamp(100, 250);
return BoxConstraints(maxWidth: size, maxHeight: size);
}

return null;
},
itemBuilder: (_DragData data) {
var participant = data.participant;
return Obx(
Expand Down
2 changes: 2 additions & 0 deletions lib/ui/page/call/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,8 @@ class CallController extends GetxController {
primary.value = focused.isNotEmpty ? focused : [...locals, ...remotes];
secondary.value =
focused.isNotEmpty ? [...locals, ...paneled, ...remotes] : paneled;

applySecondaryConstraints();
}

/// Returns all [Participant]s identified by an [id] and [source].
Expand Down
Loading