merge with dev

This commit is contained in:
Desmis
2017-03-17 09:03:56 +01:00
4 changed files with 90 additions and 34 deletions

View File

@@ -115,6 +115,8 @@ BatchQueuePanel::BatchQueuePanel (FileCatalog* aFileCatalog)
if (Glib::file_test (options.savePathFolder, Glib::FILE_TEST_IS_DIR)) { if (Glib::file_test (options.savePathFolder, Glib::FILE_TEST_IS_DIR)) {
outdirFolder->set_current_folder (options.savePathFolder); outdirFolder->set_current_folder (options.savePathFolder);
} else {
outdirFolder->set_current_folder (Glib::get_home_dir());
} }
outdirFolderButton = 0; outdirFolderButton = 0;

View File

@@ -41,6 +41,8 @@ Preferences::Preferences (RTWindow *rtwindow)
, rprofiles (nullptr) , rprofiles (nullptr)
, iprofiles (nullptr) , iprofiles (nullptr)
, parent (rtwindow) , parent (rtwindow)
, newFont (false)
, newCPFont (false)
{ {
regex = Glib::Regex::create (THEMEREGEXSTR, Glib::RegexCompileFlags::REGEX_CASELESS); regex = Glib::Regex::create (THEMEREGEXSTR, Glib::RegexCompileFlags::REGEX_CASELESS);
@@ -56,6 +58,10 @@ Preferences::Preferences (RTWindow *rtwindow)
set_size_request (650, -1); set_size_request (650, -1);
set_default_size (options.preferencesWidth, options.preferencesHeight); set_default_size (options.preferencesWidth, options.preferencesHeight);
Pango::FontDescription defaultFont = get_style_context ()->get_font();
initialFontFamily = defaultFont.get_family ();
initialFontSize = defaultFont.get_size () / Pango::SCALE;
Gtk::Box* mainBox = get_content_area (); Gtk::Box* mainBox = get_content_area ();
//GTK318 //GTK318
#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 #if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20
@@ -1090,7 +1096,12 @@ Gtk::Widget* Preferences::getGeneralPanel ()
fontButton = Gtk::manage ( new Gtk::FontButton ()); fontButton = Gtk::manage ( new Gtk::FontButton ());
setExpandAlignProperties (fontButton, false, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); setExpandAlignProperties (fontButton, false, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE);
fontButton->set_use_size (true); fontButton->set_use_size (true);
fontButton->set_font_name (Glib::ustring::compose ("%1 %2", options.fontFamily == "default" ? "sans" : options.fontFamily, options.fontSize));
if (options.fontFamily == "default") {
fontButton->set_font_name (Glib::ustring::compose ("%1 %2", initialFontFamily, initialFontSize));
} else {
fontButton->set_font_name (Glib::ustring::compose ("%1 %2", options.fontFamily, options.fontSize));
}
themeGrid->attach_next_to (*fontlab, *theme, Gtk::POS_RIGHT, 1, 1); themeGrid->attach_next_to (*fontlab, *theme, Gtk::POS_RIGHT, 1, 1);
themeGrid->attach_next_to (*fontButton, *fontlab, Gtk::POS_RIGHT, 1, 1); themeGrid->attach_next_to (*fontButton, *fontlab, Gtk::POS_RIGHT, 1, 1);
@@ -1100,7 +1111,12 @@ Gtk::Widget* Preferences::getGeneralPanel ()
colorPickerFontButton = Gtk::manage ( new Gtk::FontButton ()); colorPickerFontButton = Gtk::manage ( new Gtk::FontButton ());
setExpandAlignProperties (fontButton, false, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); setExpandAlignProperties (fontButton, false, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE);
colorPickerFontButton->set_use_size (true); colorPickerFontButton->set_use_size (true);
colorPickerFontButton->set_font_name (Glib::ustring::compose ("%1 %2", options.CPFontFamily == "default" ? "sans" : options.CPFontFamily, options.CPFontSize));
if (options.fontFamily == "default") {
colorPickerFontButton->set_font_name (Glib::ustring::compose ("%1 %2", initialFontFamily, initialFontSize));
} else {
colorPickerFontButton->set_font_name (Glib::ustring::compose ("%1 %2", options.CPFontFamily, options.CPFontSize));
}
themeGrid->attach_next_to (*cpfontlab, *fontButton, Gtk::POS_RIGHT, 1, 1); themeGrid->attach_next_to (*cpfontlab, *fontButton, Gtk::POS_RIGHT, 1, 1);
themeGrid->attach_next_to (*colorPickerFontButton, *cpfontlab, Gtk::POS_RIGHT, 1, 1); themeGrid->attach_next_to (*colorPickerFontButton, *cpfontlab, Gtk::POS_RIGHT, 1, 1);
@@ -1120,6 +1136,7 @@ Gtk::Widget* Preferences::getGeneralPanel ()
butNavGuideCol->set_use_alpha (true); butNavGuideCol->set_use_alpha (true);
themeGrid->attach_next_to (*navGuideLabel, *butCropCol, Gtk::POS_RIGHT, 2, 1); themeGrid->attach_next_to (*navGuideLabel, *butCropCol, Gtk::POS_RIGHT, 2, 1);
themeGrid->attach_next_to (*butNavGuideCol, *navGuideLabel, Gtk::POS_RIGHT, 1, 1); themeGrid->attach_next_to (*butNavGuideCol, *navGuideLabel, Gtk::POS_RIGHT, 1, 1);
//>>>>>>> dev
ftheme->add (*themeGrid); ftheme->add (*themeGrid);
mvbsd->attach_next_to (*ftheme, *flang, Gtk::POS_BOTTOM, 2, 1); mvbsd->attach_next_to (*ftheme, *flang, Gtk::POS_BOTTOM, 2, 1);
@@ -1247,10 +1264,10 @@ Gtk::Widget* Preferences::getGeneralPanel ()
fdg->add (*externaleditorGrid); fdg->add (*externaleditorGrid);
mvbsd->attach_next_to (*fdg, *fclip, Gtk::POS_BOTTOM, 2, 1); mvbsd->attach_next_to (*fdg, *fclip, Gtk::POS_BOTTOM, 2, 1);
langAutoDetectConn = ckbLangAutoDetect->signal_toggled().connect (sigc::mem_fun (*this, &Preferences::langAutoDetectToggled)); langAutoDetectConn = ckbLangAutoDetect->signal_toggled().connect (sigc::mem_fun (*this, &Preferences::langAutoDetectToggled));
tconn = theme->signal_changed().connect ( sigc::mem_fun (*this, &Preferences::themeChanged) ); tconn = theme->signal_changed().connect ( sigc::mem_fun (*this, &Preferences::themeChanged) );
fconn = fontButton->signal_font_set().connect ( sigc::mem_fun (*this, &Preferences::fontChanged) ); fconn = fontButton->signal_font_set().connect ( sigc::mem_fun (*this, &Preferences::fontChanged) );
cpfconn = colorPickerFontButton->signal_font_set().connect ( sigc::mem_fun (*this, &Preferences::cpFontChanged) );
return mvbsd; return mvbsd;
} }
@@ -1645,14 +1662,19 @@ void Preferences::storePreferences ()
moptions.navGuideBrush[1] = NavGuideCol.get_green(); moptions.navGuideBrush[1] = NavGuideCol.get_green();
moptions.navGuideBrush[2] = NavGuideCol.get_blue(); moptions.navGuideBrush[2] = NavGuideCol.get_blue();
moptions.navGuideBrush[3] = butNavGuideCol->get_alpha() / 65535.0; moptions.navGuideBrush[3] = butNavGuideCol->get_alpha() / 65535.0;
Pango::FontDescription fd (fontButton->get_font_name()); Pango::FontDescription fd (fontButton->get_font_name());
moptions.fontFamily = fd.get_family();
moptions.fontSize = fd.get_size() / Pango::SCALE; if (newFont) {
moptions.fontFamily = fd.get_family();
moptions.fontSize = fd.get_size() / Pango::SCALE;
}
Pango::FontDescription cpfd (colorPickerFontButton->get_font_name()); Pango::FontDescription cpfd (colorPickerFontButton->get_font_name());
moptions.CPFontFamily = cpfd.get_family();
moptions.CPFontSize = cpfd.get_size() / Pango::SCALE; if (newCPFont) {
moptions.CPFontFamily = cpfd.get_family();
moptions.CPFontSize = cpfd.get_size() / Pango::SCALE;
}
#ifdef WIN32 #ifdef WIN32
moptions.gimpDir = gimpDir->get_filename (); moptions.gimpDir = gimpDir->get_filename ();
@@ -1834,6 +1856,7 @@ void Preferences::fillPreferences ()
tconn.block (true); tconn.block (true);
fconn.block (true); fconn.block (true);
cpfconn.block (true);
sconn.block (true); sconn.block (true);
dfconn.block (true); dfconn.block (true);
ffconn.block (true); ffconn.block (true);
@@ -1928,8 +1951,17 @@ void Preferences::fillPreferences ()
butNavGuideCol->set_rgba (NavGuideCol); butNavGuideCol->set_rgba (NavGuideCol);
butNavGuideCol->set_alpha ( (unsigned short) (moptions.navGuideBrush[3] * 65535.0)); butNavGuideCol->set_alpha ( (unsigned short) (moptions.navGuideBrush[3] * 65535.0));
fontButton->set_font_name (Glib::ustring::compose ("%1 %2", options.fontFamily == "default" ? "sans" : options.fontFamily, options.fontSize)); if (options.fontFamily == "default") {
colorPickerFontButton->set_font_name (Glib::ustring::compose ("%1 %2", options.CPFontFamily == "default" ? "sans" : options.CPFontFamily, options.CPFontSize)); fontButton->set_font_name (Glib::ustring::compose ("%1 %2", initialFontFamily, initialFontSize));
} else {
fontButton->set_font_name (Glib::ustring::compose ("%1 %2", options.fontFamily, options.fontSize));
}
if (options.CPFontFamily == "default") {
colorPickerFontButton->set_font_name (Glib::ustring::compose ("%1 %2", initialFontFamily, initialFontSize));
} else {
colorPickerFontButton->set_font_name (Glib::ustring::compose ("%1 %2", options.CPFontFamily, options.CPFontSize));
}
showDateTime->set_active (moptions.fbShowDateTime); showDateTime->set_active (moptions.fbShowDateTime);
showBasicExif->set_active (moptions.fbShowBasicExif); showBasicExif->set_active (moptions.fbShowBasicExif);
@@ -1951,13 +1983,13 @@ void Preferences::fillPreferences ()
if (Glib::file_test (moptions.gimpDir, Glib::FILE_TEST_IS_DIR)) { if (Glib::file_test (moptions.gimpDir, Glib::FILE_TEST_IS_DIR)) {
gimpDir->set_current_folder (moptions.gimpDir); gimpDir->set_current_folder (moptions.gimpDir);
} else { } else {
gimpDir->set_current_folder (""); gimpDir->set_current_folder (Glib::get_home_dir());
} }
if (Glib::file_test (moptions.psDir, Glib::FILE_TEST_IS_DIR)) { if (Glib::file_test (moptions.psDir, Glib::FILE_TEST_IS_DIR)) {
psDir->set_current_folder (moptions.psDir); psDir->set_current_folder (moptions.psDir);
} else { } else {
psDir->set_current_folder (""); psDir->set_current_folder (Glib::get_home_dir());
} }
#elif defined __APPLE__ #elif defined __APPLE__
@@ -1965,6 +1997,8 @@ void Preferences::fillPreferences ()
if (Glib::file_test (moptions.psDir, Glib::FILE_TEST_IS_DIR)) { if (Glib::file_test (moptions.psDir, Glib::FILE_TEST_IS_DIR)) {
psDir->set_current_folder (moptions.psDir); psDir->set_current_folder (moptions.psDir);
} else {
psDir->set_current_folder (Glib::get_home_dir());
} }
#endif #endif
@@ -2051,6 +2085,7 @@ void Preferences::fillPreferences ()
addc.block (false); addc.block (false);
setc.block (false); setc.block (false);
cpfconn.block (false);
fconn.block (false); fconn.block (false);
tconn.block (false); tconn.block (false);
sconn.block (false); sconn.block (false);
@@ -2134,7 +2169,11 @@ void Preferences::cancelPressed ()
Pango::FontDescription fd (fontButton->get_font_name()); Pango::FontDescription fd (fontButton->get_font_name());
if (fd.get_family() != options.fontFamily && (fd.get_size() / Pango::SCALE) != options.fontSize) { if (fd.get_family() != options.fontFamily && (fd.get_size() / Pango::SCALE) != options.fontSize) {
switchFontTo (options.fontFamily == "default" ? "sans" : options.fontFamily, options.fontSize); if (options.fontFamily == "default") {
switchFontTo (initialFontFamily, initialFontSize);
} else {
switchFontTo (options.fontFamily, options.fontSize);
}
} }
// update the profileStore // update the profileStore
@@ -2331,11 +2370,17 @@ void Preferences::switchThemeTo (Glib::ustring newTheme)
void Preferences::fontChanged () void Preferences::fontChanged ()
{ {
newFont = true;
Pango::FontDescription fd (fontButton->get_font_name()); Pango::FontDescription fd (fontButton->get_font_name());
switchFontTo (fd.get_family(), fd.get_size() / Pango::SCALE); switchFontTo (fd.get_family(), fd.get_size() / Pango::SCALE);
} }
void Preferences::cpFontChanged ()
{
newCPFont = true;
}
void Preferences::switchFontTo (const Glib::ustring &newFontFamily, const int newFontSize) void Preferences::switchFontTo (const Glib::ustring &newFontFamily, const int newFontSize)
{ {
@@ -2359,6 +2404,12 @@ void Preferences::switchFontTo (const Glib::ustring &newFontFamily, const int ne
} catch (...) { } catch (...) {
printf ("Error: Can't find the font named \"%s\"\n", newFontFamily.c_str()); printf ("Error: Can't find the font named \"%s\"\n", newFontFamily.c_str());
} }
} else {
if (fontcss) {
fontcss = Gtk::CssProvider::create();
Glib::RefPtr<Gdk::Screen> screen = Gdk::Screen::get_default();
Gtk::StyleContext::remove_provider_for_screen (screen, fontcss);
}
} }
} }

View File

@@ -211,10 +211,13 @@ class Preferences : public Gtk::Dialog, public ProfileStoreListener
Glib::ustring storedValueImg; Glib::ustring storedValueImg;
Options moptions; Options moptions;
sigc::connection tconn, sconn, fconn, addc, setc, dfconn, ffconn, bpconn, rpconn, ipconn; sigc::connection tconn, sconn, fconn, cpfconn, addc, setc, dfconn, ffconn, bpconn, rpconn, ipconn;
sigc::connection autoMonProfileConn, sndEnableConn, langAutoDetectConn, autocielabConn; sigc::connection autoMonProfileConn, sndEnableConn, langAutoDetectConn, autocielabConn;
Glib::ustring initialTheme; Glib::ustring initialTheme;
Glib::ustring initialFont; Glib::ustring initialFontFamily;
int initialFontSize;
bool newFont;
bool newCPFont;
void fillPreferences (); void fillPreferences ();
void storePreferences (); void storePreferences ();
@@ -225,6 +228,7 @@ class Preferences : public Gtk::Dialog, public ProfileStoreListener
void workflowUpdate(); void workflowUpdate();
void themeChanged (); void themeChanged ();
void fontChanged (); void fontChanged ();
void cpFontChanged ();
void forRAWComboChanged (); void forRAWComboChanged ();
void forImageComboChanged (); void forImageComboChanged ();
void layoutComboChanged (); void layoutComboChanged ();

View File

@@ -172,8 +172,7 @@ Wavelet::Wavelet() :
enableFinalConn = expfinal->signal_enabled_toggled().connect ( sigc::bind( sigc::mem_fun(this, &Wavelet::enableToggled), expfinal) ); enableFinalConn = expfinal->signal_enabled_toggled().connect ( sigc::bind( sigc::mem_fun(this, &Wavelet::enableToggled), expfinal) );
// Wavelet Settings // Wavelet Settings
Gtk::VBox* const settingsVBox = Gtk::manage(new Gtk::VBox()); ToolParamBlock* const settingsBox = Gtk::manage (new ToolParamBlock());
settingsVBox->set_spacing(2);
strength->setAdjusterListener (this); strength->setAdjusterListener (this);
@@ -247,16 +246,16 @@ Wavelet::Wavelet() :
levdirSubHBox->pack_start(*Lmethod); levdirSubHBox->pack_start(*Lmethod);
levdirSubHBox->pack_start(*Dirmethod, Gtk::PACK_EXPAND_WIDGET, 2); // same, but 2 not 4? levdirSubHBox->pack_start(*Dirmethod, Gtk::PACK_EXPAND_WIDGET, 2); // same, but 2 not 4?
settingsVBox->pack_start(*strength); settingsBox->pack_start(*strength);
settingsVBox->pack_start(*thres); settingsBox->pack_start(*thres);
settingsVBox->pack_start(*tilesizeHBox); settingsBox->pack_start(*tilesizeHBox);
settingsVBox->pack_start(*daubcoeffHBox); settingsBox->pack_start(*daubcoeffHBox);
settingsVBox->pack_start(*backgroundHBox); settingsBox->pack_start(*backgroundHBox);
settingsVBox->pack_start(*levdirMainHBox); settingsBox->pack_start(*levdirMainHBox);
settingsVBox->pack_start(*levdirSubHBox); settingsBox->pack_start(*levdirSubHBox);
// Contrast // Contrast
Gtk::VBox* const levBox = Gtk::manage (new ToolParamBlock()); ToolParamBlock* const levBox = Gtk::manage (new ToolParamBlock());
Gtk::HBox* const buttonBox = Gtk::manage (new Gtk::HBox(true, 10)); Gtk::HBox* const buttonBox = Gtk::manage (new Gtk::HBox(true, 10));
levBox->pack_start(*buttonBox, Gtk::PACK_SHRINK, 2); levBox->pack_start(*buttonBox, Gtk::PACK_SHRINK, 2);
@@ -335,7 +334,7 @@ Wavelet::Wavelet() :
levBox->pack_start(*contrastSHFrame); levBox->pack_start(*contrastSHFrame);
// Chromaticity // Chromaticity
Gtk::VBox* const chBox = Gtk::manage (new ToolParamBlock()); ToolParamBlock* const chBox = Gtk::manage (new ToolParamBlock());
Gtk::Label* const labmch = Gtk::manage(new Gtk::Label(M("TP_WAVELET_CHTYPE") + ":")); Gtk::Label* const labmch = Gtk::manage(new Gtk::Label(M("TP_WAVELET_CHTYPE") + ":"));
Gtk::HBox* const ctboxch = Gtk::manage(new Gtk::HBox()); Gtk::HBox* const ctboxch = Gtk::manage(new Gtk::HBox());
@@ -405,7 +404,7 @@ Wavelet::Wavelet() :
} }
// Toning // Toning
Gtk::VBox* const tonBox = Gtk::manage (new ToolParamBlock()); ToolParamBlock* const tonBox = Gtk::manage (new ToolParamBlock());
opaCurveEditorG->setCurveListener (this); opaCurveEditorG->setCurveListener (this);
@@ -434,7 +433,7 @@ Wavelet::Wavelet() :
tonBox->pack_start( *opacityCurveEditorG, Gtk::PACK_SHRINK, 2); tonBox->pack_start( *opacityCurveEditorG, Gtk::PACK_SHRINK, 2);
// Denoise and Refine // Denoise and Refine
Gtk::VBox* const noiseBox = Gtk::manage (new ToolParamBlock()); ToolParamBlock* const noiseBox = Gtk::manage (new ToolParamBlock());
linkedg->set_active (true); linkedg->set_active (true);
linkedgConn = linkedg->signal_toggled().connect( sigc::mem_fun(*this, &Wavelet::linkedgToggled) ); linkedgConn = linkedg->signal_toggled().connect( sigc::mem_fun(*this, &Wavelet::linkedgToggled) );
@@ -458,7 +457,7 @@ Wavelet::Wavelet() :
noiseBox->pack_start( *level3noise, Gtk::PACK_SHRINK, 0); noiseBox->pack_start( *level3noise, Gtk::PACK_SHRINK, 0);
// Edge Sharpness // Edge Sharpness
Gtk::VBox* const edgBox = Gtk::manage (new ToolParamBlock()); ToolParamBlock* const edgBox = Gtk::manage (new ToolParamBlock());
edgval->setAdjusterListener(this); edgval->setAdjusterListener(this);
edgBox->pack_start(*edgval); edgBox->pack_start(*edgval);
@@ -571,7 +570,7 @@ Wavelet::Wavelet() :
edgBox->pack_start(*ctboxES); edgBox->pack_start(*ctboxES);
// Gamut // Gamut
Gtk::VBox* const conBox = Gtk::manage (new ToolParamBlock()); ToolParamBlock* const conBox = Gtk::manage (new ToolParamBlock());
median->set_active (true); median->set_active (true);
medianConn = median->signal_toggled().connect( sigc::mem_fun(*this, &Wavelet::medianToggled) ); medianConn = median->signal_toggled().connect( sigc::mem_fun(*this, &Wavelet::medianToggled) );
@@ -621,7 +620,7 @@ Wavelet::Wavelet() :
conBox->pack_start(*avoid); conBox->pack_start(*avoid);
// Residual Image // Residual Image
Gtk::VBox* const resBox = Gtk::manage (new ToolParamBlock()); ToolParamBlock* const resBox = Gtk::manage (new ToolParamBlock());
rescon->setAdjusterListener (this); rescon->setAdjusterListener (this);
resBox->pack_start(*rescon, Gtk::PACK_SHRINK); resBox->pack_start(*rescon, Gtk::PACK_SHRINK);
@@ -822,7 +821,7 @@ Wavelet::Wavelet() :
tmr->set_tooltip_text (M("TP_WAVELET_BALCHRO_TOOLTIP")); tmr->set_tooltip_text (M("TP_WAVELET_BALCHRO_TOOLTIP"));
tmrConn = tmr->signal_toggled().connect( sigc::mem_fun(*this, &Wavelet::tmrToggled) ); tmrConn = tmr->signal_toggled().connect( sigc::mem_fun(*this, &Wavelet::tmrToggled) );
Gtk::VBox* const finalBox = Gtk::manage (new ToolParamBlock()); ToolParamBlock* const finalBox = Gtk::manage (new ToolParamBlock());
finalBox->pack_start (*ctboxBA); finalBox->pack_start (*ctboxBA);
finalBox->pack_start(*balance); finalBox->pack_start(*balance);
@@ -839,7 +838,7 @@ Wavelet::Wavelet() :
//----------------------------- //-----------------------------
expsettings->add(*settingsVBox); expsettings->add(*settingsBox);
expsettings->setLevel(2); expsettings->setLevel(2);
pack_start (*expsettings); pack_start (*expsettings);