From issue #3446: remove the "Use system theme" option + slight rework

of the Preferences general panel.
This commit is contained in:
Hombre
2016-11-17 01:50:03 +01:00
parent 8801570693
commit 0ab931c287
7 changed files with 16 additions and 58 deletions

View File

@@ -307,7 +307,7 @@ int main(int argc, char **argv)
Glib::RefPtr<Gdk::Screen> screen = Gdk::Screen::get_default();
if (!options.useSystemTheme && screen) {
if (screen) {
Gtk::Settings::get_for_screen(screen)->property_gtk_theme_name() = "Adwaita";
Gtk::Settings::get_for_screen(screen)->property_gtk_application_prefer_dark_theme() = true;

View File

@@ -373,7 +373,6 @@ void Options::setDefaults ()
lastSaveAsPath = "";
overwriteOutputFile = false; // if TRUE, existing output JPGs/PNGs are overwritten, instead of adding ..-1.jpg, -2.jpg etc.
theme = "RawTherapee";
useSystemTheme = false;
maxThumbnailHeight = 250;
maxCacheEntries = 20000;
thumbInterp = 1;
@@ -791,10 +790,6 @@ int Options::readFromFile (Glib::ustring fname)
theme = keyFile.get_string ("General", "Theme");
}
if (keyFile.has_key ("General", "UseSystemTheme")) {
useSystemTheme = keyFile.get_boolean ("General", "UseSystemTheme");
}
if ( keyFile.has_key ("General", "DarkFramesPath")) {
rtSettings.darkFramesPath = keyFile.get_string ("General", "DarkFramesPath");
}
@@ -1836,7 +1831,6 @@ int Options::saveToFile (Glib::ustring fname)
keyFile.set_string ("General", "Language", language);
keyFile.set_boolean ("General", "LanguageAutoDetect", languageAutoDetect);
keyFile.set_string ("General", "Theme", theme);
keyFile.set_boolean ("General", "UseSystemTheme", useSystemTheme);
keyFile.set_string ("General", "Version", VERSION);
keyFile.set_string ("General", "DarkFramesPath", rtSettings.darkFramesPath);
keyFile.set_string ("General", "FlatFieldsPath", rtSettings.flatFieldsPath);

View File

@@ -160,7 +160,6 @@ public:
Glib::ustring language;
bool languageAutoDetect;
Glib::ustring theme;
bool useSystemTheme;
static Glib::ustring cacheBaseDir;
bool autoSuffix;
bool forceFormatOpts;

View File

@@ -824,9 +824,9 @@ Gtk::Widget* Preferences::getGeneralPanel ()
workflowGrid->attach_next_to(*ckbHistogramWorking, *curveBBoxPosC, Gtk::POS_BOTTOM, 2, 1);
ckbFileBrowserToolbarSingleRow = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_FILEBROWSERTOOLBARSINGLEROW")) );
setExpandAlignProperties(ckbFileBrowserToolbarSingleRow, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
setExpandAlignProperties(ckbFileBrowserToolbarSingleRow, false, false, Gtk::ALIGN_START, Gtk::ALIGN_START);
ckbShowFilmStripToolBar = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_SHOWFILMSTRIPTOOLBAR")) );
setExpandAlignProperties(ckbShowFilmStripToolBar, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
setExpandAlignProperties(ckbShowFilmStripToolBar, false, false, Gtk::ALIGN_START, Gtk::ALIGN_START);
workflowGrid->attach_next_to(*ckbFileBrowserToolbarSingleRow, *ckbHistogramPositionLeft, Gtk::POS_BOTTOM, 1, 1);
workflowGrid->attach_next_to(*ckbShowFilmStripToolBar, *ckbHistogramWorking, Gtk::POS_BOTTOM, 2, 1);
@@ -858,7 +858,7 @@ Gtk::Widget* Preferences::getGeneralPanel ()
Gtk::Label* langlab = Gtk::manage( new Gtk::Label (M("PREFERENCES_SELECTLANG") + ":") );
setExpandAlignProperties(langlab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
languages = Gtk::manage( new Gtk::ComboBoxText () );
setExpandAlignProperties(languages, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE);
setExpandAlignProperties(languages, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
std::vector<Glib::ustring> langs;
parseDir (argv0 + "/languages", langs, "");
@@ -871,8 +871,8 @@ Gtk::Widget* Preferences::getGeneralPanel ()
Gtk::Label* langw = Gtk::manage( new Gtk::Label (Glib::ustring(" (") + M("PREFERENCES_APPLNEXTSTARTUP") + ")") );
setExpandAlignProperties(langw, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
langGrid->attach_next_to(*ckbLangAutoDetect, Gtk::POS_LEFT, 1, 1);
langGrid->attach_next_to(*langlab, *ckbLangAutoDetect, Gtk::POS_RIGHT, 1, 1);
langGrid->attach_next_to(*ckbLangAutoDetect, Gtk::POS_LEFT, 3, 1);
langGrid->attach_next_to(*langlab, *ckbLangAutoDetect, Gtk::POS_BOTTOM, 1, 1);
langGrid->attach_next_to(*languages, *langlab, Gtk::POS_RIGHT, 1, 1);
langGrid->attach_next_to(*langw, *languages, Gtk::POS_RIGHT, 1, 1);
flang->add (*langGrid);
@@ -887,14 +887,10 @@ Gtk::Widget* Preferences::getGeneralPanel ()
themeGrid->set_row_spacing(4);
setExpandAlignProperties(themeGrid, false, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
chUseSystemTheme = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_USESYSTEMTHEME")+" ("+ M("PREFERENCES_APPLNEXTSTARTUP") + ")") );
setExpandAlignProperties(chUseSystemTheme, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
themeGrid->attach_next_to(*chUseSystemTheme, Gtk::POS_LEFT, 2, 1);
Gtk::Label* themelab = Gtk::manage( new Gtk::Label (M("PREFERENCES_SELECTTHEME") + ":") );
setExpandAlignProperties(themelab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
theme = Gtk::manage( new Gtk::ComboBoxText () );
setExpandAlignProperties(theme, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE);
setExpandAlignProperties(theme, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
theme->set_active (0);
std::vector<Glib::ustring> themes;
@@ -904,37 +900,24 @@ Gtk::Widget* Preferences::getGeneralPanel ()
theme->append (themes[i]);
}
Gtk::Label* fontlab = Gtk::manage( new Gtk::Label (M("PREFERENCES_SELECTFONT") + ":") );
setExpandAlignProperties(fontlab, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
themeGrid->attach_next_to(*themelab, *chUseSystemTheme, Gtk::POS_BOTTOM, 1, 1);
themeGrid->attach_next_to(*themelab, Gtk::POS_LEFT, 1, 1);
themeGrid->attach_next_to(*theme, *themelab, Gtk::POS_RIGHT, 1, 1);
themeGrid->attach_next_to(*fontlab, *theme, Gtk::POS_RIGHT, 1, 1);
Gtk::Grid* cropcolorGrid = Gtk::manage( new Gtk::Grid () );
cropcolorGrid->set_column_spacing(4);
cropcolorGrid->set_row_spacing(4);
Gtk::Label* cutOverlayLabel = Gtk::manage( new Gtk::Label (M("PREFERENCES_CUTOVERLAYBRUSH") + ":") );
setExpandAlignProperties(cutOverlayLabel, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
butCropCol = Gtk::manage( new Gtk::ColorButton() );
setExpandAlignProperties(butCropCol, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER);
butCropCol->set_use_alpha(true);
cropcolorGrid->attach_next_to(*cutOverlayLabel, Gtk::POS_LEFT, 1, 1);
cropcolorGrid->attach_next_to(*butCropCol, *cutOverlayLabel, Gtk::POS_RIGHT, 1, 1);
themeGrid->attach_next_to(*cutOverlayLabel, *themelab, Gtk::POS_BOTTOM, 1, 1);
themeGrid->attach_next_to(*butCropCol, *cutOverlayLabel, Gtk::POS_RIGHT, 1, 1);
Gtk::Grid* navguidecolGrid = Gtk::manage( new Gtk::Grid () );
navguidecolGrid->set_column_spacing(4);
navguidecolGrid->set_row_spacing(4);
Gtk::Label* navGuideLabel = Gtk::manage( new Gtk::Label (M("PREFERENCES_NAVGUIDEBRUSH") + ":") );
setExpandAlignProperties(navGuideLabel, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
butNavGuideCol = Gtk::manage( new Gtk::ColorButton() );
setExpandAlignProperties(butNavGuideCol, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER);
butNavGuideCol->set_use_alpha(true);
navguidecolGrid->attach_next_to(*navGuideLabel, Gtk::POS_LEFT, 1, 1);
navguidecolGrid->attach_next_to(*butNavGuideCol, *navGuideLabel, Gtk::POS_RIGHT, 1, 1);
themeGrid->attach_next_to(*cropcolorGrid, *themelab, Gtk::POS_BOTTOM, 2, 1);
themeGrid->attach_next_to(*navguidecolGrid, *cropcolorGrid, Gtk::POS_RIGHT, 2, 1);
themeGrid->attach_next_to(*navGuideLabel, *butCropCol, Gtk::POS_RIGHT, 1, 1);
themeGrid->attach_next_to(*butNavGuideCol, *navGuideLabel, Gtk::POS_RIGHT, 1, 1);
ftheme->add (*themeGrid);
mvbsd->attach_next_to(*ftheme, *flang, Gtk::POS_BOTTOM, 2, 1);
@@ -979,12 +962,12 @@ Gtk::Widget* Preferences::getGeneralPanel ()
Gtk::Grid* navigationGrid = Gtk::manage( new Gtk::Grid() );
navigationGrid->set_column_spacing(4);
navigationGrid->set_row_spacing(4);
setExpandAlignProperties(fclip, false, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
setExpandAlignProperties(fclip, false, false, Gtk::ALIGN_START, Gtk::ALIGN_FILL);
Gtk::Label* panFactorLabel = Gtk::manage( new Gtk::Label (M("PREFERENCES_PANFACTORLABEL") + ":", Gtk::ALIGN_START));
setExpandAlignProperties(panFactorLabel, true, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
setExpandAlignProperties(panFactorLabel, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
panFactor = Gtk::manage( new Gtk::SpinButton () );
setExpandAlignProperties(panFactor, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE);
setExpandAlignProperties(panFactor, true, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE);
panFactor->set_digits (0);
panFactor->set_increments (1, 5);
panFactor->set_range (1, 10);
@@ -1065,7 +1048,6 @@ Gtk::Widget* Preferences::getGeneralPanel ()
langAutoDetectConn = ckbLangAutoDetect->signal_toggled().connect (sigc::mem_fun(*this, &Preferences::langAutoDetectToggled));
tconn = theme->signal_changed().connect( sigc::mem_fun(*this, &Preferences::themeChanged) );
usethcon = chUseSystemTheme->signal_clicked ().connect( sigc::mem_fun(*this, &Preferences::useThemeChanged) );
return mvbsd;
}
@@ -1388,7 +1370,6 @@ void Preferences::storePreferences ()
moptions.language = languages->get_active_text ();
moptions.languageAutoDetect = ckbLangAutoDetect->get_active ();
moptions.theme = theme->get_active_text ();
moptions.useSystemTheme = chUseSystemTheme->get_active ();
Gdk::RGBA cropCol = butCropCol->get_rgba();
moptions.cutOverlayBrush[0] = cropCol.get_red();
@@ -1605,7 +1586,6 @@ void Preferences::fillPreferences ()
languages->set_active_text (moptions.language);
ckbLangAutoDetect->set_active (moptions.languageAutoDetect);
theme->set_active_text (moptions.theme);
chUseSystemTheme->set_active(moptions.useSystemTheme);
Gdk::RGBA cropCol;
cropCol.set_rgba(moptions.cutOverlayBrush[0], moptions.cutOverlayBrush[1], moptions.cutOverlayBrush[2]);
@@ -1851,7 +1831,6 @@ void Preferences::themeChanged ()
{
moptions.theme = theme->get_active_text ();
moptions.useSystemTheme = chUseSystemTheme->get_active ();
RTImage::setPaths(moptions);
RTImage::updateImages();
switchThemeTo(theme->get_active_text ());
@@ -2041,16 +2020,6 @@ void Preferences::workflowUpdate ()
}
void Preferences::useThemeChanged()
{
if(!chUseSystemTheme->get_active()) {
theme->set_sensitive(true);
} else {
theme->set_sensitive(false);
}
}
void Preferences::addExtPressed ()
{

View File

@@ -128,7 +128,6 @@ protected:
Gtk::ComboBoxText* curveBBoxPosC;
Gtk::ComboBoxText* theme;
Gtk::CheckButton* chUseSystemTheme;
Gtk::ColorButton* butCropCol;
Gtk::ColorButton* butNavGuideCol;
@@ -191,7 +190,7 @@ protected:
Glib::ustring storedValueImg;
Options moptions;
sigc::connection tconn, sconn, usethcon, addc, setc, dfconn, ffconn, bpconn, rpconn, ipconn;
sigc::connection tconn, sconn, addc, setc, dfconn, ffconn, bpconn, rpconn, ipconn;
sigc::connection autoMonProfileConn, sndEnableConn, langAutoDetectConn, autocielabConn;
Glib::ustring initialTheme;
Glib::ustring initialFont;
@@ -203,7 +202,6 @@ protected:
void updateFFinfos ();
void workflowUpdate();
void themeChanged ();
void useThemeChanged();
void forRAWComboChanged ();
void forImageComboChanged ();
void layoutComboChanged ();