src/gui/styles/qmacstyle_mac.mm
branchRCL_3
changeset 7 3f74d0d4af4c
parent 5 d3bac044e0f0
equal deleted inserted replaced
6:dee5afe5301f 7:3f74d0d4af4c
  3378 
  3378 
  3379                         // Draw the text if it's needed.
  3379                         // Draw the text if it's needed.
  3380                         if (tb->toolButtonStyle != Qt::ToolButtonIconOnly) {
  3380                         if (tb->toolButtonStyle != Qt::ToolButtonIconOnly) {
  3381                             needText = true;
  3381                             needText = true;
  3382                             if (tb->toolButtonStyle == Qt::ToolButtonTextUnderIcon) {
  3382                             if (tb->toolButtonStyle == Qt::ToolButtonTextUnderIcon) {
  3383                                 pr.setHeight(pixmap.size().height());
  3383                                 QMainWindow *mw = qobject_cast<QMainWindow *>(w->window());
  3384                                 cr.adjust(0, pr.bottom() + 1, 0, 1);
  3384                                 if (mw && mw->unifiedTitleAndToolBarOnMac()) {
       
  3385                                     pr.setHeight(pixmap.size().height());
       
  3386                                     cr.adjust(0, pr.bottom() + 1, 0, 1);
       
  3387                                 } else {
       
  3388                                     pr.setHeight(pixmap.size().height() + 6);
       
  3389                                     cr.adjust(0, pr.bottom(), 0, -3);
       
  3390                                 }       
  3385                                 alignment |= Qt::AlignCenter;
  3391                                 alignment |= Qt::AlignCenter;
  3386                             } else {
  3392                             } else {
  3387                                 pr.setWidth(pixmap.width() + 8);
  3393                                 pr.setWidth(pixmap.width() + 8);
  3388                                 cr.adjust(pr.right(), 0, 0, 0);
  3394                                 cr.adjust(pr.right(), 0, 0, 0);
  3389                                 alignment |= Qt::AlignLeft | Qt::AlignVCenter;
  3395                                 alignment |= Qt::AlignLeft | Qt::AlignVCenter;
  3741                     rotateTabPainter(p, myTab.shape, myTab.rect);
  3747                     rotateTabPainter(p, myTab.shape, myTab.rect);
  3742 
  3748 
  3743                     QPalette np = tab->palette;
  3749                     QPalette np = tab->palette;
  3744                     np.setColor(QPalette::WindowText, QColor(255, 255, 255, 75));
  3750                     np.setColor(QPalette::WindowText, QColor(255, 255, 255, 75));
  3745                     QRect nr = subElementRect(SE_TabBarTabText, opt, w);
  3751                     QRect nr = subElementRect(SE_TabBarTabText, opt, w);
  3746                     nr.moveTop(+1);
  3752                     nr.moveTop(-1);
  3747                     int alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextHideMnemonic;
  3753                     int alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextHideMnemonic;
  3748                     proxy()->drawItemText(p, nr, alignment, np, tab->state & State_Enabled,
  3754                     proxy()->drawItemText(p, nr, alignment, np, tab->state & State_Enabled,
  3749                                                tab->text, QPalette::WindowText);
  3755                                                tab->text, QPalette::WindowText);
  3750                     p->restore();
  3756                     p->restore();
  3751                 }
  3757                 }