Hi all,
I have a custom MouseListener
in my DocumentWindow
which should listen to ResizableCorner/Border
but the callback are not triggered (at least on macOS) when setNativeTitleBar(true).
I suppose the ResizableCorner/Border are not in use when set to native title bar…
Any clue how to achieve this?
class Window : public DocumentWindow
{
public:
Window () : DocumentWindow ("Window", Colours::transparentWhite, DocumentWindow::allButtons)
{
setWantsKeyboardFocus(true);
setUsingNativeTitleBar(true);
setContentOwned (/* add main Component*/);
setResizable (true, true);
if (resizableCorner != nullptr)
resizableCorner->addMouseListener(&resizeMouseListener, true);
if (resizableBorder != nullptr)
resizableBorder->addMouseListener(&resizeMouseListener, true);
centreWithSize (getWidth(), getHeight());
setVisible (true);
}
~Window() = default;
private:
class ResizeMouseListener: public MouseListener
{
public:
~ResizeMouseListener() override = default;
void mouseDrag(const MouseEvent& e) override {
DBG("mouse drag");
}
void mouseUp(const MouseEvent& e) override {
DBG("mouse up");
}
};
ResizeMouseListener resizeMouseListener;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Window)
};