Author: mir3x Date: Tue Nov 22 20:51:33 2016 New Revision: 34616 URL: http://svn.gna.org/viewcvs/freeciv?rev=34616&view=rev Log: Qt client - draw dark background for new turn info text
See patch #8016 Modified: trunk/client/gui-qt/hudwidget.cpp Modified: trunk/client/gui-qt/hudwidget.cpp URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/hudwidget.cpp?rev=34616&r1=34615&r2=34616&view=diff ============================================================================== --- trunk/client/gui-qt/hudwidget.cpp (original) +++ trunk/client/gui-qt/hudwidget.cpp Tue Nov 22 20:51:33 2016 @@ -235,8 +235,7 @@ text = s; timeout = time_secs; - setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Dialog - | Qt::FramelessWindowHint); + setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint); f_text = *fc_font::instance()->get_font(fonts::default_font); f_text.setBold(true); f_text.setCapitalization(QFont::SmallCaps); @@ -253,6 +252,7 @@ startTimer(46); setAttribute(Qt::WA_TranslucentBackground); setAttribute(Qt::WA_ShowWithoutActivating); + setAttribute(Qt::WA_TransparentForMouseEvents); setFocusPolicy(Qt::NoFocus); } @@ -277,8 +277,7 @@ setFixedSize(bound_rect.width(), bound_rect.height()); } p = QPoint((parentWidget()->width() - w) / 2, - parentWidget()->height() / 10); - p = parentWidget()->mapToGlobal(p); + parentWidget()->height() / 20); move(p); } @@ -324,8 +323,12 @@ opacity = qMax(0.0f, opacity); rfull = QRect(0 , 0, width(), height()); c1 = QColor(Qt::white); + c2 = QColor(35, 35, 35, 175); c1.setAlphaF(c1.alphaF() * opacity); + c2.setAlphaF(c2.alphaF() * opacity); p.begin(this); + p.setBrush(c2); + p.drawRoundedRect(rfull, height() / 6 , height() / 6); p.setFont(f_text); p.setPen(c1); p.drawText(rfull, Qt::AlignCenter, text, &bound_rect); _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits