diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index d1b576ce22..17d04b6127 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -1058,6 +1058,8 @@ PRIVATE info/profile/info_profile_members_controllers.h info/profile/info_profile_phone_menu.cpp info/profile/info_profile_phone_menu.h + info/profile/info_profile_top_bar.cpp + info/profile/info_profile_top_bar.h info/profile/info_profile_values.cpp info/profile/info_profile_values.h info/profile/info_profile_widget.cpp diff --git a/Telegram/SourceFiles/info/profile/info_profile_inner_widget.cpp b/Telegram/SourceFiles/info/profile/info_profile_inner_widget.cpp index 5141a5cf16..473ea36de2 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_inner_widget.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_inner_widget.cpp @@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "info/profile/info_profile_cover.h" #include "info/profile/info_profile_icon.h" #include "info/profile/info_profile_members.h" +#include "info/profile/info_profile_top_bar.h" #include "info/profile/info_profile_actions.h" #include "info/media/info_media_buttons.h" #include "data/data_changes.h" @@ -330,7 +331,8 @@ bool InnerWidget::hasFlexibleTopBar() const { base::weak_qptr InnerWidget::createPinnedToTop( not_null parent) { - return nullptr; + const auto content = Ui::CreateChild(parent); + return base::make_weak(not_null{ content }); } base::weak_qptr InnerWidget::createPinnedToBottom( diff --git a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp new file mode 100644 index 0000000000..03783b8772 --- /dev/null +++ b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp @@ -0,0 +1,26 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#include "info/profile/info_profile_top_bar.h" + +#include "styles/style_info.h" +#include "styles/style_settings.h" + +namespace Info::Profile { + +TopBar::TopBar(QWidget *parent) +: RpWidget(parent) { + setMinimumHeight(st::infoLayerTopBarHeight); + setMaximumHeight(st::settingsPremiumTopHeight); +} + +void TopBar::paintEvent(QPaintEvent *e) { + auto p = QPainter(this); + p.fillRect(rect(), st::boxBg); +} + +} // namespace Info::Profile diff --git a/Telegram/SourceFiles/info/profile/info_profile_top_bar.h b/Telegram/SourceFiles/info/profile/info_profile_top_bar.h new file mode 100644 index 0000000000..e1c5e9f051 --- /dev/null +++ b/Telegram/SourceFiles/info/profile/info_profile_top_bar.h @@ -0,0 +1,23 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#pragma once + +#include "ui/rp_widget.h" + +namespace Info::Profile { + +class TopBar final : public Ui::RpWidget { +public: + TopBar(QWidget *parent); + +protected: + void paintEvent(QPaintEvent *e) override; + +}; + +} // namespace Info::Profile