# HG changeset patch # User Santeri Piippo # Date 1363863426 -7200 # Node ID 4db04d4857c09b1a24d67a98425dec5662a263f6 # Parent 6e89589f1fe8fe7c676da51c553db7f92ad59617 Scroll the color picker dialog to the selected color if it's off-screen diff -r 6e89589f1fe8 -r 4db04d4857c0 colors.cpp --- a/colors.cpp Thu Mar 21 03:20:02 2013 +0200 +++ b/colors.cpp Thu Mar 21 12:57:06 2013 +0200 @@ -41,8 +41,11 @@ {17, "Light Green", "#80FF80", 1.0}, {18, "Light Yellow", "#FFFF80", 1.0}, {19, "Tan", "#EECC99", 1.0}, + {21, "Phosphorus", "#E0FFB0", 0.975}, {22, "Purple", "#A000A0", 1.0}, {24, "Edge Color", "#000000", 1.0}, + {25, "Orange", "#FF8000", 1.0}, + {26, "Magenta", "#FFA0FF", 1.0}, {27, "Lime", "#00FF00", 1.0}, {28, "Sand", "#989070", 1.0}, {32, "Smoke", "#101010", 0.5}, @@ -61,6 +64,9 @@ {45, "Trans Pink", "#FF2080", 0.5}, {46, "Trans Yellow", "#FFEE00", 0.5}, {47, "Clear", "#FFFFFF", 0.5}, + {79, "Ghost White", "#FFFFFF", 0.875}, + {294, "Trans Phosphorus", "#E0FFB0", 0.6}, + {378, "Sand Green", "#80A080", 1.0}, }; color* g_LDColors[MAX_COLORS]; diff -r 6e89589f1fe8 -r 4db04d4857c0 zz_colorSelectDialog.cpp --- a/zz_colorSelectDialog.cpp Thu Mar 21 03:20:02 2013 +0200 +++ b/zz_colorSelectDialog.cpp Thu Mar 21 12:57:06 2013 +0200 @@ -24,6 +24,7 @@ #include #include #include +#include #include "zz_colorSelectDialog.h" #include "colors.h" @@ -58,6 +59,13 @@ qView->setMinimumWidth (lWidth); qView->setMaximumHeight (g_lHeight); qView->setMinimumHeight (g_lHeight); + qView->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff); + + // If we have a default color selected, scroll down so that it is visible. + if (dDefault >= ((g_dNumColumns * g_dNumRows) - 2)) { + ulong ulNewY = ((dDefault / g_dNumColumns) - 3) * g_dSquareSize; + qView->verticalScrollBar ()->setSliderPosition (ulNewY); + } qColorInfo = new QLabel; drawColorInfo ();