VirtualBox

Changeset 10361 in vbox


Ignore:
Timestamp:
Jul 8, 2008 12:54:06 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
32997
Message:

FE/Qt4-OSX: Enable a resize animation on the settings dialog if a new settings
page is selected.

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

Legend:

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

    r10230 r10361  
    165165void darwinSetShowToolBarButton (QToolBar *aToolBar, bool aShow);
    166166
     167void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget);
     168
    167169/* Proxy icon creation */
    168170QPixmap darwinCreateDragPixmap (const QPixmap& aPixmap, const QString &aText);
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSettingsDialog.cpp

    r10329 r10361  
    2727#include "QIWidgetValidator.h"
    2828
     29#ifdef Q_WS_MAC
     30# include "VBoxUtils.h"
     31#endif /* Q_WS_MAC */
     32
    2933/* Qt includes */
    3034#include <QTimer>
     
    5963    /* Apply UI decorations */
    6064    Ui::VBoxSettingsDialog::setupUi (this);
     65
     66#ifdef Q_WS_MAC
     67//    VBoxGlobal::setLayoutMargin (centralWidget()->layout(), 0);
     68    /* No status bar on the mac */
     69    setSizeGripEnabled (false);
     70    setStatusBar (NULL);
     71#endif
    6172
    6273    /* Page title font is derived from the system font */
     
    206217        int id = aItem->text (treeWidget_Id).toInt();
    207218        Assert (id >= 0);
     219
     220#ifndef Q_WS_MAC
    208221        mLbTitle->setText (::path (aItem));
    209222        mStack->setCurrentIndex (id);
     223#else /* Q_WS_MAC */
     224        /* We will update at once later */
     225        setUpdatesEnabled (false);
     226        /* Set all tab size policies to ignored */
     227        for (int i = 0; i < mStack->count(); ++i)
     228            mStack->widget (i)->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Ignored);
     229        /* Set the size policy of the current tab to preferred */
     230        if (mStack->widget (id))
     231            mStack->widget (id)->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred);
     232        /* Set the new current tab */
     233        mLbTitle->setText (::path (aItem));
     234        mStack->setCurrentIndex (id);
     235        /* Activate the new layout */
     236        layout()->activate();
     237        setUpdatesEnabled (true);
     238//        mAllWidget->hide();
     239        /* Play the resize animation */
     240        ::darwinWindowAnimateResize (this, QRect (x(), y(),
     241                                                  minimumSizeHint().width(), minimumSizeHint().height()));
     242//        mAllWidget->show();
     243        /* Set the new size to Qt also */
     244        setFixedSize (minimumSizeHint());
     245#endif /* !Q_WS_MAC */
    210246    }
    211247}
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox4/src/darwin/VBoxUtils-darwin.cpp

    r10231 r10361  
    112112        AssertCarbonOSStatus (err);
    113113    }
     114}
     115
     116void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget)
     117{
     118    HIRect r = ::darwinToHIRect (aTarget);
     119    TransitionWindowWithOptions (::darwinToWindowRef (aWidget), kWindowSlideTransitionEffect, kWindowResizeTransitionAction, &r, false, NULL);
    114120}
    115121
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxSettingsDialog.ui

    r10212 r10361  
    2828  </property>
    2929  <widget class="QWidget" name="centralwidget" >
    30    <layout class="QGridLayout" >
    31     <item rowspan="3" row="0" column="0" >
    32      <widget class="QTreeWidget" name="mTwSelector" >
    33       <property name="sizePolicy" >
    34        <sizepolicy vsizetype="Expanding" hsizetype="Minimum" >
    35         <horstretch>0</horstretch>
    36         <verstretch>0</verstretch>
    37        </sizepolicy>
    38       </property>
    39       <property name="verticalScrollBarPolicy" >
    40        <enum>Qt::ScrollBarAlwaysOff</enum>
    41       </property>
    42       <property name="horizontalScrollBarPolicy" >
    43        <enum>Qt::ScrollBarAlwaysOff</enum>
    44       </property>
    45       <property name="rootIsDecorated" >
    46        <bool>false</bool>
    47       </property>
    48       <property name="uniformRowHeights" >
    49        <bool>true</bool>
    50       </property>
    51       <column>
    52        <property name="text" >
    53         <string>Category</string>
    54        </property>
    55       </column>
    56       <column>
    57        <property name="text" >
    58         <string>[id]</string>
    59        </property>
    60       </column>
    61       <column>
    62        <property name="text" >
    63         <string>[link]</string>
    64        </property>
    65       </column>
    66      </widget>
    67     </item>
    68     <item row="0" column="1" >
    69      <widget class="QLabel" name="mLbTitle" >
    70       <property name="sizePolicy" >
    71        <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
    72         <horstretch>0</horstretch>
    73         <verstretch>0</verstretch>
    74        </sizepolicy>
    75       </property>
    76       <property name="palette" >
    77        <palette>
    78         <active>
    79          <colorrole role="Window" >
    80           <brush brushstyle="SolidPattern" >
    81            <color alpha="255" >
    82             <red>255</red>
    83             <green>255</green>
    84             <blue>255</blue>
    85            </color>
    86           </brush>
    87          </colorrole>
    88         </active>
    89         <inactive>
    90          <colorrole role="Window" >
    91           <brush brushstyle="SolidPattern" >
    92            <color alpha="255" >
    93             <red>255</red>
    94             <green>255</green>
    95             <blue>255</blue>
    96            </color>
    97           </brush>
    98          </colorrole>
    99         </inactive>
    100         <disabled>
    101          <colorrole role="Window" >
    102           <brush brushstyle="SolidPattern" >
    103            <color alpha="255" >
    104             <red>255</red>
    105             <green>255</green>
    106             <blue>255</blue>
    107            </color>
    108           </brush>
    109          </colorrole>
    110         </disabled>
    111        </palette>
    112       </property>
    113       <property name="font" >
    114        <font>
    115         <family>Sans Serif</family>
    116         <pointsize>11</pointsize>
    117         <weight>75</weight>
    118         <bold>true</bold>
    119        </font>
    120       </property>
    121       <property name="autoFillBackground" >
    122        <bool>true</bool>
    123       </property>
    124       <property name="frameShape" >
    125        <enum>QFrame::Box</enum>
    126       </property>
    127       <property name="frameShadow" >
    128        <enum>QFrame::Sunken</enum>
    129       </property>
    130       <property name="text" >
    131        <string/>
    132       </property>
    133       <property name="margin" >
    134        <number>7</number>
    135       </property>
    136      </widget>
    137     </item>
    138     <item row="1" column="1" >
    139      <widget class="QWidget" native="1" name="mWtStackHandler" >
    140       <property name="sizePolicy" >
    141        <sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
    142         <horstretch>0</horstretch>
    143         <verstretch>0</verstretch>
    144        </sizepolicy>
    145       </property>
    146      </widget>
    147     </item>
    148     <item row="2" column="1" >
    149      <widget class="QILabel" name="mLbWhatsThis" >
    150       <property name="frameShape" >
    151        <enum>QFrame::Box</enum>
    152       </property>
    153       <property name="frameShadow" >
    154        <enum>QFrame::Sunken</enum>
    155       </property>
    156       <property name="alignment" >
    157        <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
    158       </property>
    159       <property name="wordWrap" >
    160        <bool>true</bool>
    161       </property>
    162       <property name="margin" >
    163        <number>7</number>
    164       </property>
    165      </widget>
    166     </item>
    167     <item row="3" column="0" colspan="2" >
    168      <widget class="QIDialogButtonBox" name="mButtonBox" >
    169       <property name="standardButtons" >
    170        <set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
    171       </property>
     30   <layout class="QHBoxLayout" >
     31    <item>
     32     <widget class="QWidget" native="1" name="mAllWidget" >
     33      <layout class="QGridLayout" >
     34       <property name="leftMargin" >
     35        <number>0</number>
     36       </property>
     37       <property name="topMargin" >
     38        <number>0</number>
     39       </property>
     40       <property name="rightMargin" >
     41        <number>0</number>
     42       </property>
     43       <property name="bottomMargin" >
     44        <number>0</number>
     45       </property>
     46       <item rowspan="3" row="0" column="0" >
     47        <widget class="QTreeWidget" name="mTwSelector" >
     48         <property name="sizePolicy" >
     49          <sizepolicy vsizetype="Expanding" hsizetype="Minimum" >
     50           <horstretch>0</horstretch>
     51           <verstretch>0</verstretch>
     52          </sizepolicy>
     53         </property>
     54         <property name="verticalScrollBarPolicy" >
     55          <enum>Qt::ScrollBarAlwaysOff</enum>
     56         </property>
     57         <property name="horizontalScrollBarPolicy" >
     58          <enum>Qt::ScrollBarAlwaysOff</enum>
     59         </property>
     60         <property name="rootIsDecorated" >
     61          <bool>false</bool>
     62         </property>
     63         <property name="uniformRowHeights" >
     64          <bool>true</bool>
     65         </property>
     66         <column>
     67          <property name="text" >
     68           <string>Category</string>
     69          </property>
     70         </column>
     71         <column>
     72          <property name="text" >
     73           <string>[id]</string>
     74          </property>
     75         </column>
     76         <column>
     77          <property name="text" >
     78           <string>[link]</string>
     79          </property>
     80         </column>
     81        </widget>
     82       </item>
     83       <item row="0" column="1" >
     84        <widget class="QLabel" name="mLbTitle" >
     85         <property name="sizePolicy" >
     86          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
     87           <horstretch>0</horstretch>
     88           <verstretch>0</verstretch>
     89          </sizepolicy>
     90         </property>
     91         <property name="palette" >
     92          <palette>
     93           <active>
     94            <colorrole role="Window" >
     95             <brush brushstyle="SolidPattern" >
     96              <color alpha="255" >
     97               <red>255</red>
     98               <green>255</green>
     99               <blue>255</blue>
     100              </color>
     101             </brush>
     102            </colorrole>
     103           </active>
     104           <inactive>
     105            <colorrole role="Window" >
     106             <brush brushstyle="SolidPattern" >
     107              <color alpha="255" >
     108               <red>255</red>
     109               <green>255</green>
     110               <blue>255</blue>
     111              </color>
     112             </brush>
     113            </colorrole>
     114           </inactive>
     115           <disabled>
     116            <colorrole role="Window" >
     117             <brush brushstyle="SolidPattern" >
     118              <color alpha="255" >
     119               <red>255</red>
     120               <green>255</green>
     121               <blue>255</blue>
     122              </color>
     123             </brush>
     124            </colorrole>
     125           </disabled>
     126          </palette>
     127         </property>
     128         <property name="font" >
     129          <font>
     130           <family>Sans Serif</family>
     131           <pointsize>11</pointsize>
     132           <weight>75</weight>
     133           <bold>true</bold>
     134          </font>
     135         </property>
     136         <property name="autoFillBackground" >
     137          <bool>true</bool>
     138         </property>
     139         <property name="frameShape" >
     140          <enum>QFrame::Box</enum>
     141         </property>
     142         <property name="frameShadow" >
     143          <enum>QFrame::Sunken</enum>
     144         </property>
     145         <property name="text" >
     146          <string/>
     147         </property>
     148         <property name="margin" >
     149          <number>7</number>
     150         </property>
     151        </widget>
     152       </item>
     153       <item row="1" column="1" >
     154        <widget class="QWidget" native="1" name="mWtStackHandler" >
     155         <property name="sizePolicy" >
     156          <sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
     157           <horstretch>0</horstretch>
     158           <verstretch>0</verstretch>
     159          </sizepolicy>
     160         </property>
     161        </widget>
     162       </item>
     163       <item row="2" column="1" >
     164        <widget class="QILabel" name="mLbWhatsThis" >
     165         <property name="frameShape" >
     166          <enum>QFrame::Box</enum>
     167         </property>
     168         <property name="frameShadow" >
     169          <enum>QFrame::Sunken</enum>
     170         </property>
     171         <property name="alignment" >
     172          <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
     173         </property>
     174         <property name="wordWrap" >
     175          <bool>true</bool>
     176         </property>
     177         <property name="margin" >
     178          <number>7</number>
     179         </property>
     180        </widget>
     181       </item>
     182       <item row="3" column="0" colspan="2" >
     183        <widget class="QIDialogButtonBox" name="mButtonBox" >
     184         <property name="standardButtons" >
     185          <set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
     186         </property>
     187        </widget>
     188       </item>
     189      </layout>
    172190     </widget>
    173191    </item>
Note: See TracChangeset for help on using the changeset viewer.

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