Showing the changes to interface/src/ui/BandwidthMeter.cpp (1 of 7 files). Show all
Unified · Split
| @@ -50,7 +50,7 @@ BandwidthMeter::ChannelInfo BandwidthMeter::_CHANNELS[] = { · 49 unmodified lines | |||
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | BandwidthMeter::BandwidthMeter() : | 52 | BandwidthMeter::BandwidthMeter() : |
| 53 | _textRenderer(INCONSOLATA_FONT_FAMILY, -1, QFont::Bold, false), | 53 | _textRenderer(TextRenderer::getInstance(INCONSOLATA_FONT_FAMILY, -1, QFont::Bold, false)), |
| 54 | _scaleMaxIndex(INITIAL_SCALE_MAXIMUM_INDEX) { | 54 | _scaleMaxIndex(INITIAL_SCALE_MAXIMUM_INDEX) { |
| 55 | 55 | ||
| 56 | _channels = static_cast<ChannelInfo*>( malloc(sizeof(_CHANNELS)) ); | 56 | _channels = static_cast<ChannelInfo*>( malloc(sizeof(_CHANNELS)) ); |
| @@ -140,7 +140,7 @@ void BandwidthMeter::render(int screenWidth, int screenHeight) { · 83 unmodified lines | |||
| 140 | float totalMax = glm::max(totalIn, totalOut); | 140 | float totalMax = glm::max(totalIn, totalOut); |
| 141 | 141 | ||
| 142 | // Get font / caption metrics | 142 | // Get font / caption metrics |
| 143 | QFontMetrics const& fontMetrics = _textRenderer.metrics(); | 143 | QFontMetrics const& fontMetrics = _textRenderer->metrics(); |
| 144 | int fontDescent = fontMetrics.descent(); | 144 | int fontDescent = fontMetrics.descent(); |
| 145 | int labelWidthIn = fontMetrics.width(CAPTION_IN); | 145 | int labelWidthIn = fontMetrics.width(CAPTION_IN); |
| 146 | int labelWidthOut = fontMetrics.width(CAPTION_OUT); | 146 | int labelWidthOut = fontMetrics.width(CAPTION_OUT); |
| @@ -163,9 +163,9 @@ void BandwidthMeter::render(int screenWidth, int screenHeight) { · 16 unmodified lines | |||
| 163 | 163 | ||
| 164 | // Render captions | 164 | // Render captions |
| 165 | setColorRGBA(COLOR_TEXT); | 165 | setColorRGBA(COLOR_TEXT); |
| 166 | _textRenderer.draw(barWidth + SPACING_LEFT_CAPTION_UNIT, textYcenteredLine, CAPTION_UNIT); | 166 | _textRenderer->draw(barWidth + SPACING_LEFT_CAPTION_UNIT, textYcenteredLine, CAPTION_UNIT); |
| 167 | _textRenderer.draw(-labelWidthIn - SPACING_RIGHT_CAPTION_IN_OUT, textYupperLine, CAPTION_IN); | 167 | _textRenderer->draw(-labelWidthIn - SPACING_RIGHT_CAPTION_IN_OUT, textYupperLine, CAPTION_IN); |
| 168 | _textRenderer.draw(-labelWidthOut - SPACING_RIGHT_CAPTION_IN_OUT, textYlowerLine, CAPTION_OUT); | 168 | _textRenderer->draw(-labelWidthOut - SPACING_RIGHT_CAPTION_IN_OUT, textYlowerLine, CAPTION_OUT); |
| 169 | 169 | ||
| 170 | // Render vertical lines for the frame | 170 | // Render vertical lines for the frame |
| 171 | setColorRGBA(COLOR_FRAME); | 171 | setColorRGBA(COLOR_FRAME); |
| @@ -229,11 +229,11 @@ void BandwidthMeter::render(int screenWidth, int screenHeight) { · 57 unmodified lines | |||
| 229 | char fmtBuf[8]; | 229 | char fmtBuf[8]; |
| 230 | setColorRGBA(COLOR_TEXT); | 230 | setColorRGBA(COLOR_TEXT); |
| 231 | sprintf(fmtBuf, "%0.1f", totalIn); | 231 | sprintf(fmtBuf, "%0.1f", totalIn); |
| 232 | _textRenderer.draw(glm::max(xIn - fontMetrics.width(fmtBuf) - PADDING_HORIZ_VALUE, | 232 | _textRenderer->draw(glm::max(xIn - fontMetrics.width(fmtBuf) - PADDING_HORIZ_VALUE, |
| 233 | PADDING_HORIZ_VALUE), | 233 | PADDING_HORIZ_VALUE), |
| 234 | textYupperLine, fmtBuf); | 234 | textYupperLine, fmtBuf); |
| 235 | sprintf(fmtBuf, "%0.1f", totalOut); | 235 | sprintf(fmtBuf, "%0.1f", totalOut); |
| 236 | _textRenderer.draw(glm::max(xOut - fontMetrics.width(fmtBuf) - PADDING_HORIZ_VALUE, | 236 | _textRenderer->draw(glm::max(xOut - fontMetrics.width(fmtBuf) - PADDING_HORIZ_VALUE, |
| 237 | PADDING_HORIZ_VALUE), | 237 | PADDING_HORIZ_VALUE), |
| 238 | textYlowerLine, fmtBuf); | 238 | textYlowerLine, fmtBuf); |
| 239 | 239 | ||