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

Remove twidget header.

This commit is contained in:
John Preston
2019-09-13 15:22:54 +03:00
parent e2f54eb3e9
commit c5845f17ae
188 changed files with 1070 additions and 907 deletions

View File

@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/abstract_box.h"
#include "ui/widgets/shadow.h"
#include "ui/ui_utility.h"
#include "window/window_main_menu.h"
#include "app.h"
#include "styles/style_boxes.h"
@@ -294,7 +295,7 @@ void LayerStackWidget::BackgroundWidget::paintEvent(QPaintEvent *e) {
p.setOpacity(1.);
auto shownWidth = mainMenuRight + st::boxRoundShadow.extend.right();
auto sourceWidth = shownWidth * cIntRetinaFactor();
auto sourceRect = rtlrect(_mainMenuCache.width() - sourceWidth, 0, sourceWidth, _mainMenuCache.height(), _mainMenuCache.width());
auto sourceRect = style::rtlrect(_mainMenuCache.width() - sourceWidth, 0, sourceWidth, _mainMenuCache.height(), _mainMenuCache.width());
p.drawPixmapLeft(0, 0, shownWidth, height(), width(), _mainMenuCache, sourceRect);
}
}
@@ -442,7 +443,7 @@ void LayerStackWidget::setCacheImages() {
}
void LayerStackWidget::closeLayer(not_null<LayerWidget*> layer) {
const auto weak = make_weak(layer.get());
const auto weak = Ui::MakeWeak(layer.get());
if (weak->inFocusChain()) {
setFocus();
}
@@ -542,7 +543,7 @@ void LayerStackWidget::startAnimation(
} else {
setupNewWidgets();
setCacheImages();
const auto weak = make_weak(this);
const auto weak = Ui::MakeWeak(this);
clearOldWidgets();
if (weak) {
prepareForAnimation();
@@ -552,7 +553,7 @@ void LayerStackWidget::startAnimation(
}
void LayerStackWidget::resizeEvent(QResizeEvent *e) {
const auto weak = make_weak(this);
const auto weak = Ui::MakeWeak(this);
_background->setGeometry(rect());
if (!weak) {
return;
@@ -769,7 +770,7 @@ void LayerStackWidget::clearLayers() {
}
void LayerStackWidget::clearClosingLayers() {
const auto weak = make_weak(this);
const auto weak = Ui::MakeWeak(this);
while (!_closingLayers.empty()) {
const auto index = _closingLayers.size() - 1;
const auto layer = _closingLayers.back().get();
@@ -822,7 +823,7 @@ void LayerStackWidget::fixOrder() {
}
void LayerStackWidget::sendFakeMouseEvent() {
sendSynteticMouseEvent(this, QEvent::MouseMove, Qt::NoButton);
SendSynteticMouseEvent(this, QEvent::MouseMove, Qt::NoButton);
}
LayerStackWidget::~LayerStackWidget() {

View File

@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/rp_widget.h"
#include "ui/effects/animations.h"
#include "base/object_ptr.h"
#include "data/data_file_origin.h"
namespace Lottie {

View File

@@ -24,6 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h"
#include "data/data_session.h"
#include "main/main_session.h"
#include "ui/ui_utility.h"
#include "apiwrap.h"
#include "mainwindow.h"
#include "facades.h"

View File

@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_title.h"
#include "ui/rp_widget.h"
#include "base/timer.h"
#include "base/object_ptr.h"
#include <QtWidgets/QSystemTrayIcon>

View File

@@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/text_options.h"
#include "ui/emoji_config.h"
#include "ui/empty_userpic.h"
#include "ui/ui_utility.h"
#include "dialogs/dialogs_layout.h"
#include "window/themes/window_theme.h"
#include "styles/style_dialogs.h"
@@ -602,8 +603,8 @@ void Notification::prepareActionsCache() {
actionsCacheImg.fill(Qt::transparent);
{
Painter p(&actionsCacheImg);
st::notifyFadeRight.fill(p, rtlrect(0, 0, fadeWidth, actionsCacheHeight, actionsCacheWidth));
p.fillRect(rtlrect(fadeWidth, 0, actionsCacheWidth - fadeWidth, actionsCacheHeight, actionsCacheWidth), st::notificationBg);
st::notifyFadeRight.fill(p, style::rtlrect(0, 0, fadeWidth, actionsCacheHeight, actionsCacheWidth));
p.fillRect(style::rtlrect(fadeWidth, 0, actionsCacheWidth - fadeWidth, actionsCacheHeight, actionsCacheWidth), st::notificationBg);
p.drawPixmapRight(replyRight, _reply->y() - actionsTop, actionsCacheWidth, replyCache);
}
_buttonsCache = App::pixmapFromImageInPlace(std::move(actionsCacheImg));

View File

@@ -9,8 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/notifications_manager.h"
#include "ui/effects/animations.h"
#include "ui/rp_widget.h"
#include "base/timer.h"
#include "base/binary_guard.h"
#include "base/object_ptr.h"
#include <QtCore/QTimer>

View File

@@ -7,13 +7,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "window/section_widget.h"
#include <rpl/range.h>
#include "mainwidget.h"
#include "ui/ui_utility.h"
#include "window/section_memento.h"
#include "window/window_slide_animation.h"
#include "window/themes/window_theme.h"
#include "window/window_session_controller.h"
#include <rpl/range.h>
namespace Window {
Main::Session &AbstractSectionWidget::session() const {
@@ -32,7 +34,7 @@ void SectionWidget::setGeometryWithTopMoved(
_topDelta = topDelta;
bool willBeResized = (size() != newGeometry.size());
if (geometry() != newGeometry) {
auto weak = make_weak(this);
auto weak = Ui::MakeWeak(this);
setGeometry(newGeometry);
if (!weak) {
return;
@@ -77,6 +79,11 @@ void SectionWidget::showFast() {
showFinished();
}
QPixmap SectionWidget::grabForShowAnimation(
const SectionSlideParams &params) {
return Ui::GrabWidget(this);
}
void SectionWidget::PaintBackground(not_null<QWidget*> widget, QRect clip) {
Painter p(widget);

View File

@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/rp_widget.h"
#include "dialogs/dialogs_key.h"
#include "base/object_ptr.h"
namespace Main {
class Session;
@@ -106,9 +107,7 @@ public:
// This can be used to grab with or without top bar shadow.
// This will be protected when animation preparation will be done inside.
virtual QPixmap grabForShowAnimation(const SectionSlideParams &params) {
return Ui::GrabWidget(this);
}
virtual QPixmap grabForShowAnimation(const SectionSlideParams &params);
// Attempt to show the required section inside the existing one.
// For example if this section already shows exactly the required

View File

@@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/multi_select.h"
#include "ui/widgets/dropdown_menu.h"
#include "ui/toast/toast.h"
#include "ui/ui_utility.h"
#include "base/parse_helper.h"
#include "base/zlib_help.h"
#include "core/file_utilities.h"
@@ -698,7 +699,7 @@ void Editor::showMenu() {
return;
}
_menu.create(this);
_menu->setHiddenCallback([weak = make_weak(this), menu = _menu.data()]{
_menu->setHiddenCallback([weak = Ui::MakeWeak(this), menu = _menu.data()]{
menu->deleteLater();
if (weak && weak->_menu == menu) {
weak->_menu = nullptr;

View File

@@ -8,6 +8,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#pragma once
#include "data/data_cloud_themes.h"
#include "ui/rp_widget.h"
#include "base/object_ptr.h"
namespace Ui {
class FlatButton;

View File

@@ -7,6 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "ui/rp_widget.h"
class EditColorBox;
namespace Window {

View File

@@ -746,7 +746,7 @@ void Generator::paintBubble(const Bubble &bubble) {
auto h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom();
auto bar = (bubble.outbg ? st::msgOutReplyBarColor[_palette] : st::msgInReplyBarColor[_palette]);
auto rbar = rtlrect(trect.x() + st::msgReplyBarPos.x(), trect.y() + st::msgReplyPadding.top() + st::msgReplyBarPos.y(), st::msgReplyBarSize.width(), st::msgReplyBarSize.height(), _rect.width());
auto rbar = style::rtlrect(trect.x() + st::msgReplyBarPos.x(), trect.y() + st::msgReplyPadding.top() + st::msgReplyBarPos.y(), st::msgReplyBarSize.width(), st::msgReplyBarSize.height(), _rect.width());
_p->fillRect(rbar, bar);
_p->setPen(bubble.outbg ? st::msgOutServiceFg[_palette] : st::msgInServiceFg[_palette]);
@@ -770,7 +770,7 @@ void Generator::paintBubble(const Bubble &bubble) {
auto statustop = y + st::msgFileStatusTop;
auto bottom = y + st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom();
auto inner = rtlrect(x + st::msgFilePadding.left(), y + st::msgFilePadding.top(), st::msgFileSize, st::msgFileSize, _rect.width());
auto inner = style::rtlrect(x + st::msgFilePadding.left(), y + st::msgFilePadding.top(), st::msgFileSize, st::msgFileSize, _rect.width());
_p->setPen(Qt::NoPen);
_p->setBrush(bubble.outbg ? st::msgFileOutBg[_palette] : st::msgFileInBg[_palette]);

View File

@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_boxes.h"
#include "ui/widgets/buttons.h"
#include "ui/widgets/shadow.h"
#include "ui/ui_utility.h"
#include "window/themes/window_theme.h"
#include "lang/lang_keys.h"
#include "app.h"

View File

@@ -8,7 +8,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#pragma once
#include "base/timer.h"
#include "base/object_ptr.h"
#include "ui/effects/animations.h"
#include "ui/rp_widget.h"
namespace Ui {
class RoundButton;

View File

@@ -265,9 +265,9 @@ void CloudListCheck::paintWithColors(
p.setPen(Qt::NoPen);
p.setBrush(_colors->received);
p.drawRoundedRect(rtlrect(received, outerWidth), radius, radius);
p.drawRoundedRect(style::rtlrect(received, outerWidth), radius, radius);
p.setBrush(_colors->sent);
p.drawRoundedRect(rtlrect(sent, outerWidth), radius, radius);
p.drawRoundedRect(style::rtlrect(sent, outerWidth), radius, radius);
const auto skip = st::settingsThemeRadioBottom / 2;

View File

@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/buttons.h"
#include "ui/effects/radial_animation.h"
#include "ui/ui_utility.h"
#include "window/themes/window_theme.h"
#include "boxes/connection_box.h"
#include "lang/lang_keys.h"

View File

@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#pragma once
#include "base/timer.h"
#include "base/object_ptr.h"
#include "ui/rp_widget.h"
namespace Ui {

View File

@@ -7,6 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "base/object_ptr.h"
namespace Ui {
class RpWidget;
} // namespace Ui

View File

@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <rpl/variable.h>
#include "base/flags.h"
#include "base/observer.h"
#include "base/object_ptr.h"
#include "dialogs/dialogs_key.h"
#include "ui/effects/animation_value.h"

View File

@@ -7,6 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "ui/rp_widget.h"
namespace Window {
enum class HitTestResult {