Changeset 43820 in vbox
- Timestamp:
- Nov 7, 2012 8:05:20 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
r43819 r43820 638 638 void UIGChooserItemGroup::updateToolTip() 639 639 { 640 /* Not for main root: */ 641 if (isMainRoot()) 642 return; 643 640 644 /* Prepare variables: */ 641 645 QStringList toolTipInfo; … … 717 721 } 718 722 723 /* Update: */ 724 recacheVisibleName(); 725 recacheHeaderSize(); 719 726 updateToolTip(); 720 727 } … … 746 753 } 747 754 755 /* Update: */ 756 recacheVisibleName(); 757 recacheHeaderSize(); 748 758 updateToolTip(); 749 759 } … … 759 769 } 760 770 771 /* Update: */ 772 recacheVisibleName(); 773 recacheHeaderSize(); 761 774 updateToolTip(); 762 775 } … … 812 825 } 813 826 827 /* Update: */ 828 recacheVisibleName(); 829 recacheHeaderSize(); 814 830 updateToolTip(); 815 831 } … … 906 922 int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt(); 907 923 int iVerticalMargin = data(GroupItemData_VerticalMargin).toInt(); 908 int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt();909 924 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt(); 910 925 int iFullHeaderHeight = data(GroupItemData_FullHeaderSize).toSize().height(); 911 926 int iPreviousVerticalIndent = 0; 912 927 913 /* Header (root 928 /* Header (root-item): */ 914 929 if (isRoot()) 915 930 { 916 /* Hide widgets: */ 917 if (m_pToggleButton) 918 m_pToggleButton->hide(); 919 if (m_pEnterButton) 920 m_pEnterButton->hide(); 921 922 if (!isMainRoot()) 923 { 924 /* Exit-button? */ 931 /* Header (main root-item): */ 932 if (isMainRoot()) 933 { 934 /* Prepare body indent: */ 935 iPreviousVerticalIndent = 2; 936 } 937 /* Header (non-main root-item): */ 938 else 939 { 940 /* Hide unnecessary buttons: */ 941 if (m_pToggleButton) 942 m_pToggleButton->hide(); 943 if (m_pEnterButton) 944 m_pEnterButton->hide(); 945 946 /* Exit-button: */ 925 947 if (m_pExitButton) 926 948 { 927 /* Show exit-button: */928 m_pExitButton->show();929 930 949 /* Prepare variables: */ 931 950 int iExitButtonHeight = data(GroupItemData_ExitButtonSize).toSize().height(); 932 933 951 /* Layout exit-button: */ 934 952 int iExitButtonX = iHorizontalMargin + 2; … … 936 954 iVerticalMargin + (iFullHeaderHeight - iExitButtonHeight) / 2; 937 955 m_pExitButton->setPos(iExitButtonX, iExitButtonY); 956 /* Show exit-button: */ 957 m_pExitButton->show(); 938 958 } 939 959 … … 941 961 iPreviousVerticalIndent = iVerticalMargin + iFullHeaderHeight + iVerticalMargin + iMinorSpacing; 942 962 } 943 else 944 { 945 /* Prepare body indent: */ 946 iPreviousVerticalIndent = 2; 947 } 948 } 949 /* Header (non-root item): */ 963 } 964 /* Header (non-root-item): */ 950 965 else 951 966 { 952 /* Hide exit-button: */ 967 /* Prepare variables: */ 968 QSize toggleButtonSize = data(GroupItemData_ToggleButtonSize).toSize(); 969 970 /* Hide unnecessary button: */ 953 971 if (m_pExitButton) 954 972 m_pExitButton->hide(); 955 /* Show toggle-button: */ 973 974 /* Toggle-button: */ 956 975 if (m_pToggleButton) 976 { 977 /* Prepare variables: */ 978 int iToggleButtonHeight = toggleButtonSize.height(); 979 /* Layout toggle-button: */ 980 int iToggleButtonX = iHorizontalMargin; 981 int iToggleButtonY = iToggleButtonHeight == iFullHeaderHeight ? iVerticalMargin : 982 iVerticalMargin + (iFullHeaderHeight - iToggleButtonHeight) / 2; 983 m_pToggleButton->setPos(iToggleButtonX, iToggleButtonY); 984 /* Show toggle-button: */ 957 985 m_pToggleButton->show(); 958 959 /* Prepare variables: */ 960 int iFullWidth = geometry().width(); 961 QSizeF toggleButtonSize = data(GroupItemData_ToggleButtonSize).toSize(); 962 int iToggleButtonWidth = toggleButtonSize.width(); 963 int iButtonHeight = toggleButtonSize.height(); 964 QSizeF enterButtonSize = data(GroupItemData_EnterButtonSize).toSize(); 965 int iEnterButtonWidth = enterButtonSize.width(); 966 int iEnterButtonHeight = enterButtonSize.height(); 967 968 /* Layout toggle-button: */ 969 int iToggleButtonX = iHorizontalMargin; 970 int iToggleButtonY = iButtonHeight == iFullHeaderHeight ? iVerticalMargin : 971 iVerticalMargin + (iFullHeaderHeight - iButtonHeight) / 2; 972 m_pToggleButton->setPos(iToggleButtonX, iToggleButtonY); 973 974 /* Layout enter-button: */ 975 int iEnterButtonX = iFullWidth - iHorizontalMargin - iEnterButtonWidth; 976 int iEnterButtonY = iEnterButtonHeight == iFullHeaderHeight ? iVerticalMargin : 977 iVerticalMargin + (iFullHeaderHeight - iEnterButtonHeight) / 2; 978 m_pEnterButton->setPos(iEnterButtonX, iEnterButtonY); 979 980 /* Layout name-editor: */ 981 int iNameEditorX = iHorizontalMargin + iToggleButtonWidth + iMajorSpacing; 982 int iNameEditorY = 1; 983 m_pNameEditor->setPos(iNameEditorX, iNameEditorY); 984 m_pNameEditorWidget->resize(geometry().width() - iNameEditorX - iHorizontalMargin, m_pNameEditorWidget->height()); 986 } 987 988 /* Enter-button: */ 989 if (m_pEnterButton) 990 { 991 /* Prepare variables: */ 992 int iFullWidth = geometry().width(); 993 QSizeF enterButtonSize = data(GroupItemData_EnterButtonSize).toSize(); 994 int iEnterButtonWidth = enterButtonSize.width(); 995 int iEnterButtonHeight = enterButtonSize.height(); 996 /* Layout enter-button: */ 997 int iEnterButtonX = iFullWidth - iHorizontalMargin - iEnterButtonWidth; 998 int iEnterButtonY = iEnterButtonHeight == iFullHeaderHeight ? iVerticalMargin : 999 iVerticalMargin + (iFullHeaderHeight - iEnterButtonHeight) / 2; 1000 m_pEnterButton->setPos(iEnterButtonX, iEnterButtonY); 1001 } 1002 1003 /* Name-editor: */ 1004 if (m_pNameEditor && m_pNameEditorWidget) 1005 { 1006 /* Prepare variables: */ 1007 int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt(); 1008 int iToggleButtonWidth = toggleButtonSize.width(); 1009 /* Layout name-editor: */ 1010 int iNameEditorX = iHorizontalMargin + iToggleButtonWidth + iMajorSpacing; 1011 int iNameEditorY = 1; 1012 m_pNameEditor->setPos(iNameEditorX, iNameEditorY); 1013 m_pNameEditorWidget->resize(geometry().width() - iNameEditorX - iHorizontalMargin, m_pNameEditorWidget->height()); 1014 } 985 1015 986 1016 /* Prepare body indent: */ … … 1010 1040 /* Show if hidden: */ 1011 1041 pItem->show(); 1012 /* Get item 'sheight-hint: */1042 /* Get item height-hint: */ 1013 1043 int iMinimumHeight = pItem->minimumHeightHint(); 1014 /* Set item 'sposition: */1044 /* Set item position: */ 1015 1045 pItem->setPos(iX + iHorizontalIndent, iY + iPreviousVerticalIndent); 1016 /* Set item 'ssize: */1046 /* Set item size: */ 1017 1047 pItem->resize(iWidth - 2 * iHorizontalIndent, iMinimumHeight); 1018 1048 /* Relayout group: */
Note:
See TracChangeset
for help on using the changeset viewer.