mirror of https://github.com/procxx/kepka.git
Check if app is active before showing a tooltip.
Fixes #6885, fixes #6895.
This commit is contained in:
parent
3b562bfa3a
commit
f2a92f2b02
|
@ -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 @@
|
|||
Subproject commit f0e95ee933d1caf74b790fc85d34212dd3dd2229
|
||||
Subproject commit 765e525458843ffb893586441b885ac5ba143e51
|
Loading…
Reference in New Issue