custom tool panel. Changed naming to 'Favourites'. Added alt-h hotkey. Allow moving of subtools to Favourites

This commit is contained in:
heckflosse
2018-11-23 16:00:57 +01:00
parent d604abec39
commit 0ae602bcf0
5 changed files with 85 additions and 81 deletions

View File

@@ -900,8 +900,8 @@ MAIN_TAB_ADVANCED;Advanced
MAIN_TAB_ADVANCED_TOOLTIP;Shortcut: <b>Alt-w</b>
MAIN_TAB_COLOR;Color
MAIN_TAB_COLOR_TOOLTIP;Shortcut: <b>Alt-c</b>
MAIN_TAB_CUSTOM;Custom
MAIN_TAB_CUSTOM_TOOLTIP;Shortcut: none
MAIN_TAB_FAVOURITES;Favourites
MAIN_TAB_FAVOURITES_TOOLTIP;Shortcut: <b>Alt-u</b>
MAIN_TAB_DETAIL;Detail
MAIN_TAB_DETAIL_TOOLTIP;Shortcut: <b>Alt-d</b>
MAIN_TAB_DEVELOP; Batch Edit

View File

@@ -399,7 +399,7 @@ void Options::setDefaults()
autoSaveTpOpen = true;
//crvOpen.clear ();
parseExtensions.clear();
userTools.clear();
favourites.clear();
parseExtensionsEnabled.clear();
parsedExtensions.clear();
renameUseTemplates = false;
@@ -1070,8 +1070,8 @@ void Options::readFromFile(Glib::ustring fname)
}
if (keyFile.has_group("GUI")) {
if (keyFile.has_key("GUI", "UserTools")) {
userTools = keyFile.get_string_list("GUI", "UserTools");
if (keyFile.has_key("GUI", "Favourites")) {
favourites = keyFile.get_string_list("GUI", "Favourites");
}
if (keyFile.has_key("GUI", "WindowWidth")) {
@@ -1972,8 +1972,8 @@ void Options::saveToFile(Glib::ustring fname)
keyFile.set_string("Profiles", "CustomProfileBuilderPath", CPBPath);
keyFile.set_integer("Profiles", "CustomProfileBuilderKeys", CPBKeys);
Glib::ArrayHandle<Glib::ustring> pusert = userTools;
keyFile.set_string_list("GUI", "UserTools", pusert);
Glib::ArrayHandle<Glib::ustring> ahfavourites = favourites;
keyFile.set_string_list("GUI", "Favourites", ahfavourites);
keyFile.set_integer("GUI", "WindowWidth", windowWidth);
keyFile.set_integer("GUI", "WindowHeight", windowHeight);
keyFile.set_integer("GUI", "WindowX", windowX);

View File

@@ -375,7 +375,7 @@ public:
int fastexport_resize_height;
bool fastexport_use_fast_pipeline;
std::vector<Glib::ustring> userTools;
std::vector<Glib::ustring> favourites;
// Dialog settings
Glib::ustring lastIccDir;
Glib::ustring lastDarkframeDir;

View File

@@ -31,7 +31,7 @@ using namespace rtengine::procparams;
ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChanged (false), editDataProvider (nullptr)
{
userPanel = Gtk::manage (new ToolVBox ());
favouritePanel = Gtk::manage (new ToolVBox ());
exposurePanel = Gtk::manage (new ToolVBox ());
detailsPanel = Gtk::manage (new ToolVBox ());
colorPanel = Gtk::manage (new ToolVBox ());
@@ -101,62 +101,62 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChan
// Valeurs par dfaut:
// Best -> low ISO
// Medium -> High ISO
userTools.resize(options.userTools.size());
favourites.resize(options.favourites.size());
addUserPanel (colorPanel, whitebalance);
addUserPanel (exposurePanel, toneCurve);
addUserPanel (colorPanel, vibrance);
addUserPanel (colorPanel, chmixer);
addUserPanel (colorPanel, blackwhite);
addUserPanel (exposurePanel, shadowshighlights);
addUserPanel (detailsPanel, sharpening);
addUserPanel (detailsPanel, localContrast);
addUserPanel (detailsPanel, sharpenEdge);
addUserPanel (detailsPanel, sharpenMicro);
addUserPanel (colorPanel, hsvequalizer);
addUserPanel (colorPanel, filmSimulation);
addUserPanel (colorPanel, softlight);
addUserPanel (colorPanel, rgbcurves);
addUserPanel (colorPanel, colortoning);
addUserPanel (exposurePanel, epd);
addUserPanel (exposurePanel, fattal);
addUserPanel (advancedPanel, retinex);
addUserPanel (exposurePanel, pcvignette);
addUserPanel (exposurePanel, gradient);
addUserPanel (exposurePanel, lcurve);
addUserPanel (advancedPanel, colorappearance);
addUserPanel (detailsPanel, impulsedenoise);
addUserPanel (detailsPanel, dirpyrdenoise);
addUserPanel (detailsPanel, defringe);
addUserPanel (detailsPanel, dirpyrequalizer);
addUserPanel (detailsPanel, dehaze);
addUserPanel (advancedPanel, wavelet);
addUserPanel (transformPanel, crop);
addUserPanel (transformPanel, resize);
addPanel (resize->getPackBox(), prsharpening, 2);
addUserPanel (transformPanel, lensgeom);
addPanel (lensgeom->getPackBox(), rotate, 2);
addPanel (lensgeom->getPackBox(), perspective, 2);
addPanel (lensgeom->getPackBox(), lensProf, 2);
addPanel (lensgeom->getPackBox(), distortion, 2);
addPanel (lensgeom->getPackBox(), cacorrection, 2);
addPanel (lensgeom->getPackBox(), vignetting, 2);
addUserPanel (colorPanel, icm);
addUserPanel (rawPanel, sensorbayer);
addPanel (sensorbayer->getPackBox(), bayerprocess, 2);
addPanel (sensorbayer->getPackBox(), bayerrawexposure, 2);
addPanel (sensorbayer->getPackBox(), bayerpreprocess, 2);
addPanel (sensorbayer->getPackBox(), rawcacorrection, 2);
addUserPanel (rawPanel, sensorxtrans);
addPanel (sensorxtrans->getPackBox(), xtransprocess, 2);
addPanel (sensorxtrans->getPackBox(), xtransrawexposure, 2);
addUserPanel (rawPanel, rawexposure);
addUserPanel (rawPanel, preprocess);
addUserPanel (rawPanel, darkframe);
addUserPanel (rawPanel, flatfield);
addfavouritePanel (colorPanel, whitebalance);
addfavouritePanel (exposurePanel, toneCurve);
addfavouritePanel (colorPanel, vibrance);
addfavouritePanel (colorPanel, chmixer);
addfavouritePanel (colorPanel, blackwhite);
addfavouritePanel (exposurePanel, shadowshighlights);
addfavouritePanel (detailsPanel, sharpening);
addfavouritePanel (detailsPanel, localContrast);
addfavouritePanel (detailsPanel, sharpenEdge);
addfavouritePanel (detailsPanel, sharpenMicro);
addfavouritePanel (colorPanel, hsvequalizer);
addfavouritePanel (colorPanel, filmSimulation);
addfavouritePanel (colorPanel, softlight);
addfavouritePanel (colorPanel, rgbcurves);
addfavouritePanel (colorPanel, colortoning);
addfavouritePanel (exposurePanel, epd);
addfavouritePanel (exposurePanel, fattal);
addfavouritePanel (advancedPanel, retinex);
addfavouritePanel (exposurePanel, pcvignette);
addfavouritePanel (exposurePanel, gradient);
addfavouritePanel (exposurePanel, lcurve);
addfavouritePanel (advancedPanel, colorappearance);
addfavouritePanel (detailsPanel, impulsedenoise);
addfavouritePanel (detailsPanel, dirpyrdenoise);
addfavouritePanel (detailsPanel, defringe);
addfavouritePanel (detailsPanel, dirpyrequalizer);
addfavouritePanel (detailsPanel, dehaze);
addfavouritePanel (advancedPanel, wavelet);
addfavouritePanel (transformPanel, crop);
addfavouritePanel (transformPanel, resize);
addfavouritePanel (resize->getPackBox(), prsharpening, 2);
addfavouritePanel (transformPanel, lensgeom);
addfavouritePanel (lensgeom->getPackBox(), rotate, 2);
addfavouritePanel (lensgeom->getPackBox(), perspective, 2);
addfavouritePanel (lensgeom->getPackBox(), lensProf, 2);
addfavouritePanel (lensgeom->getPackBox(), distortion, 2);
addfavouritePanel (lensgeom->getPackBox(), cacorrection, 2);
addfavouritePanel (lensgeom->getPackBox(), vignetting, 2);
addfavouritePanel (colorPanel, icm);
addfavouritePanel (rawPanel, sensorbayer);
addfavouritePanel (sensorbayer->getPackBox(), bayerprocess, 2);
addfavouritePanel (sensorbayer->getPackBox(), bayerrawexposure, 2);
addfavouritePanel (sensorbayer->getPackBox(), bayerpreprocess, 2);
addfavouritePanel (sensorbayer->getPackBox(), rawcacorrection, 2);
addfavouritePanel (rawPanel, sensorxtrans);
addfavouritePanel (sensorxtrans->getPackBox(), xtransprocess, 2);
addfavouritePanel (sensorxtrans->getPackBox(), xtransrawexposure, 2);
addfavouritePanel (rawPanel, rawexposure);
addfavouritePanel (rawPanel, preprocess);
addfavouritePanel (rawPanel, darkframe);
addfavouritePanel (rawPanel, flatfield);
for(auto it = userTools.begin(); it != userTools.end(); ++it) {
addPanel(userPanel, *it);
for(auto it = favourites.begin(); it != favourites.end(); ++it) {
addPanel(favouritePanel, *it);
}
toolPanels.push_back (coarse);
toolPanels.push_back(metadata);
@@ -164,7 +164,7 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChan
toolPanelNotebook = new Gtk::Notebook ();
toolPanelNotebook->set_name ("ToolPanelNotebook");
userPanelSW = Gtk::manage (new MyScrolledWindow ());
favouritePanelSW = Gtk::manage (new MyScrolledWindow ());
exposurePanelSW = Gtk::manage (new MyScrolledWindow ());
detailsPanelSW = Gtk::manage (new MyScrolledWindow ());
colorPanelSW = Gtk::manage (new MyScrolledWindow ());
@@ -182,9 +182,9 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChan
vbPanelEnd[i]->show_all();
}
userPanelSW->add (*userPanel);
userPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0);
userPanel->pack_start (*vbPanelEnd[0], Gtk::PACK_SHRINK, 4);
favouritePanelSW->add (*favouritePanel);
favouritePanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0);
favouritePanel->pack_start (*vbPanelEnd[0], Gtk::PACK_SHRINK, 4);
exposurePanelSW->add (*exposurePanel);
exposurePanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0);
@@ -210,7 +210,7 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChan
rawPanel->pack_start (*Gtk::manage (new Gtk::HSeparator), Gtk::PACK_SHRINK, 0);
rawPanel->pack_start (*vbPanelEnd[5], Gtk::PACK_SHRINK, 0);
toiU = Gtk::manage (new TextOrIcon ("wb-sun.png", M ("MAIN_TAB_CUSTOM"), M ("MAIN_TAB_CUSTOM_TOOLTIP")));
toiF = Gtk::manage (new TextOrIcon ("wb-sun.png", M ("MAIN_TAB_FAVOURITES"), M ("MAIN_TAB_FAVOURITES_TOOLTIP")));
toiE = Gtk::manage (new TextOrIcon ("exposure.png", M ("MAIN_TAB_EXPOSURE"), M ("MAIN_TAB_EXPOSURE_TOOLTIP")));
toiD = Gtk::manage (new TextOrIcon ("detail.png", M ("MAIN_TAB_DETAIL"), M ("MAIN_TAB_DETAIL_TOOLTIP")));
toiC = Gtk::manage (new TextOrIcon ("color-circles.png", M ("MAIN_TAB_COLOR"), M ("MAIN_TAB_COLOR_TOOLTIP")));
@@ -219,7 +219,7 @@ ToolPanelCoordinator::ToolPanelCoordinator (bool batch) : ipc (nullptr), hasChan
toiR = Gtk::manage (new TextOrIcon ("bayer.png", M ("MAIN_TAB_RAW"), M ("MAIN_TAB_RAW_TOOLTIP")));
toiM = Gtk::manage (new TextOrIcon ("metadata.png", M ("MAIN_TAB_METADATA"), M ("MAIN_TAB_METADATA_TOOLTIP")));
toolPanelNotebook->append_page (*userPanelSW, *toiU);
toolPanelNotebook->append_page (*favouritePanelSW, *toiF);
toolPanelNotebook->append_page (*exposurePanelSW, *toiE);
toolPanelNotebook->append_page (*detailsPanelSW, *toiD);
toolPanelNotebook->append_page (*colorPanelSW, *toiC);
@@ -262,15 +262,15 @@ void ToolPanelCoordinator::addPanel (Gtk::Box* where, FoldableToolPanel* panel,
toolPanels.push_back (panel);
}
void ToolPanelCoordinator::addUserPanel (Gtk::Box* where, FoldableToolPanel* panel)
void ToolPanelCoordinator::addfavouritePanel (Gtk::Box* where, FoldableToolPanel* panel, int level)
{
auto name = panel->getToolName();
auto it = std::find(options.userTools.begin(), options.userTools.end(), name);
if (it != options.userTools.end()) {
int index = std::distance(options.userTools.begin(), it);
userTools[index] = panel;
auto it = std::find(options.favourites.begin(), options.favourites.end(), name);
if (it != options.favourites.end()) {
int index = std::distance(options.favourites.begin(), it);
favourites[index] = panel;
} else {
addPanel(where, panel);
addPanel(where, panel, level);
}
}
@@ -879,6 +879,10 @@ bool ToolPanelCoordinator::handleShortcutKey (GdkEventKey* event)
if (alt) {
switch (event->keyval) {
case GDK_KEY_u:
toolPanelNotebook->set_current_page (toolPanelNotebook->page_num (*favouritePanelSW));
return true;
case GDK_KEY_e:
toolPanelNotebook->set_current_page (toolPanelNotebook->page_num (*exposurePanelSW));
return true;
@@ -916,7 +920,7 @@ void ToolPanelCoordinator::updateVScrollbars (bool hide)
{
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
Gtk::PolicyType policy = hide ? Gtk::POLICY_NEVER : Gtk::POLICY_AUTOMATIC;
userPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);
favouritePanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);
exposurePanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);
detailsPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);
colorPanelSW->set_policy (Gtk::POLICY_AUTOMATIC, policy);

View File

@@ -158,8 +158,8 @@ protected:
rtengine::StagedImageProcessor* ipc;
std::vector<ToolPanel*> toolPanels;
std::vector<FoldableToolPanel*> userTools;
ToolVBox* userPanel;
std::vector<FoldableToolPanel*> favourites;
ToolVBox* favouritePanel;
ToolVBox* exposurePanel;
ToolVBox* detailsPanel;
ToolVBox* colorPanel;
@@ -168,7 +168,7 @@ protected:
ToolVBox* advancedPanel;
ToolBar* toolBar;
TextOrIcon* toiU;
TextOrIcon* toiF;
TextOrIcon* toiE;
TextOrIcon* toiD;
TextOrIcon* toiC;
@@ -180,7 +180,7 @@ protected:
Gtk::Image* imgPanelEnd[7];
Gtk::VBox* vbPanelEnd[7];
Gtk::ScrolledWindow* userPanelSW;
Gtk::ScrolledWindow* favouritePanelSW;
Gtk::ScrolledWindow* exposurePanelSW;
Gtk::ScrolledWindow* detailsPanelSW;
Gtk::ScrolledWindow* colorPanelSW;
@@ -195,7 +195,7 @@ protected:
void addPanel (Gtk::Box* where, FoldableToolPanel* panel, int level = 1);
void foldThemAll (GdkEventButton* event);
void updateVScrollbars (bool hide);
void addUserPanel (Gtk::Box* where, FoldableToolPanel* panel);
void addfavouritePanel (Gtk::Box* where, FoldableToolPanel* panel, int level = 1);
private:
EditDataProvider *editDataProvider;