VirtualBox

Changeset 52593 in vbox


Ignore:
Timestamp:
Sep 4, 2014 1:09:58 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: UISlidingToolBar: Make sure it has no platform shadows after resize/activation.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/VBoxUtils-darwin-cocoa.mm

    r51275 r52593  
    184184        [pWindow setHasShadow:YES];
    185185    }
     186}
     187
     188void darwinSetWindowHasShadow(NativeNSWindowRef pWindow, bool fEnabled)
     189{
     190    if (fEnabled)
     191        [pWindow setHasShadow :YES];
     192    else
     193        [pWindow setHasShadow :NO];
    186194}
    187195
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/VBoxUtils-darwin.cpp

    r51130 r52593  
    8282{
    8383    ::darwinSetShowsWindowTransparentImpl(::darwinToNativeWindow(pWidget), fEnabled);
     84}
     85
     86void darwinSetWindowHasShadow(QWidget *pWidget, bool fEnabled)
     87{
     88    ::darwinSetWindowHasShadow(::darwinToNativeWindow(pWidget), fEnabled);
    8489}
    8590
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/VBoxUtils-darwin.h

    r51130 r52593  
    6262void darwinLabelWindow(NativeNSWindowRef pWindow, NativeNSImageRef pImage, bool fCenter);
    6363void darwinSetShowsWindowTransparentImpl(NativeNSWindowRef pWindow, bool fEnabled);
     64void darwinSetWindowHasShadow(NativeNSWindowRef pWindow, bool fEnabled);
    6465void darwinSetMouseCoalescingEnabled(bool fEnabled);
    6566
     
    229230void darwinSetHidesAllTitleButtons(QWidget *pWidget);
    230231void darwinSetShowsWindowTransparent(QWidget *pWidget, bool fEnabled);
     232void darwinSetWindowHasShadow(QWidget *pWidget, bool fEnabled);
    231233void darwinSetDockIconMenu(QMenu *pMenu);
    232234void darwinDisableIconsInMenus(void);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISlidingToolBar.cpp

    r52480 r52593  
    264264}
    265265
     266bool UISlidingToolBar::event(QEvent *pEvent)
     267{
     268    /* Depending on event-type: */
     269    switch (pEvent->type())
     270    {
     271        case QEvent::Resize:
     272        case QEvent::WindowActivate:
     273        {
     274            /* By some strange reason
     275             * cocoa resets NSWindow::setHasShadow option
     276             * for frameless windows on every window resize/activation.
     277             * So we have to make sure window still has no shadows. */
     278            darwinSetWindowHasShadow(this, false);
     279            break;
     280        }
     281        default:
     282            break;
     283    }
     284    /* Call to base-class: */
     285    return QWidget::event(pEvent);
     286}
     287
    266288void UISlidingToolBar::setWidgetGeometry(const QRect &rect)
    267289{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISlidingToolBar.h

    r52402 r52593  
    9393    /** Close event handler. */
    9494    virtual void closeEvent(QCloseEvent *pEvent);
     95    /** Common event handler. */
     96    virtual bool event(QEvent *pEvent);
    9597
    9698    /** Defines mdi-sub-window geometry. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette