Changeset 79461 in vbox
- Timestamp:
- Jul 2, 2019 9:41:51 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 131718
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp
r76771 r79461 116 116 /* Configure pane: */ 117 117 m_pPaneDetails->setProperty("ToolType", QVariant::fromValue(UIToolType_Details)); 118 connect(this, &UIToolPaneMachine::sigSlidingStarted, m_pPaneDetails, &UIDetails::sigSlidingStarted);119 118 connect(this, &UIToolPaneMachine::sigToggleStarted, m_pPaneDetails, &UIDetails::sigToggleStarted); 120 119 connect(this, &UIToolPaneMachine::sigToggleFinished, m_pPaneDetails, &UIDetails::sigToggleFinished); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h
r76581 r79461 51 51 signals: 52 52 53 /** Redirects signal from UIVirtualBoxManager to UIDetails. */54 void sigSlidingStarted();55 53 /** Redirects signal from UIVirtualBoxManager to UIDetails. */ 56 54 void sigToggleStarted(); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r79391 r79461 491 491 connect(m_pPaneChooser, &UIChooser::sigSelectionInvalidated, 492 492 this, &UIVirtualBoxManagerWidget::sltHandleChooserPaneSelectionInvalidated); 493 connect(m_pPaneChooser, &UIChooser::sigSlidingStarted,494 m_pPaneToolsMachine, &UIToolPaneMachine::sigSlidingStarted);495 493 connect(m_pPaneChooser, &UIChooser::sigToggleStarted, 496 494 m_pPaneToolsMachine, &UIToolPaneMachine::sigToggleStarted); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h
r77933 r79461 49 49 /** Notifies listeners about selection invalidated. */ 50 50 void sigSelectionInvalidated(); 51 52 /** Notifies listeners about sliding started. */53 void sigSlidingStarted();54 51 55 52 /** Notifies listeners about toggling started. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp
r79265 r79461 50 50 , m_iHeaderDarkness(110) 51 51 , m_pToggleButton(0) 52 , m_pEnterButton(0)53 , m_pExitButton(0)54 52 , m_pNameEditorWidget(0) 55 53 , m_pContainerFavorite(0) … … 72 70 , m_iHeaderDarkness(110) 73 71 , m_pToggleButton(0) 74 , m_pEnterButton(0)75 , m_pExitButton(0)76 72 , m_pNameEditorWidget(0) 77 73 , m_pContainerFavorite(0) … … 166 162 void UIChooserItemGroup::retranslateUi() 167 163 { 168 /* Update button tool-tips: */169 if (m_pEnterButton)170 m_pEnterButton->setToolTip(tr("Enter group"));171 if (m_pExitButton)172 m_pExitButton->setToolTip(tr("Exit group"));173 164 updateToggleButtonToolTip(); 174 165 } … … 214 205 return; 215 206 216 /* Show enter-button: */217 if (!isRoot() && m_pEnterButton)218 m_pEnterButton->show();219 220 207 /* Call to base-class: */ 221 208 UIChooserItem::hoverMoveEvent(pEvent); … … 230 217 if (!isHovered()) 231 218 return; 232 233 /* Hide enter-button: */234 if (m_pEnterButton)235 m_pEnterButton->hide();236 219 237 220 /* Call to base-class: */ … … 571 554 /* Prepare variables: */ 572 555 const int iMarginHL = data(GroupItemData_MarginHL).toInt(); 573 const int iMarginHR = data(GroupItemData_MarginHR).toInt();574 556 const int iMarginV = data(GroupItemData_MarginV).toInt(); 575 557 const int iParentIndent = data(GroupItemData_ParentIndent).toInt(); … … 582 564 /* Acquire view: */ 583 565 const QGraphicsView *pView = model()->scene()->views().first(); 584 585 #if 0586 /* Header (non-main root-item): */587 if (!isMainRoot())588 {589 /* Hide unnecessary buttons: */590 if (m_pToggleButton)591 m_pToggleButton->hide();592 if (m_pEnterButton)593 m_pEnterButton->hide();594 595 /* Exit-button: */596 if (m_pExitButton)597 {598 /* Prepare variables: */599 int iExitButtonHeight = m_exitButtonSize.height();600 /* Layout exit-button: */601 int iExitButtonX = iHorizontalMargin;602 int iExitButtonY = iExitButtonHeight == iFullHeaderHeight ? iMarginV :603 iMarginV + (iFullHeaderHeight - iExitButtonHeight) / 2;604 m_pExitButton->setPos(iExitButtonX, iExitButtonY);605 /* Show exit-button: */606 m_pExitButton->show();607 }608 609 /* Prepare body indent: */610 iPreviousVerticalIndent = iMarginV + iFullHeaderHeight + iMarginV;611 }612 #endif613 566 614 567 /* Adjust scroll-view geometry: */ … … 626 579 else 627 580 { 628 /* Hide unnecessary button: */629 if (m_pExitButton)630 m_pExitButton->hide();631 632 581 /* Toggle-button: */ 633 582 if (m_pToggleButton) … … 642 591 /* Show toggle-button: */ 643 592 m_pToggleButton->show(); 644 }645 646 /* Enter-button: */647 if (m_pEnterButton)648 {649 /* Prepare variables: */650 int iFullWidth = (int)geometry().width();651 int iEnterButtonWidth = m_enterButtonSize.width();652 int iEnterButtonHeight = m_enterButtonSize.height();653 /* Layout enter-button: */654 int iEnterButtonX = iFullWidth - iMarginHR - iEnterButtonWidth;655 int iEnterButtonY = iEnterButtonHeight == iFullHeaderHeight ? iMarginV :656 iMarginV + (iFullHeaderHeight - iEnterButtonHeight) / 2;657 m_pEnterButton->setPos(iEnterButtonX, iEnterButtonY);658 593 } 659 594 … … 1026 961 m_minimumHeaderSize = QSize(0, 0); 1027 962 1028 /* Prepare header widgets of root item: */1029 if (isRoot())1030 {1031 #if 01032 /* Except main root ofc: */1033 if (!isMainRoot())1034 {1035 /* Setup exit-button: */1036 m_pExitButton = new UIGraphicsButton(this, UIIconPool::iconSet(":/previous_16px.png"));1037 if (m_pExitButton)1038 {1039 m_pExitButton->hide();1040 QSizeF sh = m_pExitButton->minimumSizeHint();1041 m_pExitButton->setTransformOriginPoint(sh.width() / 2, sh.height() / 2);1042 connect(m_pExitButton, &UIGraphicsButton::sigButtonClicked,1043 this, &UIChooserItemGroup::sltUnindentRoot);1044 }1045 m_exitButtonSize = m_pExitButton ? m_pExitButton->minimumSizeHint().toSize() : QSize(0, 0);1046 }1047 #endif1048 }1049 963 /* Prepare header widgets of non-root item: */ 1050 else964 if (!isRoot()) 1051 965 { 1052 966 /* Setup toggle-button: */ … … 1061 975 } 1062 976 m_toggleButtonSize = m_pToggleButton ? m_pToggleButton->minimumSizeHint().toSize() : QSize(0, 0); 1063 1064 /* Setup enter-button: */1065 m_pEnterButton = new UIGraphicsButton(this, UIIconPool::iconSet(":/next_16px.png"));1066 if (m_pEnterButton)1067 {1068 m_pEnterButton->hide();1069 connect(m_pEnterButton, &UIGraphicsButton::sigButtonClicked,1070 this, &UIChooserItemGroup::sltIndentRoot);1071 }1072 m_enterButtonSize = m_pEnterButton ? m_pEnterButton->minimumSizeHint().toSize() : QSize(0, 0);1073 977 1074 978 /* Setup name-editor: */ … … 1462 1366 int iHeaderSpacing = data(GroupItemData_HeaderSpacing).toInt(); 1463 1367 int iToggleButtonWidth = m_toggleButtonSize.width(); 1464 int iEnterButtonWidth = m_enterButtonSize.width();1465 int iExitButtonWidth = m_exitButtonSize.width();1466 1368 int iGroupPixmapWidth = m_pixmapSizeGroups.width(); 1467 1369 int iMachinePixmapWidth = m_pixmapSizeMachines.width(); … … 1473 1375 iMaximumWidth -= iMarginHL; 1474 1376 /* Button width: */ 1475 if (isRoot()) 1476 iMaximumWidth -= iExitButtonWidth; 1477 else 1377 if (!isRoot()) 1478 1378 iMaximumWidth -= iToggleButtonWidth; 1479 1379 /* Spacing between button and name: */ … … 1489 1389 if (!m_machineItems.isEmpty()) 1490 1390 iMaximumWidth -= (iMachinePixmapWidth + iMachineCountTextWidth); 1491 /* Spacing + button width: */1492 if (!isRoot())1493 iMaximumWidth -= iEnterButtonWidth;1494 1391 } 1495 1392 /* Right margin: */ … … 1544 1441 int iHeaderWidth = 0; 1545 1442 /* Button width: */ 1546 if (isRoot()) 1547 iHeaderWidth += m_exitButtonSize.width(); 1548 else 1443 if (!isRoot()) 1549 1444 iHeaderWidth += m_toggleButtonSize.width(); 1550 1445 iHeaderWidth += /* Spacing between button and name: */ … … 1560 1455 if (!m_machineItems.isEmpty()) 1561 1456 iHeaderWidth += (m_pixmapSizeMachines.width() + m_infoSizeMachines.width()); 1562 /* Spacing + button width: */1563 if (!isRoot())1564 iHeaderWidth += m_enterButtonSize.width();1565 1457 1566 1458 /* Calculate maximum height: */ 1567 1459 QList<int> heights; 1568 1460 /* Button height: */ 1569 if (isRoot()) 1570 heights << m_exitButtonSize.height(); 1571 else 1461 if (!isRoot()) 1572 1462 heights << m_toggleButtonSize.height(); 1573 1463 heights /* Minimum name height: */ … … 1578 1468 << m_pixmapSizeMachines.height() << m_infoSizeMachines.height(); 1579 1469 /* Button height: */ 1580 if (!isRoot())1581 heights << m_enterButtonSize.height();1582 1470 int iHeaderHeight = 0; 1583 1471 foreach (int iHeight, heights) … … 1752 1640 /* Paint name: */ 1753 1641 int iNameX = iMarginHL; 1754 if (isRoot()) 1755 iNameX += m_exitButtonSize.width(); 1756 else 1642 if (!isRoot()) 1757 1643 iNameX += m_toggleButtonSize.width(); 1758 1644 iNameX += iHeaderSpacing; … … 1773 1659 if (isHovered()) 1774 1660 { 1775 /* Prepare variables: */1776 int iEnterButtonWidth = m_enterButtonSize.width();1777 1778 1661 /* Indent: */ 1779 1662 int iHorizontalIndent = rect.right() - iMarginHR; 1780 if (!isRoot())1781 iHorizontalIndent -= iEnterButtonWidth;1782 1663 1783 1664 /* Should we draw machine count info? */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h
r77923 r79461 335 335 /** Holds the group toggle button instance. */ 336 336 UIGraphicsRotatorButton *m_pToggleButton; 337 /** Holds the group enter button instance. */338 UIGraphicsButton *m_pEnterButton;339 /** Holds the group exit button instance. */340 UIGraphicsButton *m_pExitButton;341 337 342 338 /** Holds the group name editor instance. */ … … 392 388 /** Holds cached toggle button size. */ 393 389 QSize m_toggleButtonSize; 394 /** Holds cached enter button size. */395 QSize m_enterButtonSize;396 /** Holds cached exit button size. */397 QSize m_exitButtonSize;398 390 /** @} */ 399 391 }; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.cpp
r76606 r79461 81 81 connect(m_pDetailsModel, &UIDetailsModel::sigLinkClicked, 82 82 this, &UIDetails::sigLinkClicked); 83 connect(this, &UIDetails::sigSlidingStarted,84 m_pDetailsModel, &UIDetailsModel::sltHandleSlidingStarted);85 83 connect(this, &UIDetails::sigToggleStarted, 86 84 m_pDetailsModel, &UIDetailsModel::sltHandleToggleStarted); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.h
r76581 r79461 46 46 const QUuid &uId); 47 47 48 /** Notifies listeners about sliding started. */49 void sigSlidingStarted();50 51 48 /** Notifies listeners about toggling started. */ 52 49 void sigToggleStarted(); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsModel.cpp
r79365 r79461 185 185 } 186 186 187 void UIDetailsModel::sltHandleSlidingStarted()188 {189 m_pRoot->stopBuildingGroup();190 }191 192 187 void UIDetailsModel::sltHandleToggleStarted() 193 188 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsModel.h
r76581 r79461 159 159 void sltHandleViewResize(); 160 160 161 /** Handles chooser pane signal about item sliding started. */162 void sltHandleSlidingStarted();163 161 /** Handles chooser pane signal about group toggle started. */ 164 162 void sltHandleToggleStarted();
Note:
See TracChangeset
for help on using the changeset viewer.