VirtualBox

Changeset 2240 in vbox for trunk/src


Ignore:
Timestamp:
Apr 19, 2007 4:58:31 PM (18 years ago)
Author:
vboxsync
Message:

1934: Never decrease size in the layout:

Fixing minimum height of the VM & Global Settings Dialog whatsThisLabel so, that its height will never shrinks.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile

    r2178 r2240  
    6868        include/QIRichLabel.h \
    6969        include/VMGlobalSettings.h \
     70        include/VBoxUtils.h \
    7071        include/VBoxGlobal.h \
    7172        include/VBoxVMListBox.h \
  • trunk/src/VBox/Frontends/VirtualBox/src/QIRichLabel.cpp

    r1467 r2240  
    169169   updateLabel (osh);
    170170
    171    if (baseheight == 0)
     171   if ((int)baseheight < heightForWidth (width()))
     172   {
    172173       baseheight = heightForWidth (width());
    173    if ((int)baseheight < heightForWidth (width()))
    174        QFrame::setFixedHeight (heightForWidth (width()));
    175    else
    176174       QFrame::setFixedHeight (baseheight);
     175   }
    177176   emit textChanged();
    178177}
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp

    r2185 r2240  
    980980            break;
    981981        }
    982         case QEvent::Show:
    983         {
    984         /// @todo improve
    985 #if 0
    986             /* Constrain StartVM button size */
    987             QObjectList *list = queryList ("QToolButton",
    988                 QString (vmStartAction->name()) + "_action_button");
    989             QToolButton *actionButton = list->first() ?
    990                 static_cast<QToolButton*> (list->first()) : 0;
    991             if (actionButton)
    992                 new QIConstraintKeeper (actionButton);
    993 #endif
    994             break;
    995         }
    996982
    997983        default:
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxGlobalSettingsDlg.ui

    r2187 r2240  
    10821082            </hbox>
    10831083        </widget>
    1084         <widget class="QLabel" row="2" column="1">
    1085             <property name="name">
    1086                 <cstring>whatsThisLabel</cstring>
    1087             </property>
    1088             <property name="sizePolicy">
    1089                 <sizepolicy>
    1090                     <hsizetype>7</hsizetype>
    1091                     <vsizetype>0</vsizetype>
    1092                     <horstretch>0</horstretch>
    1093                     <verstretch>0</verstretch>
    1094                 </sizepolicy>
    1095             </property>
    1096             <property name="backgroundMode">
    1097                 <enum>PaletteMidlight</enum>
    1098             </property>
    1099             <property name="frameShape">
    1100                 <enum>Box</enum>
    1101             </property>
    1102             <property name="frameShadow">
    1103                 <enum>Sunken</enum>
    1104             </property>
    1105             <property name="margin">
    1106                 <number>7</number>
    1107             </property>
    1108             <property name="scaledContents">
    1109                 <bool>false</bool>
    1110             </property>
    1111             <property name="alignment">
    1112                 <set>WordBreak|AlignJustify|AlignTop</set>
    1113             </property>
    1114         </widget>
    11151084    </grid>
    11161085</widget>
     
    12381207    <include location="local" impldecl="in implementation">VBoxProblemReporter.h</include>
    12391208    <include location="local" impldecl="in implementation">VBoxUSBFilterSettings.h</include>
     1209    <include location="local" impldecl="in implementation">QIRichLabel.h</include>
    12401210</includes>
    12411211<forwards>
    12421212    <forward>class VBoxUSBMenu</forward>
     1213    <forward>class QIRichLabel</forward>
    12431214</forwards>
    12441215<variables>
     
    12561227    <variable access="private">VBoxUSBMenu *usbDevicesMenu;</variable>
    12571228    <variable access="private">bool mLanguageChanged;</variable>
     1229    <variable access="private">QIRichLabel *whatsThisLabel;</variable>
    12581230</variables>
    12591231<slots>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxGlobalSettingsDlg.ui.h

    r2154 r2240  
    198198
    199199        QListViewItem::paintCell (aPainter, aGroup, aColumn, aWidth, aAlign);
    200        
     200
    201201        if (mBuiltIn)
    202202        {
     
    288288    connect (whatsThisTimer, SIGNAL (timeout()), this, SLOT (updateWhatsThis()));
    289289    whatsThisCandidate = NULL;
    290     whatsThisLabel->setMinimumHeight (whatsThisLabel->frameWidth() * 2 +
     290
     291    whatsThisLabel = new QIRichLabel (this, "whatsThisLabel");
     292    VBoxGlobalSettingsDlgLayout->addWidget (whatsThisLabel, 2, 1);
     293
     294    whatsThisLabel->setFocusPolicy (QWidget::NoFocus);
     295    whatsThisLabel->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed);
     296    whatsThisLabel->setBackgroundMode (QLabel::PaletteMidlight);
     297    whatsThisLabel->setFrameShape (QLabel::Box);
     298    whatsThisLabel->setFrameShadow (QLabel::Sunken);
     299    whatsThisLabel->setMargin (7);
     300    whatsThisLabel->setScaledContents (FALSE);
     301    whatsThisLabel->setAlignment (int (QLabel::WordBreak |
     302                                       QLabel::AlignJustify |
     303                                       QLabel::AlignTop));
     304
     305    whatsThisLabel->setFixedHeight (whatsThisLabel->frameWidth() * 2 +
    291306                                      6 /* seems that RichText adds some margin */ +
    292307                                      whatsThisLabel->fontMetrics().lineSpacing() * 3);
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui

    r2187 r2240  
    28192819    <slot>cdMediaChanged()</slot>
    28202820    <slot>fdMediaChanged()</slot>
    2821     <slot>processAdjustSize()</slot>
    28222821    <slot>updateInterfaces( QWidget* )</slot>
    28232822    <slot>networkPageUpdate( QWidget* )</slot>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h

    r2187 r2240  
    419419
    420420    whatsThisLabel->setFixedHeight (whatsThisLabel->frameWidth() * 2 +
    421                                       6 /* seems that RichText adds some margin */ +
    422                                       whatsThisLabel->fontMetrics().lineSpacing() * 3);
     421                                    6 /* seems that RichText adds some margin */ +
     422                                    whatsThisLabel->fontMetrics().lineSpacing() * 3);
    423423    whatsThisLabel->setMinimumWidth (whatsThisLabel->frameWidth() * 2 +
    424424                                     6 /* seems that RichText adds some margin */ +
    425425                                     whatsThisLabel->fontMetrics().width ('m') * 40);
    426     /// @todo possibly, remove after QIConstraintKeeper is properly done
    427     connect (whatsThisLabel, SIGNAL (textChanged()), this, SLOT (processAdjustSize()));
    428426
    429427    /*
     
    799797
    800798    VBoxGlobal::centerWidget (this, parentWidget());
    801 
    802     /// @todo improve
    803 #if 0
    804     new QIConstraintKeeper (whatsThisLabel);
    805 #endif
    806 }
    807 
    808 /// @todo possibly, remove after QIConstraintKeeper is properly done
    809 /// (should be at least possible to move this functionality into it)
    810 void VBoxVMSettingsDlg::processAdjustSize()             
    811 {               
    812     int newHeight = minimumSize().height();             
    813     int oldHeight = height();           
    814     if (newHeight > oldHeight)           
    815         resize (minimumSize());                 
    816 }               
     799}
    817800
    818801void VBoxVMSettingsDlg::updateShortcuts()
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