VirtualBox

儲存庫 vbox 的更動 17150


忽略:
時間撮記:
2009-2-26 上午10:40:43 (16 年 以前)
作者:
vboxsync
訊息:

FE/Qt4-OSX: Removed unnecessary title bar buttons & resize indicator on Cocoa.

位置:
trunk/src/VBox/Frontends/VirtualBox
檔案:
修改 6 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils-darwin.h

    r17147 r17150  
    7272 ********************************************************************************/
    7373void darwinSetShowsToolbarButtonImpl (NativeWindowRef aWindow, bool aEnabled);
     74void darwinSetShowsResizeIndicatorImpl (NativeWindowRef aWindow, bool aEnabled);
     75void darwinSetHidesAllTitleButtonsImpl (NativeWindowRef aWindow);
    7476void darwinSetMouseCoalescingEnabled (bool aEnabled);
    7577
     
    123125 ********************************************************************************/
    124126void darwinSetShowsToolbarButton (QToolBar *aToolBar, bool aEnabled);
     127void darwinSetShowsResizeIndicator (QWidget *aWidget, bool aEnabled);
     128void darwinSetHidesAllTitleButtons (QWidget *aWidget);
    125129void darwinDisableIconsInMenus (void);
    126130
     
    130134 *
    131135 ********************************************************************************/
     136void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget);
    132137QString darwinSystemLanguage (void);
    133138QPixmap darwinCreateDragPixmap (const QPixmap& aPixmap, const QString &aText);
    134 void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget);
    135139
    136140
  • trunk/src/VBox/Frontends/VirtualBox/src/QIDialog.cpp

    r17126 r17150  
    4747        setFixedSize (size());
    4848#ifdef Q_WS_MAC
    49 # ifdef QT_MAC_USE_COCOA
    50         /** @todo Carbon -> Cocoa */
    51 # else
    52         ChangeWindowAttributes (::darwinToNativeWindow (this), kWindowNoAttributes, kWindowResizableAttribute);
    53 # endif
     49        ::darwinSetShowsResizeIndicator (this, false);
    5450#endif /* Q_WS_MAC */
    5551    }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSettingsDialog.cpp

    r17147 r17150  
    299299        setFixedSize (ss);
    300300    }
     301    ::darwinSetShowsResizeIndicator (this, false);
    301302#endif /* !Q_WS_MAC */
    302303# ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS
     
    414415    int minWidth = mSelector->minWidth();
    415416#ifdef Q_WS_MAC
     417    /* Remove all title bar buttons (Buggy Qt) */
     418    ::darwinSetHidesAllTitleButtons (this);
     419
    416420    /* Set all size policies to ignored */
    417421    for (int i = 0; i < mStack->count(); ++i)
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-carbon.cpp

    r17147 r17150  
    3030NativeWindowRef darwinToNativeWindowImpl (NativeViewRef aView)
    3131{
    32     return reinterpret_cast<WindowRef> (::HIViewGetWindow (aView));
     32    if (aView)
     33        return reinterpret_cast<WindowRef> (::HIViewGetWindow (aView));
     34    return NULL;
    3335}
    3436
    3537void darwinSetShowsToolbarButtonImpl (NativeWindowRef aWindow, bool aEnabled)
    3638{
    37     int err = ::ChangeWindowAttributes (aWindow, aEnabled ? kWindowToolbarButtonAttribute:kWindowNoAttributes,
    38                                                  aEnabled ? kWindowNoAttributes:kWindowToolbarButtonAttribute);
     39    int err = ::ChangeWindowAttributes (aWindow, aEnabled ? kWindowToolbarButtonAttribute : kWindowNoAttributes,
     40                                                 aEnabled ? kWindowNoAttributes : kWindowToolbarButtonAttribute);
     41    AssertCarbonOSStatus (err);
     42}
     43
     44void darwinSetShowsResizeIndicatorImpl (NativeWindowRef aWindow, bool aEnabled)
     45{
     46    int err = ::ChangeWindowAttributes (aWindow, aEnabled ? kWindowResizableAttribute : kWindowNoAttributes,
     47                                                 aEnabled ? kWindowNoAttributes : kWindowResizableAttribute);
    3948    AssertCarbonOSStatus (err);
    4049}
     
    4251void darwinSetMouseCoalescingEnabled (bool aEnabled)
    4352{
    44     ::SetMouseCoalescingEnabled (aEnabled, NULL);
     53    int err = ::SetMouseCoalescingEnabled (aEnabled, NULL);
     54    AssertCarbonOSStatus (err);
    4555}
    4656
     
    4858{
    4959    HIRect r = CGRectMake (x, y, width, height);
    50     TransitionWindowWithOptions (aWidget, kWindowSlideTransitionEffect, kWindowResizeTransitionAction, &r, false, NULL);
    51 }
    52 
     60    int err = ::TransitionWindowWithOptions (aWidget,
     61                                             kWindowSlideTransitionEffect,
     62                                             kWindowResizeTransitionAction,
     63                                             &r,
     64                                             false,
     65                                             NULL);
     66    AssertCarbonOSStatus (err);
     67}
    5368
    5469
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-cocoa.m

    r17147 r17150  
    3333    if (aView)
    3434        return [aView window];
    35     return 0;
     35    return NULL;
    3636}
    3737
     
    3939{
    4040    [aWindow setShowsToolbarButton:aEnabled];
     41}
     42
     43void darwinSetShowsResizeIndicatorImpl (NativeWindowRef aWindow, bool aEnabled)
     44{
     45    [aWindow setShowsResizeIndicator:aEnabled];
     46}
     47
     48void darwinSetHidesAllTitleButtonsImpl (NativeWindowRef aWindow)
     49{
     50    NSButton *closeButton = [aWindow standardWindowButton:NSWindowCloseButton];
     51    if (closeButton != Nil)
     52        [closeButton setHidden:YES];
     53    NSButton *minButton = [aWindow standardWindowButton:NSWindowMiniaturizeButton];
     54    if (minButton != Nil)
     55        [minButton setHidden:YES];
     56    NSButton *zoomButton = [aWindow standardWindowButton:NSWindowZoomButton];
     57    if (zoomButton != Nil)
     58        [zoomButton setHidden:YES];
     59    NSButton *iconButton = [aWindow standardWindowButton:NSWindowDocumentIconButton];
     60    if (iconButton != Nil)
     61        [iconButton setHidden:YES];
    4162}
    4263
     
    6889    [aWindow setFrame:windowFrame display:YES animate:YES];
    6990}
     91
  • trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp

    r17147 r17150  
    4141NativeWindowRef darwinToNativeWindow (QWidget *aWidget)
    4242{
    43     return darwinToNativeWindowImpl (::darwinToNativeView (aWidget));
     43    return ::darwinToNativeWindowImpl (::darwinToNativeView (aWidget));
    4444}
    4545
    4646NativeWindowRef darwinToNativeWindow (NativeViewRef aView)
    4747{
    48     return darwinToNativeWindowImpl (aView);
     48    return ::darwinToNativeWindowImpl (aView);
    4949}
    5050
     
    5353    QWidget *parent = aToolBar->parentWidget();
    5454    if (parent)
    55         darwinSetShowsToolbarButtonImpl (::darwinToNativeWindow (parent), aEnabled);
     55        ::darwinSetShowsToolbarButtonImpl (::darwinToNativeWindow (parent), aEnabled);
    5656}
    5757
    5858void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget)
    5959{
    60     darwinWindowAnimateResizeImpl (::darwinToNativeWindow (aWidget), aTarget.x(), aTarget.y(), aTarget.width(), aTarget.height());
     60    ::darwinWindowAnimateResizeImpl (::darwinToNativeWindow (aWidget), aTarget.x(), aTarget.y(), aTarget.width(), aTarget.height());
     61}
     62
     63void darwinSetHidesAllTitleButtons (QWidget *aWidget)
     64{
     65#ifdef QT_MAC_USE_COCOA
     66    /* Currently only necessary in the Cocoa version */
     67    ::darwinSetHidesAllTitleButtonsImpl (::darwinToNativeWindow (aWidget));
     68#else /* QT_MAC_USE_COCOA */
     69    NOREF (aWidget);
     70#endif /* !QT_MAC_USE_COCOA */
     71}
     72
     73void darwinSetShowsResizeIndicator (QWidget *aWidget, bool aEnabled)
     74{
     75    ::darwinSetShowsResizeIndicatorImpl (::darwinToNativeWindow (aWidget), aEnabled);
    6176}
    6277
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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