New batch of update for issue 3446
This commit include : - cleanup rtgui/retinex.cc file (constructor only) and switched to Gtk::Grid (the new standard) instead of Gtk::Box. This however doesn't solve the issue of the Transmission curves in the Retinex tool, with wrong resize of the Frame when folding/unfolding the curves. - better alignment of the Histogram panel now with 4px of padding on the left and right side - Threshold selector now use the Scale's Trough style to draw its box and sliders - Curve's background are darker and restricted to the curve diagram - Diagonal and Flat curves has been converted to Gtk::Grid as well - A special color is now used for unsensitive Threshold selector and Sclaes widgets - Gap around the main Window has been removed on windows to circumvent a bug in Gtk3, but the window can now only be maximized (usual use case) or resized vertically by the top border only. - Buttons at the bottom of the Editor panel has now the same height
This commit is contained in:
@@ -26,12 +26,13 @@
|
||||
#include "multilangmgr.h"
|
||||
#include "rtimage.h"
|
||||
|
||||
CurveEditorGroup::CurveEditorGroup (Glib::ustring& curveDir, Glib::ustring groupLabel) : curveDir(curveDir), curve_reset(nullptr),
|
||||
CurveEditorGroup::CurveEditorGroup (Glib::ustring& curveDir, Glib::ustring groupLabel) : curveDir(curveDir), line(0), curve_reset(nullptr),
|
||||
displayedCurve(nullptr), flatSubGroup(nullptr), diagonalSubGroup(nullptr), cl(nullptr), numberOfPackedCurve(0)
|
||||
{
|
||||
|
||||
// We set the label to the one provided as parameter, even if it's an empty string
|
||||
curveGroupLabel = Gtk::manage (new Gtk::Label (groupLabel + ":", Gtk::ALIGN_START));
|
||||
setExpandAlignProperties(curveGroupLabel, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER);
|
||||
}
|
||||
|
||||
CurveEditorGroup::~CurveEditorGroup()
|
||||
@@ -115,35 +116,45 @@ void CurveEditorGroup::newLine()
|
||||
{
|
||||
|
||||
if (curveEditors.size() > numberOfPackedCurve) {
|
||||
Gtk::HBox* headerBox = Gtk::manage (new Gtk::HBox ());
|
||||
Gtk::Grid* currLine = Gtk::manage (new Gtk::Grid ());
|
||||
setExpandAlignProperties(currLine, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
|
||||
|
||||
bool isHeader = false;
|
||||
int x = 0;
|
||||
|
||||
if (!numberOfPackedCurve) {
|
||||
headerBox->pack_start(*curveGroupLabel, Gtk::PACK_SHRINK, 2);
|
||||
isHeader = true;
|
||||
currLine->attach(*curveGroupLabel, x++, 0, 1, 1);
|
||||
}
|
||||
|
||||
for (int i = numberOfPackedCurve; i < (int)(curveEditors.size()); ++i) {
|
||||
currLine->attach(*curveEditors[i]->curveType->buttonGroup, x++, 0, 1, 1);
|
||||
|
||||
if (curveEditors[i]->relatedWidget != nullptr) {
|
||||
currLine->attach(*curveEditors[i]->relatedWidget, x++, 0, 1, 1);
|
||||
}
|
||||
|
||||
numberOfPackedCurve++;
|
||||
}
|
||||
|
||||
if (isHeader) {
|
||||
curve_reset = Gtk::manage (new Gtk::Button ());
|
||||
setExpandAlignProperties(curve_reset, false, false, Gtk::ALIGN_END, Gtk::ALIGN_FILL);
|
||||
curve_reset->add (*Gtk::manage (new RTImage ("gtk-undo-ltr-small.png", "gtk-undo-rtl-small.png")));
|
||||
curve_reset->set_relief (Gtk::RELIEF_NONE);
|
||||
curve_reset->set_tooltip_text (M("CURVEEDITOR_TOOLTIPLINEAR"));
|
||||
curve_reset->signal_clicked().connect( sigc::mem_fun(*this, &CurveEditorGroup::curveResetPressed) );
|
||||
|
||||
headerBox->pack_end (*curve_reset, Gtk::PACK_SHRINK, 0);
|
||||
currLine->attach(*curve_reset, x++, 0, 1, 1);
|
||||
}
|
||||
|
||||
int j = numberOfPackedCurve;
|
||||
|
||||
for (int i = (int)(curveEditors.size()) - 1; i >= j; i--) {
|
||||
if (curveEditors[i]->relatedWidget != nullptr) {
|
||||
headerBox->pack_end (*curveEditors[i]->relatedWidget, Gtk::PACK_EXPAND_WIDGET, 2);
|
||||
}
|
||||
|
||||
headerBox->pack_end (*curveEditors[i]->curveType->buttonGroup, /*hasRelatedWidget ? Gtk::PACK_SHRINK :*/ Gtk::PACK_EXPAND_WIDGET, 2);
|
||||
numberOfPackedCurve++;
|
||||
}
|
||||
|
||||
pack_start (*headerBox, Gtk::PACK_SHRINK, 2);
|
||||
attach(*currLine, 0, line++, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CurveEditorGroup::attachCurve (Gtk::Grid* curve)
|
||||
{
|
||||
attach(*curve, 0, line, 1, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user