diff --git a/rtdata/themes/RawTherapee.css b/rtdata/themes/RawTherapee.css index e6eac9793..7e111a92d 100644 --- a/rtdata/themes/RawTherapee.css +++ b/rtdata/themes/RawTherapee.css @@ -41,7 +41,7 @@ background-color: #404040; } -GtkBox { +box { border-width: 0; border-style: none; border-radius: 0; @@ -49,7 +49,7 @@ GtkBox { padding: 0; } -GtkGrid { +grid { margin: 2px; padding: 0; border-width: 0; @@ -58,7 +58,7 @@ GtkGrid { } /* Affects all frames except in the toolbox */ -GtkFrame { +frame { border-width: 0; border-color: #303030; border-radius: 0; @@ -67,7 +67,7 @@ GtkFrame { padding: 4px; } -GtkFrame > GtkLabel { +frame > label { color: #D8D8D8; } @@ -77,21 +77,46 @@ GtkFrame > GtkLabel { } /* Frames in Preferences */ -#PrefNotebook GtkFrame { +#PrefNotebook frame { background-color: #3B3B3B; border: 1px solid #505050; border-radius: 4px; } /* Frames in the toolbox. Not MyExpander frames. */ -GtkEventBox .frame { +eventbox .frame { border-color: #565656; } +window { + padding: 0; +} + +button { + padding: 0; + min-height: 5px; + min-width: 5px; +} + +box { + padding: 0; + margin: 1px; + min-height: 5px; + min-width: 5px; +} + +scale { + padding: 0; + min-height: 5px; +} + /*.EditorTopPanel .button, .ToolBarPanelFileBrowser .button, .EditorZoomPanel .button {*/ .button { padding: 1px; margin: 1px; + padding: 0; + min-height: 5px; + min-width: 5px; } /* Adjusters */ @@ -108,39 +133,42 @@ GtkEventBox .frame { color: #363636; } -GtkProgressBar { - -GtkProgressBar-min-vertical-bar-width: 10; - -GtkProgressBar-min-horizontal-bar-height: 10; +progressbar.vertical { + min-width: 10px; } -GtkDrawingArea { +progressbar.horizontal { + min-height: 10px; +} + +drawingarea { border-radius: 0; background-color: #363636; border: 1px solid #252525; } -GtkDrawingArea:selected { +drawingarea:selected { background-color: #565656; border-radius: 10px; } -GtkImage { +image { padding: 1px; } /* Vertical group of buttons in 1 column */ -GtkButton.Top { +button.Top { border-radius: 10px 4px 0 0; border-style: solid solid none solid; margin-bottom: 0; } -GtkButton.MiddleV { +button.MiddleV { border-radius: 0; border-style: none solid none solid; margin-top: 0; margin-bottom: 0; } -GtkButton.Bottom { +button.Bottom { border-radius: 0 0 4px 4px; border-style: none solid solid solid; margin-top: 0; @@ -148,18 +176,18 @@ GtkButton.Bottom { /* end */ /* Horizontal group of buttons in 1 row */ -GtkButton.Left { +button.Left { border-radius: 4px 0 0 4px; border-style: solid none solid solid; margin-right: 0; } -GtkButton.MiddleH { +button.MiddleH { border-radius: 0; border-style: solid none solid none; margin-left: 0; margin-right: 0; } -GtkButton.Right { +button.Right { border-radius: 0 4px 4px 0; border-style: solid solid solid none; margin-left: 0; @@ -167,38 +195,42 @@ GtkButton.Right { /* end */ /* [1.23[-][+]] */ -GtkEntry, GtkSpinButton { +entry, spinbutton { padding: 1px; + margin: 0; + min-height: 10px; background-color: #262626; } -GtkEntry:insensitive, GtkSpinButton:insensitive { +entry:disabled, spinbutton:disabled { background-color: #363636; } -GtkEntry:hover, GtkSpinButton:hover { +entry:hover, spinbutton:hover { background-color: #565656; } -GtkEntry:selected { +entry:selected { color: #262626; background-color: #AAAAAA; } /* Context menus */ -GtkMenu { +menu { background-color: #262626; color: #909090; } /* Context menu item */ -.menuitem { +menuitem { padding: 2px; + margin: 0; + min-height: 10px; } #MyExpander { - margin: 10px; - padding: 5px; + margin: 2px; + padding: 2px; } /* Tool background */ @@ -208,37 +240,37 @@ GtkMenu { border-style: solid; border-radius: 4px; border-color: #252525; - margin: 9px; - padding: 4px; + margin: 2px; + padding: 3px; } -#ExpanderBox GtkDrawingArea { +#ExpanderBox drawingarea { background-color: #363636; } -#ExpanderBox GtkFrame { +#ExpanderBox frame { background-color: #3B3B3B; border-style: solid; border-width: 1px; border-radius: 4px; border-color: #313131; - margin: 3px; + margin: 2px; padding: 2px; } -#ExpanderBox GtkFrame GtkDrawingArea { +#ExpanderBox frame drawingarea { background-color: #3B3B3B; } -#ExpanderBox GtkFrame GtkFrame { +#ExpanderBox frame frame { background-color: #414141; border: 1px solid #373737; border-radius: 4px; - margin: 3px; + margin: 2px; padding: 2px; } -#ExpanderBox GtkFrame GtkFrame GtkDrawingArea { +#ExpanderBox frame frame drawingarea { background-color: #414141; } @@ -247,69 +279,69 @@ GtkMenu { background-color: #3B3B3B; border: 1px solid #2A2A2A; border-radius: 4px; - margin: 9px; - padding: 4px; + margin: 2px; + padding: 3px; } -#ExpanderBox2 GtkDrawingArea { +#ExpanderBox2 drawingarea { background-color: #3B3B3B; } -#ExpanderBox2 GtkFrame { +#ExpanderBox2 frame { background-color: #414141; border: 1px solid #373737; border-radius: 4px; - margin: 3px; + margin: 2px; padding: 2px; } -#ExpanderBox2 GtkFrame GtkDrawingArea { +#ExpanderBox2 frame drawingarea { background-color: #414141; } -#ExpanderBox2 GtkFrame GtkFrame { +#ExpanderBox2 frame frame { background-color: #474747; border: 1px solid #3D3D3D; border-radius: 4px; - margin: 3px; + margin: 2px; padding: 2px; } -#ExpanderBox2 GtkFrame GtkFrame GtkDrawingArea { +#ExpanderBox2 frame frame drawingarea { background-color: #474747; } #MyExpanderTitle { - margin: 5px; + margin: 2px; padding: 3px 1px 3px 1px; font-size: 120%; } -#MyExpanderTitle GtkLabel { +#MyExpanderTitle label { color: #CCCCCC; } #MyExpanderTitle:hover { background-color: #202020; } -#MyExpanderTitle GtkEventBox:hover GtkImage { +#MyExpanderTitle GtkEventBox:hover image { background-color: #202020; border-radius: 3px; } -#MyExpanderTitle:hover GtkLabel { +#MyExpanderTitle:hover label { color: #D8D8D8; } -#ExpanderBox2 GtkSeparator, #ExpanderBox3 GtkSeparator { +#ExpanderBox2 separator, #ExpanderBox3 separator { color: #292929; } /* Editor tab button */ -#MainNotebook > GtkGrid GtkLabel, #MainNotebook > GtkGrid GtkImage { +#MainNotebook > grid label, #MainNotebook > grid image { /* OK */ padding: 1px; } /* File Browser right side tabs - Toolbox, Inspector, Fast Export, Filter */ -GtkNotebook tab { +notebook tabs { background-color: #383838; border-width: 1px; border-style: none; @@ -318,35 +350,35 @@ GtkNotebook tab { padding: 3px; } -GtkNotebook tab:hover { +notebook tabs:hover { background-color: #505050; } -GtkNotebook tab:active { +notebook tabs:active { border-width: 5px; border-color: #989898; } /* Get rid of shitty notebook header shadow */ -GtkNotebook.top tab { +notebook header.top tabs { border-bottom-style: solid; padding-bottom: 8px; } -GtkNotebook.right tab { +notebook header.right tabs { border-left-style: solid; padding-left: 8px; } -GtkNotebook.bottom tab { +notebook header.bottom tabs { border-top-style: solid; padding-top: 8px; } -GtkNotebook.left tab { +notebook header.left tabs { border-right-style: solid; padding-right: 8px; } /* Get rid of notebook frame border - too many borders */ -GtkNotebook.top.header, GtkNotebook.right.header, GtkNotebook.bottom.header, GtkNotebook.left.header { +notebook header.top, notebook header.right, notebook header.bottom, notebook header.left { box-shadow: none; border-width: 1px; border-color: #262626; @@ -356,30 +388,30 @@ GtkNotebook.top.header, GtkNotebook.right.header, GtkNotebook.bottom.header, Gtk padding: 0; } /* Get rid of notebook header border - too many borders */ -GtkNotebook.top.header { +notebook header.top { /* OK */ border-bottom-style: solid; } -GtkNotebook.right.header { +notebook header.right { /* OK */ border-left-style: solid; } -GtkNotebook.bottom.header { +notebook header.bottom { /* OK */ border-top-style: solid; } -GtkNotebook.left.header { +notebook header.left { /* OK */ border-right-style: solid; } -GtkNotebook.frame { +notebook.frame { /* OK */ border-radius: 0; border-style: none; } /* Pad notebooks, makes the other borders look nicer */ -GtkNotebook { +notebook { /* OK */ background-color: #484848; padding: 0; @@ -390,15 +422,15 @@ GtkNotebook { /* OK */ background-color: #2A2A2A; } -#MainNotebook > tab { +#MainNotebook > tabs { /* OK */ background-color: #2A2A2A; } -#MainNotebook > tab:hover { +#MainNotebook > tabs:hover { /* OK */ background-color: #505050; } -#MainNotebook > tab:active { +#MainNotebook > tabs:active { /* OK */ border-color: #989898; } @@ -407,15 +439,15 @@ GtkNotebook { /* OK */ background-color: #2A2A2A; } -#RightNotebook > tab { +#RightNotebook > tabs { /* OK */ background-color: #2A2A2A; } -#RightNotebook > tab:hover { +#RightNotebook > tabs:hover { /* OK */ background-color: #505050; } -#RightNotebook > tab:active { +#RightNotebook > tabs:active { /* OK */ border-color: #989898; } diff --git a/rtgui/dirbrowser.cc b/rtgui/dirbrowser.cc index fb9e43272..5830c249b 100644 --- a/rtgui/dirbrowser.cc +++ b/rtgui/dirbrowser.cc @@ -80,6 +80,7 @@ DirBrowser::DirBrowser () : dirTreeModel(), dirtree = Gtk::manage ( new Gtk::TreeView() ); scrolledwindow4 = Gtk::manage ( new Gtk::ScrolledWindow() ); + crt.property_ellipsize() = Pango::ELLIPSIZE_END; // dirtree->set_flags(Gtk::CAN_FOCUS); dirtree->set_headers_visible(); diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 834801684..30f2b797f 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -52,8 +52,6 @@ private: profileBox.set_size_request (100, -1); profileBox.setPreferredWidth (90, 150); setExpandAlignProperties (&profileBox, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); - Gtk::CellRendererText* cellRenderer = dynamic_cast(profileBox.get_first_cell()); - cellRenderer->property_ellipsize() = Pango::ELLIPSIZE_MIDDLE; profileBox.append (M ("PREFERENCES_PROFILE_NONE")); #ifdef WIN32 diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index 355b060ef..901a9face 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -53,6 +53,7 @@ ExifPanel::ExifPanel () : idata(NULL) Gtk::TreeView::Column *viewcol = Gtk::manage(new Gtk::TreeView::Column ("Field Name")); Gtk::CellRendererPixbuf* render_pb = Gtk::manage(new Gtk::CellRendererPixbuf ()); Gtk::CellRendererText *render_txt = Gtk::manage(new Gtk::CellRendererText()); + render_txt->property_ellipsize() = Pango::ELLIPSIZE_END; viewcol->pack_start (*render_pb, false); viewcol->pack_start (*render_txt, true); viewcol->add_attribute (*render_pb, "pixbuf", exifColumns.icon); @@ -67,6 +68,7 @@ ExifPanel::ExifPanel () : idata(NULL) Gtk::TreeView::Column *viewcolv = Gtk::manage(new Gtk::TreeView::Column ("Value")); Gtk::CellRendererText *render_txtv = Gtk::manage(new Gtk::CellRendererText()); + render_txtv->property_ellipsize() = Pango::ELLIPSIZE_END; viewcolv->pack_start (*render_txtv, true); viewcolv->add_attribute (*render_txtv, "markup", exifColumns.value); diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index b514d6255..7df4859e5 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -964,6 +964,8 @@ void MyScrolledWindow::get_preferred_height_for_width_vfunc (int width, int &min MyComboBoxText::MyComboBoxText () { minimumWidth = naturalWidth = 70; + Gtk::CellRendererText* cellRenderer = dynamic_cast(get_first_cell()); + cellRenderer->property_ellipsize() = Pango::ELLIPSIZE_MIDDLE; } bool MyComboBoxText::on_scroll_event (GdkEventScroll* event) diff --git a/rtgui/history.cc b/rtgui/history.cc index 98f71331e..65035cfa0 100644 --- a/rtgui/history.cc +++ b/rtgui/history.cc @@ -56,7 +56,9 @@ History::History (bool bookmarkSupport) : blistener(NULL), tpc (NULL), bmnum (1) hTreeView->set_resize_mode(Gtk::RESIZE_QUEUE); Gtk::CellRendererText *changecrt = Gtk::manage (new Gtk::CellRendererText()); + changecrt->property_ellipsize() = Pango::ELLIPSIZE_END; Gtk::CellRendererText *valuecrt = Gtk::manage (new Gtk::CellRendererText()); + valuecrt->property_ellipsize() = Pango::ELLIPSIZE_END; Gtk::TreeView::Column *hviewcol = Gtk::manage (new Gtk::TreeView::Column ("")); hviewcol->pack_start (*changecrt, true); hviewcol->add_attribute (changecrt->property_markup (), historyColumns.text); diff --git a/rtgui/main.cc b/rtgui/main.cc index 75608bb1e..9e44f3f5a 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -331,14 +331,11 @@ int main(int argc, char **argv) if (options.font != "default") { try { cssForced = Gtk::CssProvider::create(); - Glib::ustring font(options.font); - size_t pos = font.find(','); - if (pos != Glib::ustring::npos) { - font = font.replace(pos, 1, " "); - } + // Reformatting the font parameter + Glib::ustring font = Options::formatFontName(options.font); - cssForced->load_from_data (Glib::ustring::compose("* { font: %1; }", font)); + cssForced->load_from_data (Glib::ustring::compose("* { %1 }", font)); Gtk::StyleContext::add_provider_for_screen(screen, cssForced, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); } catch (Glib::Error &err) { printf("Error: \"%s\"\n", err.what().c_str()); diff --git a/rtgui/options.cc b/rtgui/options.cc index d13e04c3c..ef7a98724 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -291,8 +291,8 @@ Glib::ustring Options::findProfilePath (Glib::ustring &profName) void Options::setDefaults () { - font = "sans, 8"; - colorPickerFont = "sans, 8"; + font = "sans 8"; + colorPickerFont = "sans 8"; windowWidth = 1200; windowHeight = 680; windowX = 0; @@ -2337,6 +2337,29 @@ void Options::save () } } +Glib::ustring Options::formatFontName (Glib::ustring font) +{ + if (font.empty()) { + return ""; + } + + // Reformatting the font parameter + Glib::ustring sFont; + + Pango::FontDescription fd(font); + sFont = "font-family: \"" + fd.get_family() + "\";"; + if (fd.get_size()) { + sFont += "font-size: " + Glib::ustring::compose("%1pt", 8 /*fd.get_size()*/); // + (fd.get_size_is_absolute() ? "px;" : "pt;"); + } + if (fd.get_style() == Pango::STYLE_ITALIC) { + sFont += "font-style: italic;"; + } + if (fd.get_weight() > Pango::WEIGHT_NORMAL) { + sFont += "font-weight: bold;"; + } + return sFont; +} + /* * return true if fname ends with one of the retained image file extensions */ diff --git a/rtgui/options.h b/rtgui/options.h index 5c2fedb9a..a8126ba94 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -309,6 +309,7 @@ public: int saveToFile (Glib::ustring fname); static bool load (); static void save (); + static Glib::ustring formatFontName (Glib::ustring font); // if multiUser=false, send back the global profile path Glib::ustring getPreferredProfilePath(); diff --git a/rtgui/placesbrowser.cc b/rtgui/placesbrowser.cc index ab3e3e7e2..490b9ff47 100644 --- a/rtgui/placesbrowser.cc +++ b/rtgui/placesbrowser.cc @@ -67,6 +67,7 @@ PlacesBrowser::PlacesBrowser () Gtk::TreeView::Column *iviewcol = Gtk::manage (new Gtk::TreeView::Column (M("MAIN_FRAME_PLACES"))); Gtk::CellRendererPixbuf *iconCR = Gtk::manage (new Gtk::CellRendererPixbuf()); Gtk::CellRendererText *labelCR = Gtk::manage (new Gtk::CellRendererText()); + labelCR->property_ellipsize() = Pango::ELLIPSIZE_MIDDLE; iviewcol->pack_start (*iconCR, false); iviewcol->pack_start (*labelCR, true); iviewcol->add_attribute (*iconCR, "gicon", 0); diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index ca13c6a5b..f80129f60 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -2085,7 +2085,8 @@ void Preferences::switchFontTo(Glib::ustring newFont) } try { - cssForced->load_from_data (Glib::ustring::compose("* { font: %1; }", newFont)); + newFont = Options::formatFontName(newFont); + cssForced->load_from_data (Glib::ustring::compose("* { %1 }", newFont)); } catch (Glib::Error &err) { printf("Error: \"%s\"\n", err.what().c_str()); } catch (...) { diff --git a/rtgui/profilestore.cc b/rtgui/profilestore.cc index b1265f4b9..e8b841732 100644 --- a/rtgui/profilestore.cc +++ b/rtgui/profilestore.cc @@ -509,6 +509,7 @@ void ProfileStoreEntry::setValues(Glib::ustring label, PSEType type, unsigned sh ProfileStoreLabel::ProfileStoreLabel(const ProfileStoreEntry *entry) : Gtk::Label(entry->label), entry(entry) { set_alignment(0, 0.5); + set_ellipsize(Pango::ELLIPSIZE_END); show(); } diff --git a/rtgui/splash.cc b/rtgui/splash.cc index f34526c9c..8c61c90f2 100644 --- a/rtgui/splash.cc +++ b/rtgui/splash.cc @@ -91,7 +91,7 @@ Splash::Splash (Gtk::Window& parent) : Gtk::Dialog(M("GENERAL_ABOUT"), parent, t get_content_area()->pack_start (*bottomHBox, Gtk::PACK_SHRINK, 0); Glib::RefPtr localCSS = Gtk::CssProvider::create(); - localCSS->load_from_data ("GtkTextView { font: monospace 8; }"); + localCSS->load_from_data ("GtkTextView { font-family: monospace; font-size: 8pt; }"); // Tab 1: the image splashImage = Gtk::manage(new SplashImage ()); diff --git a/rtgui/whitebalance.h b/rtgui/whitebalance.h index 3ebd503bc..cfac5bd8c 100644 --- a/rtgui/whitebalance.h +++ b/rtgui/whitebalance.h @@ -30,6 +30,7 @@ class SpotWBListener { public: + virtual ~SpotWBListener () {} virtual void spotWBRequested (int size) {} };