position/sizes tweaks / moving stats and osciloscope when mirror is ON

This commit is contained in:
Lucas Crisman 2014-01-24 07:56:01 -03:00
parent c3aa8167d6
commit 43d1678d18
2 changed files with 18 additions and 6 deletions

View file

@ -3072,10 +3072,11 @@ void Application::displayOverlay() {
}
if (Menu::getInstance()->isOptionChecked(MenuOption::Stats)) {
displayStatsBackground(0x33333399, 0, _glWidget->height() - 70, 300, 70);
displayStatsBackground(0x33333399, 0, _glWidget->height() - 68, 296, 68);
_audio.render(_glWidget->width(), _glWidget->height());
if (Menu::getInstance()->isOptionChecked(MenuOption::Oscilloscope)) {
_audioScope.render(25, 25);
int oscilloscopeTop = Menu::getInstance()->isOptionChecked(MenuOption::Mirror) ? 130 : 25;
_audioScope.render(25, oscilloscopeTop);
}
}
@ -3130,7 +3131,7 @@ void Application::displayOverlay() {
displayStats();
// Bandwidth meter
if (Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth)) {
displayStatsBackground(0x33333399, _glWidget->width() - 300, _glWidget->height() - 70, 300, 70);
displayStatsBackground(0x33333399, _glWidget->width() - 296, _glWidget->height() - 68, 296, 68);
_bandwidthMeter.render(_glWidget->width(), _glWidget->height());
}
}
@ -3243,8 +3244,12 @@ void Application::displayStats() {
node->getType() == NODE_TYPE_AGENT ? totalAvatars++ : totalServers++;
}
if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
horizontalOffset += MIRROR_VIEW_WIDTH + MIRROR_VIEW_LEFT_PADDING * 2;
}
lines = _statsExpanded ? 5 : 3;
displayStatsBackground(backgroundColor, 0, 0, 165, lines * STATS_PELS_PER_LINE + 10);
displayStatsBackground(backgroundColor, horizontalOffset, 0, 165, lines * STATS_PELS_PER_LINE + 10);
horizontalOffset += 5;
char serverNodes[30];
@ -3533,6 +3538,10 @@ void Application::checkStatsClick() {
int statsHeight = 0, statsWidth = 0, statsX = 0, statsY = 0, lines = 0;
if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
statsX += MIRROR_VIEW_WIDTH;
}
// top-left stats click
lines = _statsExpanded ? 5 : 3;
statsHeight = lines * STATS_PELS_PER_LINE + 10;

View file

@ -42,6 +42,7 @@ static const float AUDIO_CALLBACK_MSECS = (float) NETWORK_BUFFER_LENGTH_SAMPLES_
static const int ICON_SIZE = 24;
static const int ICON_LEFT = 0;
static const int ICON_TOP = 115;
static const int ICON_TOP_MIRROR = 220;
Audio::Audio(Oscilloscope* scope, int16_t initialJitterBufferSamples, QObject* parent) :
AbstractAudioInterface(parent),
@ -554,7 +555,7 @@ void Audio::render(int screenWidth, int screenHeight) {
int currentX = startX;
int topY = screenHeight - 45;
int bottomY = screenHeight - 25;
float frameWidth = 20.0;
float frameWidth = 23.0;
float halfY = topY + ((bottomY - topY) / 2.0);
// draw the lines for the base of the ring buffer
@ -739,7 +740,9 @@ void Audio::handleAudioByteArray(const QByteArray& audioByteArray) {
void Audio::renderToolIcon(int screenHeight) {
_iconBounds = QRect(ICON_LEFT, ICON_TOP, ICON_SIZE, ICON_SIZE);
int iconTop = Menu::getInstance()->isOptionChecked(MenuOption::Mirror) ? ICON_TOP_MIRROR : ICON_TOP;
_iconBounds = QRect(ICON_LEFT, iconTop, ICON_SIZE, ICON_SIZE);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, _micTextureId);