From b3c0f3fedbcd00069350d763d627b7a0c59fd85b Mon Sep 17 00:00:00 2001 From: atlante45 Date: Tue, 9 Jul 2013 15:29:12 +0200 Subject: [PATCH] More code review for UI job --- interface/src/Application.cpp | 22 +++++++++++----------- interface/src/Tool.h | 8 ++++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 986b357edf..d1028b55cb 100755 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2470,22 +2470,22 @@ void Application::displayOverlay() { const char line1[] = "Assign this color to a swatch"; const char line2[] = "by choosing a key from 1 to 8."; - int left = (_glWidget->width() - WIDTH - 2 * MARGIN) / 2; + int left = (_glWidget->width() - POPUP_WIDTH - 2 * POPUP_MARGIN) / 2; int top = _glWidget->height() / 40; glBegin(GL_POLYGON); glColor3f(0.0f, 0.0f, 0.0f); - for (double a = M_PI; a < 1.5f * M_PI; a += STEP) { - glVertex2f(left + MARGIN * cos(a) , top + MARGIN * sin(a)); + for (double a = M_PI; a < 1.5f * M_PI; a += POPUP_STEP) { + glVertex2f(left + POPUP_MARGIN * cos(a) , top + POPUP_MARGIN * sin(a)); } - for (double a = 1.5f * M_PI; a < 2.0f*M_PI; a += STEP) { - glVertex2f(left + WIDTH + MARGIN * cos(a), top + MARGIN * sin(a)); + for (double a = 1.5f * M_PI; a < 2.0f * M_PI; a += POPUP_STEP) { + glVertex2f(left + POPUP_WIDTH + POPUP_MARGIN * cos(a), top + POPUP_MARGIN * sin(a)); } - for (double a = 0.0f; a < 0.5f * M_PI; a += STEP) { - glVertex2f(left + WIDTH + MARGIN * cos(a), top + HEIGHT + MARGIN * sin(a)); + for (double a = 0.0f; a < 0.5f * M_PI; a += POPUP_STEP) { + glVertex2f(left + POPUP_WIDTH + POPUP_MARGIN * cos(a), top + POPUP_HEIGHT + POPUP_MARGIN * sin(a)); } - for (double a = 0.5f*M_PI; a < 1.0f*M_PI; a += STEP) { - glVertex2f(left + MARGIN*cos(a) , top + HEIGHT + MARGIN*sin(a)); + for (double a = 0.5f * M_PI; a < 1.0f * M_PI; a += POPUP_STEP) { + glVertex2f(left + POPUP_MARGIN * cos(a) , top + POPUP_HEIGHT + POPUP_MARGIN * sin(a)); } glEnd(); @@ -2500,8 +2500,8 @@ void Application::displayOverlay() { glEnd(); glColor3f(1.0f, 1.0f, 1.0f); - textRenderer.draw(left + SWATCH_WIDTH + MARGIN, top + FIRST_LINE_OFFSET , line1); - textRenderer.draw(left + SWATCH_WIDTH + MARGIN, top + SECOND_LINE_OFFSET, line2); + textRenderer.draw(left + SWATCH_WIDTH + POPUP_MARGIN, top + FIRST_LINE_OFFSET , line1); + textRenderer.draw(left + SWATCH_WIDTH + POPUP_MARGIN, top + SECOND_LINE_OFFSET, line2); } else { _swatch.checkColor(); diff --git a/interface/src/Tool.h b/interface/src/Tool.h index 405c64bc5e..f0e1bae4b0 100644 --- a/interface/src/Tool.h +++ b/interface/src/Tool.h @@ -26,10 +26,10 @@ static const float TOOLS_RATIO = 40.0f / 60.0f; // ratio height/width of tools i static const float PAL_SCREEN_RATIO = 3.0f / 100.0f; // Percentage of the screeen width the palette is going to occupy // Swatch popup consts -static const float STEP = 0.05f; -static const float MARGIN = 10.0f; -static const int WIDTH = 280; -static const int HEIGHT = 30; +static const float POPUP_STEP = 0.05f; +static const float POPUP_MARGIN = 10.0f; +static const int POPUP_WIDTH = 280; +static const int POPUP_HEIGHT = 30; static const int SWATCH_WIDTH = 64; static const int SWATCH_HEIGHT = 30; static const int FIRST_LINE_OFFSET = 12;