Skip to content

Commit

Permalink
add changes from redkite
Browse files Browse the repository at this point in the history
  • Loading branch information
iurienistor committed May 7, 2024
1 parent eec4d33 commit c91868b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/redkite/include/impl/RkEventQueueImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class RkEventQueue::RkEventQueueImpl {
void processQueue();
void addPopup(RkWidget* popup);
void removePopup(RkWidget* popup);
const std::vector<RkWidget*>& getPopupWidgets() const;

protected:
void processPopups(RkWidget *widget, RkEvent* event);
Expand Down
5 changes: 5 additions & 0 deletions src/redkite/src/RkEventQueueImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,8 @@ void RkEventQueue::RkEventQueueImpl::removePopup(RkWidget* popup)
RK_LOG_DEV_DEBUG("REMOVE POPUP: " << popup);
popupList.erase(std::remove(popupList.begin(), popupList.end(), popup), popupList.end());
}

const std::vector<RkWidget*>& RkEventQueue::RkEventQueueImpl::getPopupWidgets() const
{
return popupList;
}
5 changes: 5 additions & 0 deletions src/redkite/src/RkSystemWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ bool RkSystemWindow::containsGlobalPoint(RkWidget* widget, const RkPoint &global

RkWidget* RkSystemWindow::getWidgetByGlobalPoint(RkWidget *widget, const RkPoint &globalPoint)
{
for (auto &popupWidget: RK_IMPL_PTR(topWidget->eventQueue())->getPopupWidgets()) {
if (containsGlobalPoint(popupWidget, globalPoint))
return popupWidget;
}

for (auto &child: widget->children()) {
auto childWidget = dynamic_cast<RkWidget*>(child);
if (childWidget && childWidget->isVisible()
Expand Down
12 changes: 6 additions & 6 deletions src/redkite/src/RkWidgetImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ void RkWidget::RkWidgetImpl::event(RkEvent *event)

void RkWidget::RkWidgetImpl::processPaintEvent(RkPaintEvent* event)
{
// if (!name().empty())
// RK_LOG_DEV_DEBUG("name :" << name() << ", visible: " << isVisible());
if (!name().empty())
RK_LOG_DEV_DEBUG("name :" << name() << ", visible: " << isVisible());
RkPainter painter(inf_ptr);
auto globalPosition = inf_ptr->mapToGlobal({0, 0});
painter.translate(globalPosition);
Expand Down Expand Up @@ -503,10 +503,10 @@ void RkWidget::RkWidgetImpl::setChildrenVisible(bool b)
continue;
RK_IMPL_PTR(widget)->setVisible(b);
RK_IMPL_PTR(widget)->setChildrenVisible(b);
// if (!RK_IMPL_PTR(widget)->name().empty())
// RK_LOG_DEV_DEBUG(" ch: "
// << RK_IMPL_PTR(widget)->name()
// << " : visible: " << b);
if (!RK_IMPL_PTR(widget)->name().empty())
RK_LOG_DEV_DEBUG(" ch: "
<< RK_IMPL_PTR(widget)->name()
<< " : visible: " << b);
}
}
}

0 comments on commit c91868b

Please sign in to comment.