| 1 /* |
1 /* |
| 2 * LDForge: LDraw parts authoring CAD |
2 * LDForge: LDraw parts authoring CAD |
| 3 * Copyright (C) 2013 Santeri `arezey` Piippo |
3 * Copyright (C) 2013 Santeri Piippo |
| 4 * |
4 * |
| 5 * This program is free software: you can redistribute it and/or modify |
5 * This program is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License as published by |
6 * it under the terms of the GNU General Public License as published by |
| 7 * the Free Software Foundation, either version 3 of the License, or |
7 * the Free Software Foundation, either version 3 of the License, or |
| 8 * (at your option) any later version. |
8 * (at your option) any later version. |
| 68 qView->setMaximumHeight (g_lHeight); |
68 qView->setMaximumHeight (g_lHeight); |
| 69 qView->setMinimumHeight (g_lHeight); |
69 qView->setMinimumHeight (g_lHeight); |
| 70 qView->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff); |
70 qView->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff); |
| 71 |
71 |
| 72 // If we have a default color selected, scroll down so that it is visible. |
72 // If we have a default color selected, scroll down so that it is visible. |
| |
73 // TODO: find a better way to do this |
| 73 if (dDefault >= ((g_dNumColumns * g_dNumRows) - 2)) { |
74 if (dDefault >= ((g_dNumColumns * g_dNumRows) - 2)) { |
| 74 ulong ulNewY = ((dDefault / g_dNumColumns) - 3) * g_dSquareSize; |
75 ulong ulNewY = ((dDefault / g_dNumColumns) - 3) * g_dSquareSize; |
| 75 qView->verticalScrollBar ()->setSliderPosition (ulNewY); |
76 qView->verticalScrollBar ()->setSliderPosition (ulNewY); |
| 76 } |
77 } |
| 77 |
78 |