mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Simplify ordering of stories tooltip.
This commit is contained in:
parent
fcd1062d78
commit
7d1725b339
5 changed files with 20 additions and 12 deletions
|
@ -1386,6 +1386,15 @@ void Widget::jumpToTop(bool belowPinned) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Widget::raiseWithTooltip() {
|
||||||
|
raise();
|
||||||
|
if (_stories) {
|
||||||
|
Ui::PostponeCall(this, [=] {
|
||||||
|
_stories->raiseTooltip();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Widget::scrollToDefault(bool verytop) {
|
void Widget::scrollToDefault(bool verytop) {
|
||||||
if (verytop) {
|
if (verytop) {
|
||||||
//_scroll->verticalScrollBar()->setMinimum(0);
|
//_scroll->verticalScrollBar()->setMinimum(0);
|
||||||
|
|
|
@ -98,6 +98,7 @@ public:
|
||||||
void setInnerFocus();
|
void setInnerFocus();
|
||||||
|
|
||||||
void jumpToTop(bool belowPinned = false);
|
void jumpToTop(bool belowPinned = false);
|
||||||
|
void raiseWithTooltip();
|
||||||
|
|
||||||
void startWidthAnimation();
|
void startWidthAnimation();
|
||||||
void stopWidthAnimation();
|
void stopWidthAnimation();
|
||||||
|
|
|
@ -957,21 +957,11 @@ void List::setShowTooltip(
|
||||||
using namespace base;
|
using namespace base;
|
||||||
using Event = not_null<QEvent*>;
|
using Event = not_null<QEvent*>;
|
||||||
install_event_filter(tooltip, tooltipParent, [=](Event e) {
|
install_event_filter(tooltip, tooltipParent, [=](Event e) {
|
||||||
if ((e->type() == QEvent::Move)
|
if (e->type() == QEvent::ChildAdded) {
|
||||||
|| (e->type() == QEvent::ChildAdded)
|
|
||||||
|| (e->type() == QEvent::ChildRemoved)) {
|
|
||||||
recompute();
|
recompute();
|
||||||
}
|
}
|
||||||
return EventFilterResult::Continue;
|
return EventFilterResult::Continue;
|
||||||
});
|
});
|
||||||
for (const auto &child : tooltipParent->children()) {
|
|
||||||
install_event_filter(tooltip, child, [=](Event e) {
|
|
||||||
if (e->type() == QEvent::ZOrderChange) {
|
|
||||||
recompute();
|
|
||||||
}
|
|
||||||
return EventFilterResult::Continue;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
|
@ -993,6 +983,12 @@ void List::setShowTooltip(
|
||||||
}, tooltip->lifetime());
|
}, tooltip->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void List::raiseTooltip() {
|
||||||
|
if (_tooltip) {
|
||||||
|
_tooltip->raise();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void List::toggleTooltip(bool fast) {
|
void List::toggleTooltip(bool fast) {
|
||||||
const auto shown = !_expanded
|
const auto shown = !_expanded
|
||||||
&& !_expandedAnimation.animating()
|
&& !_expandedAnimation.animating()
|
||||||
|
|
|
@ -77,6 +77,8 @@ public:
|
||||||
not_null<QWidget*> tooltipParent,
|
not_null<QWidget*> tooltipParent,
|
||||||
rpl::producer<bool> shown,
|
rpl::producer<bool> shown,
|
||||||
Fn<void()> hide);
|
Fn<void()> hide);
|
||||||
|
void raiseTooltip();
|
||||||
|
|
||||||
struct CollapsedGeometry {
|
struct CollapsedGeometry {
|
||||||
QRect geometry;
|
QRect geometry;
|
||||||
float64 expanded = 0.;
|
float64 expanded = 0.;
|
||||||
|
|
|
@ -1926,7 +1926,7 @@ void MainWidget::showBackFromStack(
|
||||||
|
|
||||||
void MainWidget::orderWidgets() {
|
void MainWidget::orderWidgets() {
|
||||||
if (_dialogs) {
|
if (_dialogs) {
|
||||||
_dialogs->raise();
|
_dialogs->raiseWithTooltip();
|
||||||
}
|
}
|
||||||
if (_player) {
|
if (_player) {
|
||||||
_player->raise();
|
_player->raise();
|
||||||
|
|
Loading…
Add table
Reference in a new issue