mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Check if app is active before showing a tooltip.
Fixes #6885, fixes #6895.
This commit is contained in:
@@ -271,7 +271,7 @@ QPoint BotKeyboard::tooltipPos() const {
|
||||
}
|
||||
|
||||
bool BotKeyboard::tooltipWindowActive() const {
|
||||
return Ui::InFocusChain(window());
|
||||
return Ui::AppInFocus() && Ui::InFocusChain(window());
|
||||
}
|
||||
|
||||
QString BotKeyboard::tooltipText() const {
|
||||
|
||||
@@ -770,7 +770,7 @@ QPoint EmojiListWidget::tooltipPos() const {
|
||||
}
|
||||
|
||||
bool EmojiListWidget::tooltipWindowActive() const {
|
||||
return Ui::InFocusChain(window());
|
||||
return Ui::AppInFocus() && Ui::InFocusChain(window());
|
||||
}
|
||||
|
||||
TabbedSelector::InnerFooter *EmojiListWidget::getFooter() const {
|
||||
|
||||
@@ -519,7 +519,7 @@ QPoint InnerWidget::tooltipPos() const {
|
||||
}
|
||||
|
||||
bool InnerWidget::tooltipWindowActive() const {
|
||||
return Ui::InFocusChain(window());
|
||||
return Ui::AppInFocus() && Ui::InFocusChain(window());
|
||||
}
|
||||
|
||||
HistoryView::Context InnerWidget::elementContext() {
|
||||
|
||||
@@ -352,7 +352,9 @@ void Widget::setInternalState(const QRect &geometry, not_null<SectionMemento*> m
|
||||
void Widget::setupShortcuts() {
|
||||
Shortcuts::Requests(
|
||||
) | rpl::filter([=] {
|
||||
return isActiveWindow() && !Ui::isLayerShown() && inFocusChain();
|
||||
return Ui::AppInFocus()
|
||||
&& Ui::InFocusChain(this)
|
||||
&& !Ui::isLayerShown();
|
||||
}) | rpl::start_with_next([=](not_null<Shortcuts::Request*> request) {
|
||||
using Command = Shortcuts::Command;
|
||||
request->check(Command::Search, 2) && request->handle([=] {
|
||||
|
||||
@@ -3207,7 +3207,7 @@ QPoint HistoryInner::tooltipPos() const {
|
||||
}
|
||||
|
||||
bool HistoryInner::tooltipWindowActive() const {
|
||||
return Ui::InFocusChain(window());
|
||||
return Ui::AppInFocus() && Ui::InFocusChain(window());
|
||||
}
|
||||
|
||||
void HistoryInner::onParentGeometryChanged() {
|
||||
|
||||
@@ -1476,7 +1476,9 @@ void HistoryWidget::notify_userIsBotChanged(UserData *user) {
|
||||
void HistoryWidget::setupShortcuts() {
|
||||
Shortcuts::Requests(
|
||||
) | rpl::filter([=] {
|
||||
return isActiveWindow() && !Ui::isLayerShown() && inFocusChain();
|
||||
return Ui::AppInFocus()
|
||||
&& Ui::InFocusChain(this)
|
||||
&& !Ui::isLayerShown();
|
||||
}) | rpl::start_with_next([=](not_null<Shortcuts::Request*> request) {
|
||||
using Command = Shortcuts::Command;
|
||||
if (_history) {
|
||||
|
||||
@@ -1092,7 +1092,7 @@ QPoint ListWidget::tooltipPos() const {
|
||||
}
|
||||
|
||||
bool ListWidget::tooltipWindowActive() const {
|
||||
return Ui::InFocusChain(window());
|
||||
return Ui::AppInFocus() && Ui::InFocusChain(window());
|
||||
}
|
||||
|
||||
Context ListWidget::elementContext() {
|
||||
|
||||
@@ -149,7 +149,7 @@ QPoint Inner::tooltipPos() const {
|
||||
}
|
||||
|
||||
bool Inner::tooltipWindowActive() const {
|
||||
return Ui::InFocusChain(window());
|
||||
return Ui::AppInFocus() && Ui::InFocusChain(window());
|
||||
}
|
||||
|
||||
Inner::~Inner() = default;
|
||||
|
||||
@@ -1118,7 +1118,7 @@ QPoint SilentToggle::tooltipPos() const {
|
||||
}
|
||||
|
||||
bool SilentToggle::tooltipWindowActive() const {
|
||||
return InFocusChain(window());
|
||||
return Ui::AppInFocus() && InFocusChain(window());
|
||||
}
|
||||
|
||||
} // namespace Ui
|
||||
|
||||
@@ -266,7 +266,9 @@ private:
|
||||
//
|
||||
//};
|
||||
|
||||
class SilentToggle : public Ui::IconButton, public Ui::AbstractTooltipShower {
|
||||
class SilentToggle
|
||||
: public Ui::IconButton
|
||||
, public Ui::AbstractTooltipShower {
|
||||
public:
|
||||
SilentToggle(QWidget *parent, not_null<ChannelData*> channel);
|
||||
|
||||
|
||||
+1
-1
Submodule Telegram/lib_ui updated: f0e95ee933...765e525458
Reference in New Issue
Block a user