Changeset 94358 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 24, 2022 3:24:02 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp
r94341 r94358 1030 1030 { 1031 1031 /* Prepare editor: */ 1032 UIGraphicsControllerEditor *pEditor = new UIGraphicsControllerEditor(pPopup , true /* with label */);1032 UIGraphicsControllerEditor *pEditor = new UIGraphicsControllerEditor(pPopup); 1033 1033 if (pEditor) 1034 1034 { -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIGraphicsControllerEditor.cpp
r94056 r94358 31 31 32 32 33 UIGraphicsControllerEditor::UIGraphicsControllerEditor(QWidget *pParent /* = 0 */ , bool fWithLabel /* = false */)33 UIGraphicsControllerEditor::UIGraphicsControllerEditor(QWidget *pParent /* = 0 */) 34 34 : QIWithRetranslateUI<QWidget>(pParent) 35 , m_fWithLabel(fWithLabel)36 35 , m_enmValue(KGraphicsControllerType_Max) 36 , m_pLayout(0) 37 37 , m_pLabel(0) 38 38 , m_pCombo(0) … … 65 65 } 66 66 67 int UIGraphicsControllerEditor::minimumLabelHorizontalHint() const 68 { 69 return m_pLabel->minimumSizeHint().width(); 70 } 71 72 void UIGraphicsControllerEditor::setMinimumLayoutIndent(int iIndent) 73 { 74 if (m_pLayout) 75 m_pLayout->setColumnMinimumWidth(0, iIndent); 76 } 77 67 78 void UIGraphicsControllerEditor::retranslateUi() 68 79 { … … 89 100 { 90 101 /* Create main layout: */ 91 QGridLayout *pMainLayout = new QGridLayout(this);92 if ( pMainLayout)102 m_pLayout = new QGridLayout(this); 103 if (m_pLayout) 93 104 { 94 pMainLayout->setContentsMargins(0, 0, 0, 0); 95 int iRow = 0; 105 m_pLayout->setContentsMargins(0, 0, 0, 0); 96 106 97 107 /* Create label: */ 98 if (m_fWithLabel) 99 m_pLabel = new QLabel(this); 108 m_pLabel = new QLabel(this); 100 109 if (m_pLabel) 101 pMainLayout->addWidget(m_pLabel, 0, iRow++, 1, 1); 110 { 111 m_pLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 112 m_pLayout->addWidget(m_pLabel, 0, 0); 113 } 102 114 103 115 /* Create combo layout: */ 104 QHBoxLayout *p ComboLayout= new QHBoxLayout;105 if (p ComboLayout)116 QHBoxLayout *pLayoutCombo = new QHBoxLayout; 117 if (pLayoutCombo) 106 118 { 107 119 /* Create combo: */ … … 110 122 { 111 123 /* This is necessary since contents is dynamical now: */ 112 m_pCombo->setSizeAdjustPolicy(QComboBox::AdjustToContents);113 124 if (m_pLabel) 114 125 m_pLabel->setBuddy(m_pCombo); 126 m_pCombo->setSizeAdjustPolicy(QComboBox::AdjustToContents); 115 127 connect(m_pCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 116 128 this, &UIGraphicsControllerEditor::sltHandleCurrentIndexChanged); 117 pComboLayout->addWidget(m_pCombo); 129 130 pLayoutCombo->addWidget(m_pCombo); 118 131 } 119 132 120 133 /* Add stretch: */ 121 p ComboLayout->addStretch();134 pLayoutCombo->addStretch(); 122 135 123 136 /* Add combo-layout into main-layout: */ 124 pMainLayout->addLayout(pComboLayout, 0, iRow++, 1, 1);137 m_pLayout->addLayout(pLayoutCombo, 0, 1); 125 138 } 126 139 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIGraphicsControllerEditor.h
r94056 r94358 34 34 /* Forward declarations: */ 35 35 class QComboBox; 36 class QGridLayout; 36 37 class QLabel; 37 38 … … 48 49 public: 49 50 50 /** Constructs graphics controller editor passing @a pParent to the base-class. 51 * @param fWithLabel Brings whether we should add label ourselves. */ 52 UIGraphicsControllerEditor(QWidget *pParent = 0, bool fWithLabel = false); 51 /** Constructs graphics controller editor passing @a pParent to the base-class. */ 52 UIGraphicsControllerEditor(QWidget *pParent = 0); 53 53 54 54 /** Defines editor @a enmValue. */ … … 59 59 /** Returns the vector of supported values. */ 60 60 QVector<KGraphicsControllerType> supportedValues() const { return m_supportedValues; } 61 62 /** Returns minimum layout hint. */ 63 int minimumLabelHorizontalHint() const; 64 /** Defines minimum layout @a iIndent. */ 65 void setMinimumLayoutIndent(int iIndent); 61 66 62 67 protected: … … 77 82 void populateCombo(); 78 83 79 /** Holds whether descriptive label should be created. */80 bool m_fWithLabel;81 82 84 /** Holds the value to be selected. */ 83 85 KGraphicsControllerType m_enmValue; … … 86 88 QVector<KGraphicsControllerType> m_supportedValues; 87 89 90 /** Holds the main layout instance. */ 91 QGridLayout *m_pLayout; 88 92 /** Holds the label instance. */ 89 QLabel *m_pLabel;93 QLabel *m_pLabel; 90 94 /** Holds the combo instance. */ 91 QComboBox *m_pCombo;95 QComboBox *m_pCombo; 92 96 }; 93 97 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r94357 r94358 311 311 , m_pLabelMonitorCountMax(0) 312 312 , m_pEditorScaleFactor(0) 313 , m_pLabelGraphicsController(0)314 313 , m_pEditorGraphicsController(0) 315 314 , m_pLabelAcceleration(0) … … 778 777 m_pSpinboxMonitorCount->setToolTip(tr("Controls the amount of virtual monitors provided to the virtual machine.")); 779 778 m_pEditorScaleFactor->setToolTip(tr("Controls the guest screen scale factor.")); 780 m_pLabelGraphicsController->setText(tr("&Graphics Controller:"));781 779 m_pLabelAcceleration->setText(tr("Acceleration:")); 782 780 m_pCheckbox3D->setToolTip(tr("When checked, the virtual machine will be given access " … … 863 861 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pLabelMonitorCount->minimumSizeHint().width()); 864 862 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorScaleFactor->minimumLabelHorizontalHint()); 865 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_p LabelGraphicsController->minimumSizeHint().width());863 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorGraphicsController->minimumLabelHorizontalHint()); 866 864 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pLabelAcceleration->minimumSizeHint().width()); 867 865 m_pEditorVideoMemorySize->setMinimumLayoutIndent(iMinimumLayoutHint); 868 866 m_pEditorScaleFactor->setMinimumLayoutIndent(iMinimumLayoutHint); 867 m_pEditorGraphicsController->setMinimumLayoutIndent(iMinimumLayoutHint); 869 868 m_pLayoutScreen->setColumnMinimumWidth(0, iMinimumLayoutHint); 870 869 … … 885 884 m_pSpinboxMonitorCount->setEnabled(isMachineOffline()); 886 885 m_pEditorScaleFactor->setEnabled(isMachineInValidMode()); 887 m_pLabelGraphicsController->setEnabled(isMachineOffline());888 886 m_pEditorGraphicsController->setEnabled(isMachineOffline()); 889 887 m_pLabelAcceleration->setEnabled(isMachineOffline()); … … 1181 1179 m_pLayoutScreen->addWidget(m_pEditorScaleFactor, 3, 0, 1, 3); 1182 1180 1183 /* Prepare graphics controller label: */1184 m_pLabelGraphicsController = new QLabel(m_pTabScreen);1185 if (m_pLabelGraphicsController)1186 {1187 m_pLabelGraphicsController->setAlignment(Qt::AlignRight | Qt::AlignVCenter);1188 m_pLayoutScreen->addWidget(m_pLabelGraphicsController, 4, 0);1189 }1190 1181 /* Prepare graphics controller editor: */ 1191 1182 m_pEditorGraphicsController = new UIGraphicsControllerEditor(m_pTabScreen); 1192 1183 if (m_pEditorGraphicsController) 1193 { 1194 if (m_pLabelGraphicsController) 1195 m_pLabelGraphicsController->setBuddy(m_pEditorGraphicsController); 1196 m_pLayoutScreen->addWidget(m_pEditorGraphicsController, 4, 1, 1, 2); 1197 } 1184 m_pLayoutScreen->addWidget(m_pEditorGraphicsController, 4, 0, 1, 3); 1198 1185 1199 1186 /* Prepare acceleration label: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h
r94357 r94358 215 215 /** Holds the scale factor editor instance. */ 216 216 UIScaleFactorEditor *m_pEditorScaleFactor; 217 /** Holds the graphics controller label instance. */218 QLabel *m_pLabelGraphicsController;219 217 /** Holds the graphics controller editor instance. */ 220 218 UIGraphicsControllerEditor *m_pEditorGraphicsController;
Note:
See TracChangeset
for help on using the changeset viewer.