Follow TitleControlsLayout in the PiP

This commit is contained in:
Ilya Fedin 2022-08-01 10:22:25 +04:00 committed by John Preston
parent 07232e2520
commit be133fce78
1 changed files with 5 additions and 1 deletions

View File

@ -47,7 +47,11 @@ constexpr auto kPipLoaderPriority = 2;
constexpr auto kMsInSecond = 1000;
[[nodiscard]] bool IsWindowControlsOnLeft() {
return Platform::IsMac();
using Control = Ui::Platform::TitleControls::Control;
const auto controlsLayout = Ui::Platform::TitleControlsLayout();
return ranges::contains(controlsLayout.left, Control::Close)
|| (controlsLayout.left.size() > controlsLayout.right.size()
&& !ranges::contains(controlsLayout.right, Control::Close));
}
[[nodiscard]] QRect ScreenFromPosition(QPoint point) {