Changeset 70679 in vbox
- Timestamp:
- Jan 22, 2018 3:41:42 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.cpp
r70673 r70679 277 277 /* For 100% scale PM_LargeIconSize is 32px, and since we want ~300x~100 pixmap we take it 9x3: */ 278 278 const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize); 279 QImage image(9 * iIconMetric, 3 * iIconMetric, QImage::Format_ARGB32_Premultiplied); 279 int imageW = 8 * iIconMetric; 280 int imageH = 8 * iIconMetric; 281 QImage image(imageW, imageH, QImage::Format_ARGB32_Premultiplied); 280 282 QColor fillColor(QPalette::Light); 281 283 fillColor.setAlpha(0); 282 284 image.fill(fillColor); 283 285 QPainter painter(&image); 286 painter.translate(0.5 * imageW, 0.5 * imageH); 287 painter.rotate(-45); 284 288 285 289 /* Configure the font size and color: */ … … 289 293 painter.setPen(fontColor); 290 294 pfont.setBold(true); 291 pfont.setPixelSize(4 6);295 pfont.setPixelSize(48); 292 296 painter.setFont(pfont); 293 294 painter.drawText( image.rect(), Qt::AlignCenter | Qt::AlignVCenter, m_strBackgroungText);297 QRect textRect(- 0.5 * imageW, - 0.5 * imageH, imageW, imageH); 298 painter.drawText(textRect, Qt::AlignCenter | Qt::AlignVCenter, m_strBackgroungText); 295 299 296 300 mPalette.setBrush(QPalette::Base, QBrush(image));
Note:
See TracChangeset
for help on using the changeset viewer.