VirtualBox

Ignore:
Timestamp:
Jul 4, 2008 2:10:42 PM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4-OSX: Added method to disable/enable the toolbar button on a unified
toolbar (this is needed for the upcoming settings change).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxToolBar.h

    r10228 r10230  
    2323#ifndef __VBoxToolBar_h__
    2424#define __VBoxToolBar_h__
     25
     26
     27#ifdef Q_WS_MAC
     28 #include "VBoxUtils.h"
     29#endif
    2530
    2631/* Qt includes */
     
    6772    }
    6873
     74    void setShowToolBarButton (bool aShow)
     75    {
     76#ifdef Q_WS_MAC
     77        ::darwinSetShowToolBarButton (this, aShow);
     78#else  /* Q_WS_MAC */
     79        NOREF (aShow);
     80#endif /* !Q_WS_MAC */
     81    }
     82
    6983
    7084    /**
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUtils.h

    r10165 r10230  
    100100class QImage;
    101101class QPixmap;
     102class QToolBar;
    102103class VBoxFrameBuffer;
    103104
     
    162163}
    163164
     165void darwinSetShowToolBarButton (QToolBar *aToolBar, bool aShow);
     166
    164167/* Proxy icon creation */
    165168QPixmap darwinCreateDragPixmap (const QPixmap& aPixmap, const QString &aText);
  • trunk/src/VBox/Frontends/VirtualBox4/src/darwin/VBoxUtils-darwin.cpp

    r9438 r10230  
    3333#include <QPainter>
    3434#include <QApplication>
     35#include <QToolBar>
    3536
    3637#if QT_VERSION < 0x040400
     
    100101    Assert (!qpm.isNull());
    101102    return ::darwinToCGImageRef (&qpm);
     103}
     104
     105void darwinSetShowToolBarButton (QToolBar *aToolBar, bool aShow)
     106{
     107    QWidget *parent = aToolBar->parentWidget();
     108    if (parent)
     109    {
     110        int attr[] = { kHIWindowBitToolbarButton, 0 };
     111        int err = HIWindowChangeAttributes (::darwinToWindowRef (parent), aShow ? attr:NULL, aShow ? NULL:attr);
     112        AssertCarbonOSStatus (err);
     113    }
    102114}
    103115
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