mirror of https://github.com/procxx/kepka.git
Fix tabbed section / panel render glitches.
This commit is contained in:
parent
507b7d7193
commit
1791b251ad
|
@ -665,6 +665,22 @@ HistoryWidget::HistoryWidget(QWidget *parent, gsl::not_null<Window::Controller*>
|
||||||
onPreviewCheck();
|
onPreviewCheck();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
subscribe(controller->widgetGrabbed(), [this] {
|
||||||
|
// Qt bug workaround: QWidget::render() for an arbitrary widget calls
|
||||||
|
// sendPendingMoveAndResizeEvents(true, true) for the whole window,
|
||||||
|
// which does something like:
|
||||||
|
//
|
||||||
|
// setAttribute(Qt::WA_UpdatesDisabled);
|
||||||
|
// sendEvent(QResizeEvent);
|
||||||
|
// setAttribute(Qt::WA_UpdatesDisabled, false);
|
||||||
|
//
|
||||||
|
// So if we create TabbedSection widget in HistoryWidget::resizeEvent()
|
||||||
|
// it will get an enabled Qt::WA_UpdatesDisabled from its parent and it
|
||||||
|
// will never be rendered, because no one will ever remove that attribute.
|
||||||
|
//
|
||||||
|
// So we force HistoryWidget::resizeEvent() here, without WA_UpdatesDisabled.
|
||||||
|
myEnsureResized(this);
|
||||||
|
});
|
||||||
|
|
||||||
orderWidgets();
|
orderWidgets();
|
||||||
}
|
}
|
||||||
|
@ -3971,6 +3987,7 @@ void HistoryWidget::updateTabbedSelectorSectionShown() {
|
||||||
updateControlsVisibility();
|
updateControlsVisibility();
|
||||||
} else {
|
} else {
|
||||||
_tabbedPanel.create(this, controller(), _tabbedSection->takeSelector());
|
_tabbedPanel.create(this, controller(), _tabbedSection->takeSelector());
|
||||||
|
_tabbedPanel->hide();
|
||||||
_tabbedSelectorToggle->installEventFilter(_tabbedPanel);
|
_tabbedSelectorToggle->installEventFilter(_tabbedPanel);
|
||||||
_tabbedSection.destroy();
|
_tabbedSection.destroy();
|
||||||
_tabbedSelectorToggle->setColorOverrides(nullptr, nullptr, nullptr);
|
_tabbedSelectorToggle->setColorOverrides(nullptr, nullptr, nullptr);
|
||||||
|
|
|
@ -2567,21 +2567,6 @@ void MainWidget::ui_showPeerHistory(quint64 peerId, qint32 showAtMsgId, Ui::Show
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Qt bug workaround: QWidget::render() for an arbitrary widget calls
|
|
||||||
// sendPendingMoveAndResizeEvents(true, true) for the whole window,
|
|
||||||
// which does something like:
|
|
||||||
//
|
|
||||||
// setAttribute(Qt::WA_UpdatesDisabled);
|
|
||||||
// sendEvent(QResizeEvent);
|
|
||||||
// setAttribute(Qt::WA_UpdatesDisabled, false);
|
|
||||||
//
|
|
||||||
// So if we create TabbedSection widget in HistoryWidget::resizeEvent()
|
|
||||||
// it will get an enabled Qt::WA_UpdatesDisabled from its parent and it
|
|
||||||
// will never be rendered, because no one will ever remove that attribute.
|
|
||||||
//
|
|
||||||
// So we force HistoryWidget::resizeEvent() here, without WA_UpdatesDisabled.
|
|
||||||
myEnsureResized(_history);
|
|
||||||
|
|
||||||
auto animationParams = animatedShow() ? prepareHistoryAnimation(peerId) : Window::SectionSlideParams();
|
auto animationParams = animatedShow() ? prepareHistoryAnimation(peerId) : Window::SectionSlideParams();
|
||||||
|
|
||||||
if (_history->peer() && _history->peer()->id != peerId && way != Ui::ShowWay::Forward) {
|
if (_history->peer() && _history->peer()->id != peerId && way != Ui::ShowWay::Forward) {
|
||||||
|
|
|
@ -18,8 +18,11 @@ to link the code of portions of this program with the OpenSSL library.
|
||||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||||
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
*/
|
*/
|
||||||
|
#include "twidget.h"
|
||||||
|
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "window/window_controller.h"
|
||||||
|
|
||||||
namespace Fonts {
|
namespace Fonts {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -153,6 +156,8 @@ QPixmap myGrab(TWidget *target, QRect rect, QColor bg) {
|
||||||
result.fill(bg);
|
result.fill(bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
App::wnd()->controller()->widgetGrabbed().notify(true);
|
||||||
|
|
||||||
target->grabStart();
|
target->grabStart();
|
||||||
target->render(&result, QPoint(0, 0), rect, QWidget::DrawChildren | QWidget::IgnoreMask);
|
target->render(&result, QPoint(0, 0), rect, QWidget::DrawChildren | QWidget::IgnoreMask);
|
||||||
target->grabFinish();
|
target->grabFinish();
|
||||||
|
|
|
@ -68,6 +68,9 @@ public:
|
||||||
base::Observable<void> &floatPlayerAreaUpdated() {
|
base::Observable<void> &floatPlayerAreaUpdated() {
|
||||||
return _floatPlayerAreaUpdated;
|
return _floatPlayerAreaUpdated;
|
||||||
}
|
}
|
||||||
|
base::Observable<void> &widgetGrabbed() {
|
||||||
|
return _widgetGrabbed;
|
||||||
|
}
|
||||||
|
|
||||||
struct ColumnLayout {
|
struct ColumnLayout {
|
||||||
int bodyWidth;
|
int bodyWidth;
|
||||||
|
@ -108,6 +111,7 @@ private:
|
||||||
GifPauseReasons _gifPauseReasons = { 0 };
|
GifPauseReasons _gifPauseReasons = { 0 };
|
||||||
base::Observable<void> _gifPauseLevelChanged;
|
base::Observable<void> _gifPauseLevelChanged;
|
||||||
base::Observable<void> _floatPlayerAreaUpdated;
|
base::Observable<void> _floatPlayerAreaUpdated;
|
||||||
|
base::Observable<void> _widgetGrabbed;
|
||||||
|
|
||||||
base::Variable<float64> _dialogsWidthRatio = { kDefaultDialogsWidthRatio };
|
base::Variable<float64> _dialogsWidthRatio = { kDefaultDialogsWidthRatio };
|
||||||
base::Variable<bool> _dialogsListFocused = { false };
|
base::Variable<bool> _dialogsListFocused = { false };
|
||||||
|
|
Loading…
Reference in New Issue