Changeset 78669 in vbox for trunk/src/VBox
- Timestamp:
- May 22, 2019 5:00:37 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp
r78663 r78669 125 125 UIKeyType type() const; 126 126 127 void setScaleMultiplier(float fMultiplier); 128 127 129 UIKeyState state() const; 128 130 QVector<LONG> scanCodeWithPrefix() const; 129 void updateFontSize( float multiplier);131 void updateFontSize(); 130 132 131 133 void release(); … … 150 152 UIKeyState m_enmState; 151 153 QPalette m_defaultPalette; 154 float m_fScaleMultiplier; 152 155 }; 153 156 … … 300 303 , m_enmType(UIKeyType_SingleState) 301 304 , m_enmState(UIKeyState_NotPressed) 305 , m_fScaleMultiplier(1.f) 302 306 { 303 307 m_iDefaultPointSize = font().pointSize(); … … 356 360 } 357 361 362 void UISoftKeyboardKey::setScaleMultiplier(float fMultiplier) 363 { 364 m_fScaleMultiplier = fMultiplier; 365 } 366 358 367 UIKeyState UISoftKeyboardKey::state() const 359 368 { … … 361 370 } 362 371 363 void UISoftKeyboardKey::updateFontSize( float multiplier)372 void UISoftKeyboardKey::updateFontSize() 364 373 { 365 374 if (m_iDefaultPointSize != -1) 366 375 { 367 376 QFont newFont = font(); 368 newFont.setPointSize(m ultiplier * m_iDefaultPointSize);377 newFont.setPointSize(m_fScaleMultiplier * m_iDefaultPointSize); 369 378 setFont(newFont); 370 379 } … … 372 381 { 373 382 QFont newFont = font(); 374 newFont.setPixelSize(m ultiplier * m_iDefaultPixelSize);383 newFont.setPixelSize(m_fScaleMultiplier * m_iDefaultPixelSize); 375 384 setFont(newFont); 376 385 } … … 409 418 int unitSize = qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing); 410 419 411 float fRadius = 1.1 * unitSize;412 float fSpace = unitSize;420 float fRadius = m_fScaleMultiplier * 1.1 * unitSize; 421 float fSpace = m_fScaleMultiplier * unitSize; 413 422 QRectF rectangle(fSpace, fSpace, fRadius, fRadius); 414 423 … … 418 427 void UISoftKeyboardKey::updateState(bool fPressed) 419 428 { 429 if (m_enmType == UIKeyType_SingleState) 430 return; 420 431 if (m_enmType == UIKeyType_TriState) 421 432 { … … 496 507 continue; 497 508 pKey->setVisible(true); 498 pKey->updateFontSize(fMultiplier); 509 pKey->setScaleMultiplier(fMultiplier); 510 pKey->updateFontSize(); 499 511 int iKeyWidth = fMultiplier * pKey->width(); 500 512 if (i != m_keys.size() - 1) … … 592 604 { 593 605 UISoftKeyboardKey *pModifier = m_pressedModifiers[i]; 606 if (pModifier->type() == UIKeyType_DualState) 607 continue; 594 608 if (pModifier->scanCodePrefix() != 0) 595 609 sequence << pModifier->scanCodePrefix();
Note:
See TracChangeset
for help on using the changeset viewer.