few fixes on the job 19368

This commit is contained in:
atlante45 2013-06-25 01:28:31 +02:00
parent 52d62185ee
commit ee15739e7e
2 changed files with 10 additions and 9 deletions

View file

@ -1359,7 +1359,7 @@ void Application::initMenu() {
QMenu* renderMenu = menuBar->addMenu("Render"); QMenu* renderMenu = menuBar->addMenu("Render");
(_renderVoxels = renderMenu->addAction("Voxels"))->setCheckable(true); (_renderVoxels = renderMenu->addAction("Voxels"))->setCheckable(true);
_renderVoxels->setChecked(true); _renderVoxels->setChecked(true);
_renderVoxels->setShortcut(Qt::Key_V); _renderVoxels->setShortcut(Qt::CTRL | Qt::Key_V);
(_renderVoxelTextures = renderMenu->addAction("Voxel Textures"))->setCheckable(true); (_renderVoxelTextures = renderMenu->addAction("Voxel Textures"))->setCheckable(true);
(_renderStarsOn = renderMenu->addAction("Stars"))->setCheckable(true); (_renderStarsOn = renderMenu->addAction("Stars"))->setCheckable(true);
_renderStarsOn->setChecked(true); _renderStarsOn->setChecked(true);
@ -1395,19 +1395,19 @@ void Application::initMenu() {
_voxelModeActions->setExclusive(false); // exclusivity implies one is always checked _voxelModeActions->setExclusive(false); // exclusivity implies one is always checked
(_addVoxelMode = voxelMenu->addAction( (_addVoxelMode = voxelMenu->addAction(
"Add Voxel Mode", this, SLOT(updateVoxelModeActions()), Qt::CTRL | Qt::Key_V))->setCheckable(true); "Add Voxel Mode", this, SLOT(updateVoxelModeActions()), Qt::Key_V))->setCheckable(true);
_voxelModeActions->addAction(_addVoxelMode); _voxelModeActions->addAction(_addVoxelMode);
(_deleteVoxelMode = voxelMenu->addAction( (_deleteVoxelMode = voxelMenu->addAction(
"Delete Voxel Mode", this, SLOT(updateVoxelModeActions()), Qt::CTRL | Qt::Key_R))->setCheckable(true); "Delete Voxel Mode", this, SLOT(updateVoxelModeActions()), Qt::Key_R))->setCheckable(true);
_voxelModeActions->addAction(_deleteVoxelMode); _voxelModeActions->addAction(_deleteVoxelMode);
(_colorVoxelMode = voxelMenu->addAction( (_colorVoxelMode = voxelMenu->addAction(
"Color Voxel Mode", this, SLOT(updateVoxelModeActions()), Qt::CTRL | Qt::Key_B))->setCheckable(true); "Color Voxel Mode", this, SLOT(updateVoxelModeActions()), Qt::Key_B))->setCheckable(true);
_voxelModeActions->addAction(_colorVoxelMode); _voxelModeActions->addAction(_colorVoxelMode);
(_selectVoxelMode = voxelMenu->addAction( (_selectVoxelMode = voxelMenu->addAction(
"Select Voxel Mode", this, SLOT(updateVoxelModeActions()), Qt::CTRL | Qt::Key_S))->setCheckable(true); "Select Voxel Mode", this, SLOT(updateVoxelModeActions()), Qt::Key_O))->setCheckable(true);
_voxelModeActions->addAction(_selectVoxelMode); _voxelModeActions->addAction(_selectVoxelMode);
(_eyedropperMode = voxelMenu->addAction( (_eyedropperMode = voxelMenu->addAction(
"Get Color Mode", this, SLOT(updateVoxelModeActions()), Qt::CTRL | Qt::Key_G))->setCheckable(true); "Get Color Mode", this, SLOT(updateVoxelModeActions()), Qt::Key_G))->setCheckable(true);
_voxelModeActions->addAction(_eyedropperMode); _voxelModeActions->addAction(_eyedropperMode);
voxelMenu->addAction("Decrease Voxel Size", this, SLOT(decreaseVoxelSize()), QKeySequence::ZoomOut); voxelMenu->addAction("Decrease Voxel Size", this, SLOT(decreaseVoxelSize()), QKeySequence::ZoomOut);
@ -1552,6 +1552,7 @@ void Application::init() {
_palette.addTool(_swatch); _palette.addTool(_swatch);
_palette.addAction(_colorVoxelMode, 0, 2); _palette.addAction(_colorVoxelMode, 0, 2);
_palette.addAction(_eyedropperMode, 0, 3); _palette.addAction(_eyedropperMode, 0, 3);
_palette.addAction(_selectVoxelMode, 0, 4);
} }
const float MAX_AVATAR_EDIT_VELOCITY = 1.0f; const float MAX_AVATAR_EDIT_VELOCITY = 1.0f;
@ -2297,8 +2298,8 @@ void Application::displayOverlay() {
const char* line1("Assign this color to a swatch"); const char* line1("Assign this color to a swatch");
const char* line2("by choosing a key from 1 to 8."); const char* line2("by choosing a key from 1 to 8.");
double step(0.05f); double step(0.05f);
int left(_glWidget->width()/100.0f); int left((_glWidget->width() - 320)/2);
int top(_glWidget->height()*7.0f/10.0f); int top(_glWidget->height()/40.0f);
double margin(10.0f); double margin(10.0f);
glBegin(GL_POLYGON); glBegin(GL_POLYGON);

View file

@ -86,7 +86,7 @@ void Swatch::render(int screenWidth, int screenHeight) {
glVertex2f(_margin, i*(_height - _margin) + _margin); glVertex2f(_margin, i*(_height - _margin) + _margin);
glEnd(); glEnd();
if (_colors[i].lightness() < 100) { if (_colors[i].lightness() < 50) {
glBegin(GL_LINES); glBegin(GL_LINES);
glColor3f(1.0f, 1.0f, 1.0f); glColor3f(1.0f, 1.0f, 1.0f);
glVertex2f(_margin, (i + 1)*(_height - _margin)); glVertex2f(_margin, (i + 1)*(_height - _margin));