diff --git a/rtdata/themes/RawTherapee.css b/rtdata/themes/RawTherapee.css index 6a12cb9b1..ec74b17cf 100644 --- a/rtdata/themes/RawTherapee.css +++ b/rtdata/themes/RawTherapee.css @@ -199,21 +199,27 @@ separator { margin: 5px; } -progressbar.vertical { - min-width: 10px; +progressbar.vertical trough { + min-width: 6px; +} +progressbar.vertical trough progress { + min-width: 6px; } -progressbar.horizontal { - min-height: 10px; +progressbar.horizontal trough { + min-height: 6px; +} +progressbar.horizontal trough progress { + min-height: 6px; } -drawingarea { +.drawingarea { border-radius: 0; background-color: #363636; border: 1px solid #252525; } -drawingarea:selected { +.drawingarea:selected { background-color: #565656; border-radius: 10px; } @@ -594,6 +600,10 @@ paned > separator { margin: 5px; } +#PreviewWindow { + border-style: solid none; +} + .tooltip { padding: 0; } diff --git a/rtgui/adjuster.cc b/rtgui/adjuster.cc index b346119ee..d9011e577 100644 --- a/rtgui/adjuster.cc +++ b/rtgui/adjuster.cc @@ -95,7 +95,7 @@ Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep slider = Gtk::manage (new MyHScale ()); setExpandAlignProperties(slider, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); slider->set_draw_value (false); - slider->set_has_origin(false); // ------------------ This will remove the colored part on the left of the slider's knob + //slider->set_has_origin(false); // ------------------ This will remove the colored part on the left of the slider's knob if (vlabel.empty()) { // No label, everything goes in a single row diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 7a1766505..0b455cac7 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -401,6 +401,7 @@ HistogramRGBArea::HistogramRGBArea () ://needChroma unactive by default val(0), r(0), g(0), b(0), frozen(false), valid(false), needRed(true), needGreen(true), needBlue(true), needLuma(true), rawMode(false), showMode(options.histogramBar), barDisplayed(options.histogramBar), needChroma(false), parent(nullptr) { + get_style_context()->add_class("drawingarea"); set_name("HistogramRGBArea"); harih = new HistogramRGBAreaIdleHelper; @@ -488,13 +489,16 @@ void HistogramRGBArea::updateBackBuffer (int r, int g, int b, Glib::ustring prof window->get_geometry(winx, winy, winw, winh); // This will create or update the size of the BackBuffer::surface - setDrawRectangle(window, 0, 0, winw, winh, true); + setDrawRectangle(Cairo::FORMAT_ARGB32, 0, 0, winw, winh, true); if (surface) { Cairo::RefPtr cc = Cairo::Context::create(surface); Glib::RefPtr style = get_style_context(); - style->render_background (cc, 0, 0, surface->get_width(), surface->get_height()); + cc->set_source_rgba (0., 0., 0., 0.); + cc->set_operator (Cairo::OPERATOR_CLEAR); + cc->paint (); + cc->set_operator (Cairo::OPERATOR_OVER); cc->set_antialias(Cairo::ANTIALIAS_NONE); cc->set_line_width (1.0); @@ -547,8 +551,6 @@ void HistogramRGBArea::updateBackBuffer (int r, int g, int b, Glib::ustring prof } } } - - style->render_frame (cc, 0, 0, surface->get_width(), surface->get_height()); } setDirty(false); @@ -786,6 +788,9 @@ void HistogramRGBArea::on_realize () bool HistogramRGBArea::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) { + const Glib::RefPtr style = get_style_context(); + style->render_background(cr, 0, 0, get_width(), get_height()); + // on_realize & updateBackBuffer have to be called before if (surface) { if (isDirty()) { // not sure this could happen... @@ -795,6 +800,8 @@ bool HistogramRGBArea::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) copySurface(cr, NULL); } + style->render_frame (cr, 0, 0, get_width(), get_height()); + return true; } @@ -822,6 +829,7 @@ HistogramArea::HistogramArea (FullModeListener *fml) : //needChroma unactive by bhist(256); chist(256); + get_style_context()->add_class("drawingarea"); set_name("HistogramArea"); haih = new HistogramAreaIdleHelper; @@ -951,7 +959,7 @@ SSEFUNCTION void HistogramArea::updateBackBuffer () window->get_geometry(winx, winy, winw, winh); // This will create or update the size of the BackBuffer::surface - setDrawRectangle(window, 0, 0, winw, winh, true); + setDrawRectangle(Cairo::FORMAT_ARGB32, 0, 0, winw, winh, true); Cairo::RefPtr cr = Cairo::Context::create(surface); const Glib::RefPtr style = get_style_context(); @@ -1211,16 +1219,14 @@ bool HistogramArea::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) Glib::RefPtr window = get_window(); - int winx, winy, winw, winh; - window->get_geometry(winx, winy, winw, winh); - - if (winw != oldwidth || winh != oldheight || isDirty ()) { + if (get_width() != oldwidth || get_height() != oldheight || isDirty ()) { updateBackBuffer (); } - Glib::RefPtr style = get_style_context(); - style->render_background(cr, winx, winy, winw, winh); + const Glib::RefPtr style = get_style_context(); + style->render_background(cr, 0, 0, get_width(), get_height()); copySurface(cr, NULL); + style->render_frame (cr, 0, 0, get_width(), get_height()); return true; } diff --git a/rtgui/mycurve.cc b/rtgui/mycurve.cc index eafe5d38c..9fc6b3252 100644 --- a/rtgui/mycurve.cc +++ b/rtgui/mycurve.cc @@ -38,6 +38,7 @@ MyCurve::MyCurve () : pipetteR(-1.f), pipetteG(-1.f), pipetteB(-1.f), pipetteVal edited_point = -1; add_events(Gdk::POINTER_MOTION_MASK | Gdk::POINTER_MOTION_HINT_MASK | Gdk::ENTER_NOTIFY_MASK | Gdk::LEAVE_NOTIFY_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::BUTTON1_MOTION_MASK); + get_style_context()->add_class("drawingarea"); mcih = new MyCurveIdleHelper; mcih->myCurve = this; diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index 266071865..8149b7e55 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -25,6 +25,7 @@ PreviewWindow::PreviewWindow () : previewHandler(NULL), mainCropWin(NULL), image zoom(0.0), isMoving(false), needsUpdate(false), cursor_type(CSUndefined) { set_name("PreviewWindow"); + get_style_context()->add_class("drawingarea"); rconn = signal_size_allocate().connect( sigc::mem_fun(*this, &PreviewWindow::on_resized) ); } @@ -60,12 +61,14 @@ void PreviewWindow::updatePreviewImage () return; } - backBuffer = Cairo::RefPtr ( new BackBuffer(W, H, wind) ); + backBuffer = Cairo::RefPtr ( new BackBuffer(W, H, Cairo::FORMAT_ARGB32) ); Cairo::RefPtr surface = backBuffer->getSurface(); Glib::RefPtr style = get_style_context(); Cairo::RefPtr cc = Cairo::Context::create(surface); - style->render_background(cc, 0, 0, W, H); - Gdk::RGBA c = style->get_background_color(Gtk::STATE_FLAG_NORMAL); + cc->set_source_rgba (0., 0., 0., 0.); + cc->set_operator (Cairo::OPERATOR_CLEAR); + cc->paint (); + cc->set_operator (Cairo::OPERATOR_OVER); cc->set_antialias(Cairo::ANTIALIAS_NONE); cc->set_line_join(Cairo::LINE_JOIN_MITER); @@ -86,7 +89,6 @@ void PreviewWindow::updatePreviewImage () } } } - style->render_frame (cc, 0, 0, W, H); } void PreviewWindow::setPreviewHandler (PreviewHandler* ph) @@ -108,6 +110,8 @@ void PreviewWindow::on_resized (Gtk::Allocation& req) bool PreviewWindow::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) { + const Glib::RefPtr style = get_style_context(); + style->render_background(cr, 0, 0, get_width(), get_height()); if (!backBuffer) { return true; @@ -155,6 +159,8 @@ bool PreviewWindow::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) } } + style->render_frame (cr, 0, 0, get_width(), get_height()); + return true; } diff --git a/rtgui/shcselector.cc b/rtgui/shcselector.cc index 189dd09c0..90e2449cd 100644 --- a/rtgui/shcselector.cc +++ b/rtgui/shcselector.cc @@ -156,14 +156,15 @@ bool SHCSelector::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr) */ // draw the box's borders - cr->set_line_width (1.); - c = style->get_border_color(state); - cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue()); - cr->rectangle (leftMargin + 0.5, 0.5, w - 1, int(float(h) * 5.5f / 7.f + 0.5f) + 1); - cr->stroke (); + style->render_frame(cr, leftMargin + 0.5, 0.5, w - 1, int(float(h) * 5.5f / 7.f + 0.5f) + 1); + //cr->set_line_width (1.); + //c = style->get_border_color(state); + //cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue()); + //cr->rectangle (leftMargin + 0.5, 0.5, w - 1, int(float(h) * 5.5f / 7.f + 0.5f) + 1); + //cr->stroke (); // draw sliders - //cr->set_line_width (1.); + cr->set_line_width (1.); for (int i = 0; i < 3; i++) { if (i == movingPosition) { style->set_state(Gtk::STATE_FLAG_ACTIVE); diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 9abac3573..74647c846 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -113,18 +113,6 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA //---------Brightness / Contrast ------------------------- brightness = Gtk::manage (new Adjuster (M("TP_EXPOSURE_BRIGHTNESS"), -100, 100, 1, 0)); - Glib::RefPtr cssProvider = Gtk::CssProvider::create(); - - if (cssProvider) { - try { - cssProvider->load_from_data("scale trough { background-image: linear-gradient(to right, #000 0%, #CCC 100%); }"); - brightness->get_style_context()->add_provider(cssProvider, GTK_STYLE_PROVIDER_PRIORITY_USER); - } catch (Glib::Error &err) { - printf("Erreur: \"%s\"\n", err.what().c_str()); - } catch (...) { - printf("Erreur inconnu !\n"); - } - } pack_start (*brightness); contrast = Gtk::manage (new Adjuster (M("TP_EXPOSURE_CONTRAST"), -100, 100, 1, 0)); pack_start (*contrast);