mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 05:37:09 +02:00
Add shadow below tags list widget.
This commit is contained in:
parent
3421b656db
commit
0163938e00
1 changed files with 18 additions and 5 deletions
|
@ -26,6 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
#include "ui/widgets/labels.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "ui/widgets/multi_select.h"
|
#include "ui/widgets/multi_select.h"
|
||||||
|
#include "ui/widgets/shadow.h"
|
||||||
#include "ui/widgets/scroll_area.h"
|
#include "ui/widgets/scroll_area.h"
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
|
@ -433,11 +434,27 @@ void TopBar::refreshTags() {
|
||||||
&_history->owner(),
|
&_history->owner(),
|
||||||
reactions->myTagsValue(sublist),
|
reactions->myTagsValue(sublist),
|
||||||
_searchTagsSelected);
|
_searchTagsSelected);
|
||||||
|
|
||||||
|
const auto parent = _searchTags->lifetime().make_state<Ui::RpWidget>(
|
||||||
|
this);
|
||||||
|
const auto shadow = _searchTags->lifetime().make_state<Ui::PlainShadow>(
|
||||||
|
parentWidget());
|
||||||
|
parent->show();
|
||||||
|
|
||||||
_searchTags->heightValue(
|
_searchTags->heightValue(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=](int height) {
|
||||||
updateSize();
|
updateSize();
|
||||||
|
shadow->setVisible(height > 0);
|
||||||
}, _searchTags->lifetime());
|
}, _searchTags->lifetime());
|
||||||
|
|
||||||
|
geometryValue() | rpl::start_with_next([=](QRect geometry) {
|
||||||
|
shadow->setGeometry(
|
||||||
|
geometry.x(),
|
||||||
|
geometry.y() + geometry.height(),
|
||||||
|
geometry.width(),
|
||||||
|
st::lineWidth);
|
||||||
|
}, shadow->lifetime());
|
||||||
|
|
||||||
_searchTags->selectedChanges(
|
_searchTags->selectedChanges(
|
||||||
) | rpl::start_with_next([=](std::vector<Data::ReactionId> &&list) {
|
) | rpl::start_with_next([=](std::vector<Data::ReactionId> &&list) {
|
||||||
_searchTagsSelected = std::move(list);
|
_searchTagsSelected = std::move(list);
|
||||||
|
@ -450,10 +467,6 @@ void TopBar::refreshTags() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto parent = _searchTags->lifetime().make_state<Ui::RpWidget>(
|
|
||||||
this);
|
|
||||||
parent->show();
|
|
||||||
|
|
||||||
const auto padding = st::searchInChatTagsPadding;
|
const auto padding = st::searchInChatTagsPadding;
|
||||||
const auto position = QPoint(padding.left(), padding.top());
|
const auto position = QPoint(padding.left(), padding.top());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue