mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 02:01:40 -05:00
parent
1ee71bbd5c
commit
3b956c598b
6 changed files with 20 additions and 8 deletions
|
@ -646,10 +646,7 @@ int32 MainWindow::screenNameChecksum(const QString &name) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::psRefreshTaskbarIcon() {
|
void MainWindow::psRefreshTaskbarIcon() {
|
||||||
auto refresher = object_ptr<QWidget>(this);
|
auto refresher = std::unique_ptr<QWidget>(this);
|
||||||
auto guard = gsl::finally([&refresher] {
|
|
||||||
refresher.destroy();
|
|
||||||
});
|
|
||||||
refresher->setWindowFlags(static_cast<Qt::WindowFlags>(Qt::Tool) | Qt::FramelessWindowHint);
|
refresher->setWindowFlags(static_cast<Qt::WindowFlags>(Qt::Tool) | Qt::FramelessWindowHint);
|
||||||
refresher->setGeometry(x() + 1, y() + 1, 1, 1);
|
refresher->setGeometry(x() + 1, y() + 1, 1, 1);
|
||||||
auto palette = refresher->palette();
|
auto palette = refresher->palette();
|
||||||
|
|
|
@ -215,6 +215,12 @@ QImage GrabWidgetToImage(not_null<QWidget*> target, QRect rect, QColor bg) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ForceFullRepaint(not_null<QWidget*> widget) {
|
||||||
|
const auto refresher = std::make_unique<QWidget>(widget);
|
||||||
|
refresher->setGeometry(widget->rect());
|
||||||
|
refresher->show();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
void sendSynteticMouseEvent(QWidget *widget, QEvent::Type type, Qt::MouseButton button, const QPoint &globalPoint) {
|
void sendSynteticMouseEvent(QWidget *widget, QEvent::Type type, Qt::MouseButton button, const QPoint &globalPoint) {
|
||||||
|
|
|
@ -57,6 +57,8 @@ QImage GrabWidgetToImage(
|
||||||
QRect rect = QRect(),
|
QRect rect = QRect(),
|
||||||
QColor bg = QColor(255, 255, 255, 0));
|
QColor bg = QColor(255, 255, 255, 0));
|
||||||
|
|
||||||
|
void ForceFullRepaint(not_null<QWidget*> widget);
|
||||||
|
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
||||||
enum class RectPart {
|
enum class RectPart {
|
||||||
|
|
|
@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/toast/toast.h"
|
#include "ui/toast/toast.h"
|
||||||
#include "ui/widgets/tooltip.h"
|
#include "ui/widgets/tooltip.h"
|
||||||
#include "window/layer_widget.h"
|
#include "window/layer_widget.h"
|
||||||
|
#include "window/themes/window_theme.h"
|
||||||
#include "messenger.h"
|
#include "messenger.h"
|
||||||
#include "styles/style_widgets.h"
|
#include "styles/style_widgets.h"
|
||||||
#include "styles/style_info.h"
|
#include "styles/style_info.h"
|
||||||
|
@ -150,6 +151,13 @@ void SeparatePanel::initLayout() {
|
||||||
setAttribute(Qt::WA_TranslucentBackground, true);
|
setAttribute(Qt::WA_TranslucentBackground, true);
|
||||||
|
|
||||||
createBorderImage();
|
createBorderImage();
|
||||||
|
subscribe(Window::Theme::Background(), [=](
|
||||||
|
const Window::Theme::BackgroundUpdate &update) {
|
||||||
|
if (update.paletteChanged()) {
|
||||||
|
createBorderImage();
|
||||||
|
Ui::ForceFullRepaint(this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Platform::InitOnTopPanel(this);
|
Platform::InitOnTopPanel(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ class LayerStackWidget;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
||||||
class SeparatePanel : public Ui::RpWidget {
|
class SeparatePanel : public Ui::RpWidget, private base::Subscriber {
|
||||||
public:
|
public:
|
||||||
SeparatePanel();
|
SeparatePanel();
|
||||||
|
|
||||||
|
|
|
@ -60,9 +60,6 @@ MainWindow::MainWindow()
|
||||||
, _titleText(qsl("Telegram")) {
|
, _titleText(qsl("Telegram")) {
|
||||||
subscribe(Theme::Background(), [this](const Theme::BackgroundUpdate &data) {
|
subscribe(Theme::Background(), [this](const Theme::BackgroundUpdate &data) {
|
||||||
if (data.paletteChanged()) {
|
if (data.paletteChanged()) {
|
||||||
if (_title) {
|
|
||||||
_title->update();
|
|
||||||
}
|
|
||||||
updatePalette();
|
updatePalette();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -242,6 +239,8 @@ void MainWindow::handleActiveChanged() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updatePalette() {
|
void MainWindow::updatePalette() {
|
||||||
|
Ui::ForceFullRepaint(this);
|
||||||
|
|
||||||
auto p = palette();
|
auto p = palette();
|
||||||
p.setColor(QPalette::Window, st::windowBg->c);
|
p.setColor(QPalette::Window, st::windowBg->c);
|
||||||
setPalette(p);
|
setPalette(p);
|
||||||
|
|
Loading…
Add table
Reference in a new issue