Decoration of adjusters (issue 2190)
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
|
||||
static double one2one(double val) { return val; }
|
||||
|
||||
Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep, double vdefault, Gtk::Image *imgIcon, double2double_fun slider2value_, double2double_fun value2slider_) {
|
||||
Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep, double vdefault, Gtk::Image *imgIcon1, Gtk::Image *imgIcon2, double2double_fun slider2value_, double2double_fun value2slider_) {
|
||||
|
||||
Gtk::HBox *hbox2=NULL;
|
||||
|
||||
@@ -82,9 +82,10 @@ Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep
|
||||
|
||||
if (vlabel.empty()) {
|
||||
// No label, everything goes in hbox
|
||||
if (imgIcon) hbox->pack_start (*imgIcon, Gtk::PACK_SHRINK);
|
||||
if (imgIcon1) hbox->pack_start (*imgIcon1, Gtk::PACK_SHRINK, 0);
|
||||
hbox->pack_end (*reset, Gtk::PACK_SHRINK, 0);
|
||||
hbox->pack_end (*spin, Gtk::PACK_SHRINK, 0);
|
||||
if (imgIcon2) hbox->pack_start (*imgIcon2, Gtk::PACK_SHRINK, 0);
|
||||
hbox->pack_start (*slider, true, true);
|
||||
}
|
||||
else {
|
||||
@@ -92,14 +93,15 @@ Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep
|
||||
hbox->pack_start (*label);
|
||||
hbox->pack_end (*reset, Gtk::PACK_SHRINK, 0);
|
||||
hbox->pack_end (*spin, Gtk::PACK_SHRINK, 0);
|
||||
if (!imgIcon) {
|
||||
if (!imgIcon1 || !imgIcon2) {
|
||||
pack_start (*slider, true, true);
|
||||
}
|
||||
else {
|
||||
// A second HBox is necessary
|
||||
hbox2 = Gtk::manage (new Gtk::HBox());
|
||||
hbox2->pack_start (*imgIcon, Gtk::PACK_SHRINK);
|
||||
if (imgIcon1) hbox2->pack_start (*imgIcon1, Gtk::PACK_SHRINK, 0);
|
||||
hbox2->pack_start (*slider, true, true);
|
||||
if (imgIcon2) hbox2->pack_start (*imgIcon2, Gtk::PACK_SHRINK, 0);
|
||||
pack_start (*hbox2, true, true);
|
||||
}
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ class Adjuster : public Gtk::VBox {
|
||||
|
||||
int delay;
|
||||
|
||||
Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep, double vdefault, Gtk::Image *imgIcon=NULL, double2double_fun slider2value=NULL, double2double_fun value2slider=NULL);
|
||||
Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep, double vdefault, Gtk::Image *imgIcon1=NULL, Gtk::Image *imgIcon2=NULL, double2double_fun slider2value=NULL, double2double_fun value2slider=NULL);
|
||||
virtual ~Adjuster ();
|
||||
|
||||
// Add an "Automatic" checkbox next to the reset button.
|
||||
|
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
#include "cacorrection.h"
|
||||
#include <iomanip>
|
||||
#include "rtimage.h"
|
||||
|
||||
using namespace rtengine;
|
||||
using namespace rtengine::procparams;
|
||||
@@ -26,10 +27,15 @@ CACorrection::CACorrection () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
|
||||
set_border_width(4);
|
||||
|
||||
red = Gtk::manage (new Adjuster (M("TP_CACORRECTION_RED"), -0.005, 0.005, 0.0001, 0));
|
||||
Gtk::Image* icaredL = Gtk::manage (new RTImage ("ajd-ca-red1.png"));
|
||||
Gtk::Image* icaredR = Gtk::manage (new RTImage ("ajd-ca-red2.png"));
|
||||
Gtk::Image* icablueL = Gtk::manage (new RTImage ("ajd-ca-blue1.png"));
|
||||
Gtk::Image* icablueR = Gtk::manage (new RTImage ("ajd-ca-blue2.png"));
|
||||
|
||||
red = Gtk::manage (new Adjuster (M("TP_CACORRECTION_RED"), -0.005, 0.005, 0.0001, 0, icaredL, icaredR));
|
||||
red->setAdjusterListener (this);
|
||||
|
||||
blue = Gtk::manage (new Adjuster (M("TP_CACORRECTION_BLUE"), -0.005, 0.005, 0.0001, 0));
|
||||
blue = Gtk::manage (new Adjuster (M("TP_CACORRECTION_BLUE"), -0.005, 0.005, 0.0001, 0, icablueL, icablueR));
|
||||
blue->setAdjusterListener (this);
|
||||
|
||||
pack_start (*red);
|
||||
|
@@ -37,7 +37,10 @@ Distortion::Distortion (): Gtk::VBox(), FoldableToolPanel(this) {
|
||||
autoDistor->show();
|
||||
pack_start (*autoDistor);
|
||||
|
||||
distor = Gtk::manage (new Adjuster (M("TP_DISTORTION_AMOUNT"), -0.5, 0.5, 0.001, 0));
|
||||
Gtk::Image* idistL = Gtk::manage (new RTImage ("distortion-pincushion.png"));
|
||||
Gtk::Image* idistR = Gtk::manage (new RTImage ("distortion-barrel.png"));
|
||||
|
||||
distor = Gtk::manage (new Adjuster (M("TP_DISTORTION_AMOUNT"), -0.5, 0.5, 0.001, 0, idistL, idistR));
|
||||
distor->setAdjusterListener (this);
|
||||
distor->show();
|
||||
pack_start (*distor);
|
||||
|
@@ -17,6 +17,7 @@
|
||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "perspective.h"
|
||||
#include "rtimage.h"
|
||||
|
||||
using namespace rtengine;
|
||||
using namespace rtengine::procparams;
|
||||
@@ -25,10 +26,15 @@ PerspCorrection::PerspCorrection () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
|
||||
set_border_width(4);
|
||||
|
||||
horiz = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_HORIZONTAL"), -100, 100, 0.1, 0));
|
||||
Gtk::Image* ipersHL = Gtk::manage (new RTImage ("perspective-h1.png"));
|
||||
Gtk::Image* ipersHR = Gtk::manage (new RTImage ("perspective-h2.png"));
|
||||
Gtk::Image* ipersVL = Gtk::manage (new RTImage ("perspective-v1.png"));
|
||||
Gtk::Image* ipersVR = Gtk::manage (new RTImage ("perspective-v2.png"));
|
||||
|
||||
horiz = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_HORIZONTAL"), -100, 100, 0.1, 0, ipersHL, ipersHR));
|
||||
horiz->setAdjusterListener (this);
|
||||
|
||||
vert = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_VERTICAL"), -100, 100, 0.1, 0));
|
||||
vert = Gtk::manage (new Adjuster (M("TP_PERSPECTIVE_VERTICAL"), -100, 100, 0.1, 0, ipersVL, ipersVR));
|
||||
vert->setAdjusterListener (this);
|
||||
|
||||
pack_start (*horiz);
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include "guiutils.h"
|
||||
#include "../rtengine/safegtk.h"
|
||||
#include <sstream>
|
||||
#include "rtimage.h"
|
||||
|
||||
using namespace rtengine;
|
||||
using namespace rtengine::procparams;
|
||||
@@ -28,12 +29,17 @@ RAWCACorr::RAWCACorr () : Gtk::VBox(), FoldableToolPanel(this)
|
||||
{
|
||||
set_border_width(4);
|
||||
|
||||
Gtk::Image* icaredL = Gtk::manage (new RTImage ("ajd-ca-red1.png"));
|
||||
Gtk::Image* icaredR = Gtk::manage (new RTImage ("ajd-ca-red2.png"));
|
||||
Gtk::Image* icablueL = Gtk::manage (new RTImage ("ajd-ca-blue1.png"));
|
||||
Gtk::Image* icablueR = Gtk::manage (new RTImage ("ajd-ca-blue2.png"));
|
||||
|
||||
caAutocorrect = Gtk::manage(new Gtk::CheckButton((M("TP_RAWCACORR_AUTO"))));
|
||||
caRed = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CARED"),-4.0,4.0,0.1,0));
|
||||
caRed = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CARED"),-4.0,4.0,0.1,0,icaredL,icaredR));
|
||||
caRed->setAdjusterListener (this);
|
||||
if (caRed->delay < 1000) caRed->delay = 1000;
|
||||
caRed->show();
|
||||
caBlue = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CABLUE"),-4.0,4.0,0.1,0));
|
||||
caBlue = Gtk::manage(new Adjuster (M("TP_RAWCACORR_CABLUE"),-4.0,4.0,0.1,0,icablueL,icablueR));
|
||||
caBlue->setAdjusterListener (this);
|
||||
if (caBlue->delay < 1000) caBlue->delay = 1000;
|
||||
caBlue->show();
|
||||
|
@@ -32,7 +32,11 @@ Rotate::Rotate () : Gtk::VBox(), FoldableToolPanel(this) {
|
||||
|
||||
rlistener = NULL;
|
||||
|
||||
degree = Gtk::manage (new Adjuster (M("TP_ROTATE_DEGREE"), -45, 45, 0.01, 0));
|
||||
//TODO the action of the rotation slider is counter-intuitive
|
||||
Gtk::Image* irotateL = Gtk::manage (new RTImage ("rotate-right-2.png"));
|
||||
Gtk::Image* irotateR = Gtk::manage (new RTImage ("rotate-left-2.png"));
|
||||
|
||||
degree = Gtk::manage (new Adjuster (M("TP_ROTATE_DEGREE"), -45, 45, 0.01, 0, irotateL, irotateR));
|
||||
degree->setAdjusterListener (this);
|
||||
pack_start (*degree);
|
||||
|
||||
|
@@ -235,9 +235,16 @@ WhiteBalance::WhiteBalance () : Gtk::VBox(), FoldableToolPanel(this), wbp(NULL),
|
||||
|
||||
pack_start (*spotbox, Gtk::PACK_SHRINK, 4);
|
||||
|
||||
temp = Gtk::manage (new Adjuster (M("TP_WBALANCE_TEMPERATURE"), MINTEMP, MAXTEMP, 5, CENTERTEMP, NULL, &wbSlider2Temp, &wbTemp2Slider));
|
||||
green = Gtk::manage (new Adjuster (M("TP_WBALANCE_GREEN"), MINGREEN, MAXGREEN, 0.001, 1.0));
|
||||
equal = Gtk::manage (new Adjuster (M("TP_WBALANCE_EQBLUERED"), MINEQUAL, MAXEQUAL, 0.001, 1.0));
|
||||
Gtk::Image* itempL = Gtk::manage (new RTImage ("ajd-wb-temp1.png"));
|
||||
Gtk::Image* itempR = Gtk::manage (new RTImage ("ajd-wb-temp2.png"));
|
||||
Gtk::Image* igreenL = Gtk::manage (new RTImage ("ajd-wb-green1.png"));
|
||||
Gtk::Image* igreenR = Gtk::manage (new RTImage ("ajd-wb-green2.png"));
|
||||
Gtk::Image* iblueredL = Gtk::manage (new RTImage ("ajd-wb-bluered1.png"));
|
||||
Gtk::Image* iblueredR = Gtk::manage (new RTImage ("ajd-wb-bluered2.png"));
|
||||
|
||||
temp = Gtk::manage (new Adjuster (M("TP_WBALANCE_TEMPERATURE"), MINTEMP, MAXTEMP, 5, CENTERTEMP, itempL, itempR, &wbSlider2Temp, &wbTemp2Slider));
|
||||
green = Gtk::manage (new Adjuster (M("TP_WBALANCE_GREEN"), MINGREEN, MAXGREEN, 0.001, 1.0, igreenL, igreenR));
|
||||
equal = Gtk::manage (new Adjuster (M("TP_WBALANCE_EQBLUERED"), MINEQUAL, MAXEQUAL, 0.001, 1.0, iblueredL, iblueredR));
|
||||
cache_customTemp (0);
|
||||
cache_customGreen (0);
|
||||
cache_customEqual (0);
|
||||
@@ -246,7 +253,15 @@ WhiteBalance::WhiteBalance () : Gtk::VBox(), FoldableToolPanel(this), wbp(NULL),
|
||||
green->show ();
|
||||
equal->show ();
|
||||
|
||||
/* Gtk::HBox* boxgreen = Gtk::manage (new Gtk::HBox ());
|
||||
boxgreen->show ();
|
||||
|
||||
boxgreen->pack_start(*igreenL);
|
||||
boxgreen->pack_start(*green);
|
||||
boxgreen->pack_start(*igreenR);*/
|
||||
|
||||
pack_start (*temp);
|
||||
//pack_start (*boxgreen);
|
||||
pack_start (*green);
|
||||
pack_start (*equal);
|
||||
|
||||
|
Reference in New Issue
Block a user