mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Move many widget classes to lib_ui.
This commit is contained in:
@@ -23,7 +23,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <QtCore/QStandardPaths>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtCore/QVersionNumber>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
@@ -92,10 +91,6 @@ void FallbackFontConfig() {
|
||||
|
||||
namespace Platform {
|
||||
|
||||
bool IsApplicationActive() {
|
||||
return QApplication::activeWindow() != nullptr;
|
||||
}
|
||||
|
||||
void SetApplicationIcon(const QIcon &icon) {
|
||||
QApplication::setWindowIcon(icon);
|
||||
}
|
||||
@@ -135,12 +130,6 @@ QRect psDesktopRect() {
|
||||
return _monitorRect;
|
||||
}
|
||||
|
||||
void psShowOverAll(QWidget *w, bool canFocus) {
|
||||
}
|
||||
|
||||
void psBringToBack(QWidget *w) {
|
||||
}
|
||||
|
||||
void psWriteDump() {
|
||||
}
|
||||
|
||||
@@ -243,29 +232,6 @@ void finish() {
|
||||
Notifications::Finish();
|
||||
}
|
||||
|
||||
bool TranslucentWindowsSupported(QPoint globalPosition) {
|
||||
if (const auto native = QGuiApplication::platformNativeInterface()) {
|
||||
if (const auto desktop = QApplication::desktop()) {
|
||||
const auto index = desktop->screenNumber(globalPosition);
|
||||
const auto screens = QGuiApplication::screens();
|
||||
if (const auto screen = (index >= 0 && index < screens.size()) ? screens[index] : QGuiApplication::primaryScreen()) {
|
||||
if (native->nativeResourceForScreen(QByteArray("compositingEnabled"), screen)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static auto WarnedAbout = base::flat_set<int>();
|
||||
if (!WarnedAbout.contains(index)) {
|
||||
WarnedAbout.insert(index);
|
||||
LOG(("WARNING: Compositing is disabled for screen index %1 (for position %2,%3)").arg(index).arg(globalPosition.x()).arg(globalPosition.y()));
|
||||
}
|
||||
} else {
|
||||
LOG(("WARNING: Could not get screen for index %1 (for position %2,%3)").arg(index).arg(globalPosition.x()).arg(globalPosition.y()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void RegisterCustomScheme() {
|
||||
#ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
|
||||
auto home = getHomeDir();
|
||||
@@ -432,9 +398,6 @@ void psAutoStart(bool start, bool silent) {
|
||||
void psSendToMenu(bool send, bool silent) {
|
||||
}
|
||||
|
||||
void psUpdateOverlayed(QWidget *widget) {
|
||||
}
|
||||
|
||||
bool linuxMoveFile(const char *from, const char *to) {
|
||||
FILE *ffrom = fopen(from, "rb"), *fto = fopen(to, "wb");
|
||||
if (!ffrom) {
|
||||
|
@@ -20,26 +20,15 @@ namespace Platform {
|
||||
inline void SetWatchingMediaKeys(bool watching) {
|
||||
}
|
||||
|
||||
bool IsApplicationActive();
|
||||
|
||||
inline void StartTranslucentPaint(QPainter &p, QPaintEvent *e) {
|
||||
}
|
||||
|
||||
inline void InitOnTopPanel(QWidget *panel) {
|
||||
}
|
||||
|
||||
inline void DeInitOnTopPanel(QWidget *panel) {
|
||||
}
|
||||
|
||||
inline void ReInitOnTopPanel(QWidget *panel) {
|
||||
}
|
||||
|
||||
QString CurrentExecutablePath(int argc, char *argv[]);
|
||||
|
||||
inline std::optional<crl::time> LastUserInputTime() {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
inline void IgnoreApplicationActivationRightNow() {
|
||||
}
|
||||
|
||||
inline constexpr bool UseMainQueueGeneric() {
|
||||
return true;
|
||||
}
|
||||
@@ -70,15 +59,12 @@ void psAutoStart(bool start, bool silent = false);
|
||||
void psSendToMenu(bool send, bool silent = false);
|
||||
|
||||
QRect psDesktopRect();
|
||||
void psShowOverAll(QWidget *w, bool canFocus = true);
|
||||
void psBringToBack(QWidget *w);
|
||||
|
||||
int psCleanup();
|
||||
int psFixPrevious();
|
||||
|
||||
void psNewVersion();
|
||||
|
||||
void psUpdateOverlayed(QWidget *widget);
|
||||
inline QByteArray psDownloadPathBookmark(const QString &path) {
|
||||
return QByteArray();
|
||||
}
|
||||
|
Reference in New Issue
Block a user