Replace UBPlatformUtils::disableShadow() with setAttribute(Qt::WA_MacNoShadow, true)

preferencesAboutTextFull
Cédric Luthi 14 years ago
parent 03b32dbb12
commit e90d2d3338
  1. 4
      src/core/UBDisplayManager.cpp
  2. 11
      src/desktop/UBDesktopAnnotationController.cpp
  3. 2
      src/frameworks/UBPlatformUtils.h
  4. 6
      src/frameworks/UBPlatformUtils_linux.cpp
  5. 13
      src/frameworks/UBPlatformUtils_mac.mm
  6. 6
      src/frameworks/UBPlatformUtils_win.cpp
  7. 2
      src/gui/UBDockPalette.cpp

@ -114,7 +114,7 @@ void UBDisplayManager::setAsControl(QWidget* pControlWidget )
mControlWidget->hide(); mControlWidget->hide();
mControlWidget->setGeometry(mDesktop->screenGeometry(mControlScreenIndex)); mControlWidget->setGeometry(mDesktop->screenGeometry(mControlScreenIndex));
mControlWidget->showFullScreen(); mControlWidget->showFullScreen();
UBPlatformUtils::disableShadow(mControlWidget); mControlWidget->setAttribute(Qt::WA_MacNoShadow);
} }
} }
@ -127,7 +127,7 @@ void UBDisplayManager::setAsDisplay(QWidget* pDisplayWidget)
mDisplayWidget->hide(); mDisplayWidget->hide();
mDisplayWidget->setGeometry(mDesktop->screenGeometry(mDisplayScreenIndex)); mDisplayWidget->setGeometry(mDesktop->screenGeometry(mDisplayScreenIndex));
mDisplayWidget->showFullScreen(); mDisplayWidget->showFullScreen();
UBPlatformUtils::disableShadow(mDisplayWidget); mDisplayWidget->setAttribute(Qt::WA_MacNoShadow);
} }
} }

@ -61,14 +61,13 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mTransparentDrawingView = new UBBoardView(UBApplication::boardController, 0); // deleted in UBDesktopAnnotationController::destructor mTransparentDrawingView = new UBBoardView(UBApplication::boardController, 0); // deleted in UBDesktopAnnotationController::destructor
mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true); mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true);
mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true);
mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window); mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window);
mTransparentDrawingView->setCacheMode(QGraphicsView::CacheNone); mTransparentDrawingView->setCacheMode(QGraphicsView::CacheNone);
mTransparentDrawingView->resize(UBApplication::desktop()->width(), UBApplication::desktop()->height()); mTransparentDrawingView->resize(UBApplication::desktop()->width(), UBApplication::desktop()->height());
mTransparentDrawingView->setMouseTracking(true); mTransparentDrawingView->setMouseTracking(true);
UBPlatformUtils::disableShadow(mTransparentDrawingView);
mTransparentDrawingView->setAcceptDrops(false); mTransparentDrawingView->setAcceptDrops(false);
QString backgroundStyle = "QWidget {background-color: rgba(127, 127, 127, 0)}"; QString backgroundStyle = "QWidget {background-color: rgba(127, 127, 127, 0)}";
@ -78,10 +77,8 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mTransparentDrawingView->setScene(mTransparentDrawingScene); mTransparentDrawingView->setScene(mTransparentDrawingScene);
mLibPalette = new UBLibPalette(mTransparentDrawingView); mLibPalette = new UBLibPalette(mTransparentDrawingView);
UBPlatformUtils::disableShadow(mLibPalette);
mDesktopPalette = new UBDesktopPalette(mTransparentDrawingView); mDesktopPalette = new UBDesktopPalette(mTransparentDrawingView);
UBPlatformUtils::disableShadow(mDesktopPalette);
connect(mDesktopPalette, SIGNAL(uniboardClick()), this, SLOT(goToUniboard())); connect(mDesktopPalette, SIGNAL(uniboardClick()), this, SLOT(goToUniboard()));
//connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool))); //connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool)));
@ -100,17 +97,13 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
// Add the desktop associated palettes // Add the desktop associated palettes
mDesktopToolsPalette = new UBDesktopToolsPalette(mTransparentDrawingView); mDesktopToolsPalette = new UBDesktopToolsPalette(mTransparentDrawingView);
UBPlatformUtils::disableShadow(mDesktopToolsPalette);
mDesktopPenPalette = new UBDesktopPenPalette(mTransparentDrawingView); mDesktopPenPalette = new UBDesktopPenPalette(mTransparentDrawingView);
UBPlatformUtils::disableShadow(mDesktopPenPalette);
connect(mDesktopPalette, SIGNAL(maximized()), mDesktopPenPalette, SLOT(onParentMaximized())); connect(mDesktopPalette, SIGNAL(maximized()), mDesktopPenPalette, SLOT(onParentMaximized()));
connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), mDesktopPenPalette, SLOT(onParentMinimized())); connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), mDesktopPenPalette, SLOT(onParentMinimized()));
mDesktopMarkerPalette = new UBDesktopMarkerPalette(mTransparentDrawingView); mDesktopMarkerPalette = new UBDesktopMarkerPalette(mTransparentDrawingView);
UBPlatformUtils::disableShadow(mDesktopMarkerPalette);
mDesktopEraserPalette = new UBDesktopEraserPalette(mTransparentDrawingView); mDesktopEraserPalette = new UBDesktopEraserPalette(mTransparentDrawingView);
UBPlatformUtils::disableShadow(mDesktopEraserPalette);
if (UBPlatformUtils::hasVirtualKeyboard()) if (UBPlatformUtils::hasVirtualKeyboard())
{ {
mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView); mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView);
@ -331,8 +324,6 @@ void UBDesktopAnnotationController::showWindow()
UBDrawingController::drawingController()->setStylusTool(mDesktopStylusTool); UBDrawingController::drawingController()->setStylusTool(mDesktopStylusTool);
mTransparentDrawingView->showFullScreen(); mTransparentDrawingView->showFullScreen();
UBPlatformUtils::disableShadow(mTransparentDrawingView);
UBPlatformUtils::setDesktopMode(true); UBPlatformUtils::setDesktopMode(true);

@ -95,8 +95,6 @@ class UBPlatformUtils
static QString preferredTranslation(); static QString preferredTranslation();
static QString preferredLanguage(); static QString preferredLanguage();
static void disableShadow(QWidget *widget);
static bool hasVirtualKeyboard(); static bool hasVirtualKeyboard();
//static void showVirtualKeyboard(); //static void showVirtualKeyboard();

@ -53,12 +53,6 @@ QString UBPlatformUtils::preferredLanguage()
return QLocale::system().name(); return QLocale::system().name();
} }
void UBPlatformUtils::disableShadow(QWidget *widget)
{
Q_UNUSED(widget)
// Linux windows do not have a shadow
}
void UBPlatformUtils::runInstaller(const QString &installerFilePath) void UBPlatformUtils::runInstaller(const QString &installerFilePath)
{ {
// TODO UB 4.x - auto update & installer are deactivated on Linux // TODO UB 4.x - auto update & installer are deactivated on Linux

@ -205,19 +205,6 @@ QString UBPlatformUtils::preferredLanguage()
return lprojFileInfo.baseName(); return lprojFileInfo.baseName();
} }
void UBPlatformUtils::disableShadow(QWidget *widget)
{
#ifndef QT_MAC_USE_COCOA
// Make sure we have a native window, see http://doc.trolltech.com/4.5/qwidget.html#native-widgets-vs-alien-widgets
widget->winId();
ChangeWindowAttributes(qt_mac_window_for(widget), kWindowNoShadowAttribute, kWindowNoAttributes);
#else
NSView* view = (NSView*)widget->winId();
NSWindow* window = [view window];
[window setHasShadow:NO];
#endif
}
void UBPlatformUtils::runInstaller(const QString &installerFilePath) void UBPlatformUtils::runInstaller(const QString &installerFilePath)
{ {
UBApplication::setDisabled(true); UBApplication::setDisabled(true);

@ -61,12 +61,6 @@ QString UBPlatformUtils::preferredLanguage()
return QLocale::system().name(); return QLocale::system().name();
} }
void UBPlatformUtils::disableShadow(QWidget *widget)
{
Q_UNUSED(widget);
// Windows windows do not have a shadow
}
//void UBPlatformUtils::showVirtualKeyboard() //void UBPlatformUtils::showVirtualKeyboard()
//{ //{
// ShellExecute(NULL,NULL,TEXT("tabtip.exe"), NULL, NULL, SW_SHOWNORMAL); // ShellExecute(NULL,NULL,TEXT("tabtip.exe"), NULL, NULL, SW_SHOWNORMAL);

@ -33,7 +33,7 @@ UBDockPalette::UBDockPalette(QWidget *parent, const char *name)
{ {
// standalone window // standalone window
setAttribute(Qt::WA_TranslucentBackground); setAttribute(Qt::WA_TranslucentBackground);
UBPlatformUtils::disableShadow(this); setAttribute(Qt::WA_MacNoShadow);
} }
mBackgroundBrush = QBrush(UBSettings::paletteColor); mBackgroundBrush = QBrush(UBSettings::paletteColor);

Loading…
Cancel
Save