diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 81133d44..741fafe6 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -374,14 +374,21 @@ void UBDesktopAnnotationController::close() void UBDesktopAnnotationController::stylusToolChanged(int tool) { Q_UNUSED(tool); -// UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool; -// if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text) -// { -// if(mKeyboardPalette->m_isVisible) -// UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger); -// } - updateBackground(); + if (UBDrawingController::drawingController()->isInDesktopMode()) + { + UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool; + if(eTool == UBStylusTool::Selector) + { + UBPlatformUtils::toggleFinder(true); + } + else + { + UBPlatformUtils::toggleFinder(false); + } + + updateBackground(); + } } diff --git a/src/frameworks/UBPlatformUtils.h b/src/frameworks/UBPlatformUtils.h index 99ee165d..8e6b91ed 100644 --- a/src/frameworks/UBPlatformUtils.h +++ b/src/frameworks/UBPlatformUtils.h @@ -212,6 +212,7 @@ public: #ifdef Q_OS_OSX static void SetMacLocaleByIdentifier(const QString& id); + static void toggleFinder(const bool on); #endif }; diff --git a/src/frameworks/UBPlatformUtils_mac.mm b/src/frameworks/UBPlatformUtils_mac.mm index ec8be575..37d5b1b3 100644 --- a/src/frameworks/UBPlatformUtils_mac.mm +++ b/src/frameworks/UBPlatformUtils_mac.mm @@ -524,6 +524,18 @@ QString UBPlatformUtils::urlFromClipboard() return qsRet; } +void UBPlatformUtils::toggleFinder(const bool on) +{ + if (on) + { + [NSApp setPresentationOptions:NSApplicationPresentationDefault]; + } + else + { + [NSApp setPresentationOptions:NSApplicationPresentationHideMenuBar | NSApplicationPresentationHideDock]; + } +} + void UBPlatformUtils::SetMacLocaleByIdentifier(const QString& id) {