Improve "Pin on top" icon in RTMP streams.

This commit is contained in:
John Preston 2022-03-04 13:19:37 +04:00
parent b5aafa521a
commit 37e5157d5a
6 changed files with 14 additions and 32 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -493,6 +493,8 @@ callErrorToast: Toast(defaultToast) {
groupCallWidth: 380px;
groupCallHeight: 580px;
groupCallWidthRtmp: 720px;
groupCallHeightRtmp: 580px;
groupCallHeightRtmpMin: 280px;
groupCallRipple: RippleAnimation(defaultRippleAnimation) {
@ -1121,9 +1123,9 @@ groupCallTitle: WindowTitle(defaultWindowTitle) {
closeIconActiveOver: groupCallTitleCloseIconOver;
}
groupCallPinOnTop: IconButton(groupCallTitleButton) {
icon: icon{{ "dialogs/dialogs_pinned", groupCallMemberNotJoinedStatus }};
iconOver: icon{{ "dialogs/dialogs_pinned", groupCallMembersFg }};
iconPosition: point(8px, 4px);
icon: icon{{ "calls/navbar_pin", groupCallMemberNotJoinedStatus }};
iconOver: icon{{ "calls/navbar_pin", groupCallMembersFg }};
iconPosition: point(0px, 4px);
}
groupCallMajorBlobIdleRadius: 2px;

View file

@ -888,31 +888,6 @@ void Panel::enlargeVideo() {
}
}
void Panel::minimizeVideo() {
if (window()->windowState() & Qt::WindowMaximized) {
_lastLargeMaximized = true;
window()->setWindowState(
window()->windowState() & ~Qt::WindowMaximized);
} else {
_lastLargeMaximized = false;
_lastLargeGeometry = window()->geometry();
}
const auto available = window()->screen()->availableGeometry();
const auto width = st::groupCallWidth;
const auto height = _call->rtmp()
? st::groupCallHeightRtmpMin
: st::groupCallHeight;
const auto geometry = QRect(
window()->x() + (window()->width() - width) / 2,
window()->y() + (window()->height() - height) / 2,
width,
height);
window()->setGeometry((_lastSmallGeometry
&& available.intersects(*_lastSmallGeometry))
? *_lastSmallGeometry
: geometry);
}
void Panel::raiseControls() {
if (_controlsBackgroundWide) {
_controlsBackgroundWide->raise();
@ -1501,12 +1476,18 @@ rpl::lifetime &Panel::lifetime() {
void Panel::initGeometry() {
const auto center = Core::App().getPointForCallPanelCenter();
const auto height = (_call->rtmp() && !_call->canManage())
const auto width = _call->rtmp()
? st::groupCallWidthRtmp
: st::groupCallWidth;
const auto height = _call->rtmp()
? st::groupCallHeightRtmp
: st::groupCallHeight;
const auto minHeight = (_call->rtmp() && !_call->canManage())
? st::groupCallHeightRtmpMin
: st::groupCallHeight;
const auto rect = QRect(0, 0, st::groupCallWidth, height);
const auto rect = QRect(0, 0, width, height);
window()->setGeometry(rect.translated(center - rect.center()));
window()->setMinimumSize(rect.size());
window()->setMinimumSize({ st::groupCallWidth, minHeight });
window()->show();
}

View file

@ -134,7 +134,6 @@ private:
void trackControls(bool track, bool force = false);
void raiseControls();
void enlargeVideo();
void minimizeVideo();
void trackControl(Ui::RpWidget *widget, rpl::lifetime &lifetime);
void trackControlOver(not_null<Ui::RpWidget*> control, bool over);