VirtualBox

Changeset 80696 in vbox for trunk


Ignore:
Timestamp:
Sep 10, 2019 11:38:18 AM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: macOS: UIGraphicsScrollArea: Use underlying OS setting to acquire actual scroller mode.

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

Legend:

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

    r76553 r80696  
    2727#import <AppKit/NSFont.h>
    2828#import <AppKit/NSScreen.h>
     29#import <AppKit/NSScroller.h>
    2930#import <AppKit/NSWindow.h>
    3031#import <AppKit/NSImageView.h>
     
    261262    if ([NSScreen respondsToSelector: @selector(screensHaveSeparateSpaces)])
    262263        return [NSScreen performSelector: @selector(screensHaveSeparateSpaces)];
     264    else
     265        return false;
     266}
     267
     268bool darwinIsScrollerStyleOverlay()
     269{
     270    /* Check whether scrollers by default have legacy style.
     271     * This method is available since 10.7 only. */
     272    if ([NSScroller respondsToSelector: @selector(preferredScrollerStyle)])
     273    {
     274        const int enmType = (int)(intptr_t)[NSScroller performSelector: @selector(preferredScrollerStyle)];
     275        return enmType == NSScrollerStyleOverlay;
     276    }
    263277    else
    264278        return false;
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/VBoxUtils-darwin.h

    r76581 r80696  
    115115SHARED_LIBRARY_STUFF bool darwinIsOnActiveSpace(NativeNSWindowRef pWindow);
    116116SHARED_LIBRARY_STUFF bool darwinScreensHaveSeparateSpaces();
     117SHARED_LIBRARY_STUFF bool darwinIsScrollerStyleOverlay();
    117118
    118119bool darwinOpenFile(NativeNSStringRef pstrFile);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsScrollArea.cpp

    r80695 r80696  
    2323#include "UIGraphicsScrollArea.h"
    2424#include "UIGraphicsScrollBar.h"
     25#ifdef VBOX_WS_MAC
     26# include "VBoxUtils.h"
     27#endif
    2528
    2629
     
    245248void UIGraphicsScrollArea::prepareWidgets()
    246249{
     250#ifdef VBOX_WS_MAC
     251    /* Check whether scroll-bar is in auto-hide (overlay) mode: */
     252    m_fAutoHideMode = darwinIsScrollerStyleOverlay();
     253#endif
     254
    247255    /* Create scroll-bar: */
    248256    m_pScrollBar = new UIGraphicsScrollBar(m_enmOrientation, m_fAutoHideMode, this);
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