2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Improve floating player show / hide animations.

Also replace Window::Corner with a generic RectPart enumeration.
This commit is contained in:
John Preston
2017-05-24 15:07:58 +03:00
parent 03aeaadd5b
commit c91e29d15d
7 changed files with 155 additions and 78 deletions

View File

@@ -40,7 +40,7 @@ constexpr auto kAutoLockTimeoutLateMs = TimeMs(3000);
AuthSessionData::Variables::Variables()
: selectorTab(ChatHelpers::SelectorTab::Emoji)
, floatPlayerColumn(Window::Column::Second)
, floatPlayerCorner(Window::Corner::TopRight) {
, floatPlayerCorner(RectPart::TopRight) {
}
QByteArray AuthSessionData::serialize() const {
@@ -90,7 +90,7 @@ void AuthSessionData::constructFromSerialized(const QByteArray &serialized) {
qint32 tabbedSelectorSectionEnabled = 1;
qint32 tabbedSelectorSectionTooltipShown = 0;
qint32 floatPlayerColumn = static_cast<qint32>(Window::Column::Second);
qint32 floatPlayerCorner = static_cast<qint32>(Window::Corner::TopRight);
qint32 floatPlayerCorner = static_cast<qint32>(RectPart::TopRight);
QMap<QString, QString> soundOverrides;
stream >> selectorTab;
stream >> lastSeenWarningSeen;
@@ -135,12 +135,12 @@ void AuthSessionData::constructFromSerialized(const QByteArray &serialized) {
case Window::Column::Second:
case Window::Column::Third: _variables.floatPlayerColumn = uncheckedColumn; break;
}
auto uncheckedCorner = static_cast<Window::Corner>(floatPlayerCorner);
auto uncheckedCorner = static_cast<RectPart>(floatPlayerCorner);
switch (uncheckedCorner) {
case Window::Corner::TopLeft:
case Window::Corner::TopRight:
case Window::Corner::BottomLeft:
case Window::Corner::BottomRight: _variables.floatPlayerCorner = uncheckedCorner; break;
case RectPart::TopLeft:
case RectPart::TopRight:
case RectPart::BottomLeft:
case RectPart::BottomRight: _variables.floatPlayerCorner = uncheckedCorner; break;
}
}