2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Move system versions to platform/platform_info.

This commit is contained in:
John Preston
2019-06-03 17:41:23 +03:00
parent 0467401635
commit 9c613fe2f7
56 changed files with 784 additions and 488 deletions

View File

@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/continuous_sliders.h"
#include "base/timer.h"
#include "platform/platform_info.h"
namespace Ui {
namespace {
@@ -113,7 +114,7 @@ void ContinuousSlider::wheelEvent(QWheelEvent *e) {
constexpr auto coef = 1. / (step * 10.);
auto deltaX = e->angleDelta().x(), deltaY = e->angleDelta().y();
if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) {
if (Platform::IsMac()) {
deltaY *= -1;
} else {
deltaX *= -1;

View File

@@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "emoji_suggestions_data.h"
#include "chat_helpers/emoji_suggestions_helper.h"
#include "chat_helpers/message_field.h" // ConvertTextTagsToEntities
#include "platform/platform_info.h"
#include "window/themes/window_theme.h"
#include "lang/lang_keys.h"
#include "data/data_user.h"
@@ -2580,7 +2581,7 @@ bool InputField::ShouldSubmit(
void InputField::keyPressEventInner(QKeyEvent *e) {
bool shift = e->modifiers().testFlag(Qt::ShiftModifier), alt = e->modifiers().testFlag(Qt::AltModifier);
bool macmeta = (cPlatform() == dbipMac || cPlatform() == dbipMacOld) && e->modifiers().testFlag(Qt::ControlModifier) && !e->modifiers().testFlag(Qt::MetaModifier) && !e->modifiers().testFlag(Qt::AltModifier);
bool macmeta = Platform::IsMac() && e->modifiers().testFlag(Qt::ControlModifier) && !e->modifiers().testFlag(Qt::MetaModifier) && !e->modifiers().testFlag(Qt::AltModifier);
bool ctrl = e->modifiers().testFlag(Qt::ControlModifier) || e->modifiers().testFlag(Qt::MetaModifier);
bool enterSubmit = (_mode != Mode::MultiLine)
|| ShouldSubmit(_submitSettings, e->modifiers());

View File

@@ -9,20 +9,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/shadow.h"
#include "ui/image/image_prepare.h"
#include "platform/platform_info.h"
#include "platform/platform_specific.h"
#include "mainwindow.h"
#include "core/application.h"
#include "lang/lang_keys.h"
namespace Ui {
namespace {
bool InactiveMacApplication() {
return (cPlatform() == dbipMac || cPlatform() == dbipMacOld)
&& !Platform::IsApplicationActive();
}
} // namespace
PopupMenu::PopupMenu(QWidget *parent, const style::PopupMenu &st)
: RpWidget(parent)
@@ -430,7 +423,7 @@ void PopupMenu::popup(const QPoint &p) {
}
void PopupMenu::showMenu(const QPoint &p, PopupMenu *parent, TriggeredSource source) {
if (!parent && InactiveMacApplication()) {
if (!parent && Platform::IsMac() && !Platform::IsApplicationActive()) {
_hiding = false;
_a_opacity.stop();
_a_show.stop();