Changeset 102087 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Nov 13, 2023 4:17:15 PM (16 months ago)
- svn:sync-xref-src-repo-rev:
- 160198
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialog.cpp
r101723 r102087 597 597 , m_fSerializationClean(false) 598 598 , m_fClosed(false) 599 , m_iPageId(0) 599 600 , m_pStatusBar(0) 600 601 , m_pProcessBar(0) … … 641 642 #endif 642 643 643 /* Let's calculate scroll-bar shift: */ 644 int iShift = 0; 644 /* Cache current page ID for reusing: */ 645 m_iPageId = cId; 646 647 /* Let's calculate required scroll-bar position: */ 648 int iPosition = 0; 645 649 /* We'll have to take upper content's margin into account: */ 646 650 int iL, iT, iR, iB; 647 651 m_pScrollViewport->layout()->getContentsMargins(&iL, &iT, &iR, &iB); 648 i Shift-= iT;652 iPosition -= iT; 649 653 /* And actual page position according to parent: */ 650 const QPoint pnt = m_frames.value( cId)->pos();651 i Shift+= pnt.y();654 const QPoint pnt = m_frames.value(m_iPageId)->pos(); 655 iPosition += pnt.y(); 652 656 /* Make sure corresponding page is visible: */ 653 m_pScrollArea->requestVerticalScrollBarPosition(i Shift);657 m_pScrollArea->requestVerticalScrollBarPosition(iPosition); 654 658 655 659 #ifndef VBOX_WS_MAC … … 1110 1114 m_pEditorFilter->text(), 1111 1115 m_flags); 1116 1117 /* Make sure current page chosen again: */ 1118 /// @todo fix this WORKAROUND properly! 1119 // Why the heck simple call to 1120 // QCoreApplication::sendPostedEvents(0, QEvent::LayoutRequest); 1121 // isn't enough and we still need some time to let system 1122 // process the layouts and vertical scroll-bar position? 1123 QTimer::singleShot(50, this, SLOT(sltCategoryChangedRepeat())); 1112 1124 } 1113 1125 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialog.h
r101723 r102087 100 100 /** Handles category change to @a cId. */ 101 101 virtual void sltCategoryChanged(int cId); 102 /** Repeats handling for category change to cached @a m_iPageId. */ 103 virtual void sltCategoryChangedRepeat() { sltCategoryChanged(m_iPageId); } 102 104 103 105 /** Handles serializartion start. */ … … 241 243 bool m_fClosed; 242 244 245 /** Holds the current page ID. */ 246 int m_iPageId; 247 243 248 /** Holds the dialog optional flags. */ 244 249 QMap<QString, QVariant> m_flags;
Note:
See TracChangeset
for help on using the changeset viewer.