- Timestamp:
- Feb 5, 2008 4:22:40 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 27920
- Location:
- trunk/src/VBox/Frontends/VirtualBox/ui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/Frontends/VirtualBox/ui/VBoxSharedFoldersSettings.ui ¶
r6724 r6811 231 231 <include location="global" impldecl="in implementation">qlineedit.h</include> 232 232 <include location="global" impldecl="in implementation">qregexp.h</include> 233 <include location="global" impldecl="in implementation">qtimer.h</include> 233 234 </includes> 234 235 <variables> … … 247 248 <slot>processCurrentChanged( QListViewItem* )</slot> 248 249 <slot>processDoubleClick( QListViewItem* )</slot> 250 <slot>adjustList()</slot> 249 251 </slots> 250 252 <functions> 251 253 <function access="private">init()</function> 254 <function access="private">showEvent( QShowEvent* )</function> 252 255 <function returnType="bool" access="private">eventFilter( QObject*, QEvent* )</function> 253 256 <function>setDialogType( int )</function> -
TabularUnified trunk/src/VBox/Frontends/VirtualBox/ui/VBoxSharedFoldersSettings.ui.h ¶
r6763 r6811 85 85 } 86 86 87 QString getText (int aIndex) 87 QString getText (int aIndex) const 88 88 { 89 89 return aIndex >= 0 && aIndex < (int)mTextList.size() ? … … 104 104 processColumn (aColumn, aWidth); 105 105 QListViewItem::paintCell (aPainter, aColorGroup, aColumn, aWidth, aAlign); 106 } 107 108 int width (const QFontMetrics &aFontMetrics, const QListView *, int aColumn) const 109 { 110 return aFontMetrics.boundingRect (getText (aColumn)).width() + 111 aFontMetrics.width ("...x") /* indent size */ ; 106 112 } 107 113 … … 223 229 inputLayout->addMultiCellWidget (mLeName, 1, 1, 1, 2); 224 230 225 QHBoxLayout *cbLayout = new QHBoxLayout (0, "cbLayout");226 inputLayout->addMultiCellLayout (cbLayout, 2, 2, 0, 2);227 231 mCbReadonly = new QCheckBox (tr ("&Read-only"), this); 228 232 QWhatsThis::add (mCbReadonly, 229 233 tr ("When checked, the guest OS will not be able to write to the " 230 234 "specified shared folder.")); 231 232 235 mCbReadonly->setChecked (false); 233 cbLayout->addWidget (mCbReadonly); 236 inputLayout->addMultiCellWidget (mCbReadonly, 2, 2, 0, 2); 237 234 238 if (aEnableSelector) 235 239 { 236 mCbPermanent = new QCheckBox ( 240 mCbPermanent = new QCheckBox (tr ("&Make Permanent"), this); 237 241 mCbPermanent->setChecked (true); 238 cbLayout->addWidget (mCbPermanent);242 inputLayout->addMultiCellWidget (mCbPermanent, 3, 3, 0, 2); 239 243 connect (mCbPermanent, SIGNAL (toggled (bool)), 240 244 this, SLOT (validate())); … … 375 379 } 376 380 381 void VBoxSharedFoldersSettings::showEvent (QShowEvent *aEvent) 382 { 383 QWidget::showEvent (aEvent); 384 385 /* Adjusting size after all pending show events are processed. */ 386 QTimer::singleShot (0, this, SLOT (adjustList())); 387 } 388 389 390 void VBoxSharedFoldersSettings::adjustList() 391 { 392 /* Adjust two columns size. 393 * Watching columns 0&2 to feat 1/3 of total width. */ 394 int total = listView->columnWidth (0) + 395 listView->columnWidth (1) + 396 listView->columnWidth (2); 397 398 listView->adjustColumn (0); 399 int w0 = listView->columnWidth (0) < total / 3 ? 400 listView->columnWidth (0) : total / 3; 401 402 listView->adjustColumn (2); 403 int w2 = listView->columnWidth (2) < total / 3 ? 404 listView->columnWidth (2) : total / 3; 405 406 /* We are adjusting columns 0 and 2 and resizing column 1 to feat 407 * visible listView' width according two adjusted columns. Due to 408 * adjusting column 2 influent column 0 restoring all widths. */ 409 listView->setColumnWidth (0, w0); 410 listView->setColumnWidth (1, total - w0 - w2); 411 listView->setColumnWidth (2, w2); 412 } 413 377 414 bool VBoxSharedFoldersSettings::eventFilter (QObject *aObject, QEvent *aEvent) 378 415 {
Note:
See TracChangeset
for help on using the changeset viewer.