From f5d9f9529a985f6a2a7298f291869f899d04c646 Mon Sep 17 00:00:00 2001 From: Thanatomanic Date: Mon, 2 Jul 2018 19:48:24 +0200 Subject: [PATCH] Removed freeze-mode for the histogram bar --- rtdata/languages/default | 2 +- rtgui/cropwindow.cc | 4 --- rtgui/histogrampanel.cc | 46 +++++------------------------------ rtgui/histogrampanel.h | 5 ---- rtgui/pointermotionlistener.h | 1 - 5 files changed, 7 insertions(+), 51 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 52364caa8..de1e657e3 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -238,7 +238,7 @@ GENERAL_UNCHANGED;(Unchanged) GENERAL_WARNING;Warning GIMP_PLUGIN_INFO;Welcome to the RawTherapee GIMP plugin!\nOnce you are done editing, simply close the main RawTherapee window and the image will be automatically imported in GIMP. HISTOGRAM_TOOLTIP_B;Show/Hide blue histogram. -HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar.\nRight-click on image preview to freeze/unfreeze. +HISTOGRAM_TOOLTIP_BAR;Show/Hide RGB indicator bar. HISTOGRAM_TOOLTIP_CHRO;Show/Hide chromaticity histogram. HISTOGRAM_TOOLTIP_MODE;Toggle between linear, log-linear and log-log scaling of the histogram. HISTOGRAM_TOOLTIP_G;Show/Hide green histogram. diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 08ea9d0f7..bf01a9c7b 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -754,10 +754,6 @@ void CropWindow::buttonRelease (int button, int num, int bstate, int x, int y) } iarea->setToolHand (); - - if (pmhlistener) { - pmhlistener->toggleFreeze(); - } } state = SNormal; diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index 0a7c034a4..db0970e63 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -217,18 +217,9 @@ void HistogramPanel::resized (Gtk::Allocation& req) histogramArea->updateBackBuffer (); histogramArea->queue_draw (); - if (histogramRGBArea->getFreeze()) { - histogramRGBArea->updateFreeze(false); - // set histogramRGBArea invalid; - histogramRGBArea->updateBackBuffer(-1, -1, -1); - // re-set freeze to old state - histogramRGBArea->updateFreeze(true); - histogramRGBArea->queue_draw (); - } else { - // set histogramRGBArea invalid; - histogramRGBArea->updateBackBuffer(-1, -1, -1); - histogramRGBArea->queue_draw (); - } + // set histogramRGBArea invalid; + histogramRGBArea->updateBackBuffer(-1, -1, -1); + histogramRGBArea->queue_draw (); // Store current height of the histogram options.histogramHeight = get_height(); @@ -316,18 +307,6 @@ void HistogramPanel::setHistRGBInvalid () histogramRGBArea->queue_draw (); } -// "Freeze" is not a button, but a RMB-click, so this is not in the RGBV-Toggle method -void HistogramPanel::toggleFreeze () -{ - if (histogramRGBArea->getFreeze()) { - histogramRGBArea->updateFreeze(false); - } else if (histogramRGBArea->getShow()) { - histogramRGBArea->updateFreeze(true); - } - - return; -} - void HistogramPanel::pointerMoved (bool validPos, Glib::ustring profile, Glib::ustring profileW, int x, int y, int r, int g, int b) { @@ -377,7 +356,7 @@ void HistogramPanel::toggle_button_mode () // // HistogramRGBArea HistogramRGBArea::HistogramRGBArea () ://needChroma unactive by default, luma too - val(0), r(0), g(0), b(0), frozen(false), valid(false), needRed(true), needGreen(true), needBlue(true), needLuma(false), rawMode(false), showMode(options.histogramBar), barDisplayed(options.histogramBar), needChroma(false), parent(nullptr) + val(0), r(0), g(0), b(0), valid(false), needRed(true), needGreen(true), needBlue(true), needLuma(false), rawMode(false), showMode(options.histogramBar), barDisplayed(options.histogramBar), needChroma(false), parent(nullptr) { get_style_context()->add_class("drawingarea"); @@ -440,25 +419,14 @@ void HistogramRGBArea::get_preferred_width_for_height_vfunc (int height, int &mi get_preferred_width_vfunc (minimum_width, natural_width); } -bool HistogramRGBArea::getFreeze() -{ - return(frozen); -} - bool HistogramRGBArea::getShow() { return(showMode); } -void HistogramRGBArea::updateFreeze (bool f) -{ - frozen = f; - return; -} - void HistogramRGBArea::updateBackBuffer (int r, int g, int b, const Glib::ustring &profile, const Glib::ustring &profileW) { - if (!get_realized () || frozen || !showMode) { + if (!get_realized () || !showMode) { return; } @@ -599,8 +567,6 @@ void HistogramRGBArea::updateOptions (bool r, bool g, bool b, bool l, bool raw, removeIfThere(parent, this, false); options.histogramBar = false; barDisplayed = false; - // unfreeze - updateFreeze(false); } // Disable (but don't hide it) the bar button when RAW histogram is displayed @@ -641,7 +607,7 @@ bool HistogramRGBArea::on_button_press_event (GdkEventButton* event) { if (event->type == GDK_2BUTTON_PRESS && event->button == 1) { - // do something. Maybe un-freeze ? + // do something? } return true; diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index bb20dadfb..d11b87153 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -56,7 +56,6 @@ protected: int g; int b; - bool frozen; bool valid; bool needRed; @@ -77,8 +76,6 @@ public: ~HistogramRGBArea(); void updateBackBuffer (int r, int g, int b, const Glib::ustring &profile = "", const Glib::ustring &profileW = ""); - void updateFreeze (bool f); - bool getFreeze (); bool getShow (); void setParent (Gtk::Grid* p) { @@ -201,8 +198,6 @@ public: } // pointermotionlistener interface void pointerMoved (bool validPos, Glib::ustring profile, Glib::ustring profileW, int x, int y, int r, int g, int b); - // added pointermotionlistener interface - void toggleFreeze(); // TODO should be protected void setHistRGBInvalid (); diff --git a/rtgui/pointermotionlistener.h b/rtgui/pointermotionlistener.h index 09a9b3b4f..5600a0838 100644 --- a/rtgui/pointermotionlistener.h +++ b/rtgui/pointermotionlistener.h @@ -28,7 +28,6 @@ protected: public: virtual ~PointerMotionListener() {} virtual void pointerMoved (bool validPos, Glib::ustring profile, Glib::ustring profileW, int x, int y, int r, int g, int b) {} - virtual void toggleFreeze () {} virtual void getRGBText (int r, int g, int b, Glib::ustring &sR, Glib::ustring &sG, Glib::ustring &sB) { sR = "--"; sG = "--"; sB = "--"; } virtual void getHSVText (float h, float s, float v, Glib::ustring &sH, Glib::ustring &sS, Glib::ustring &sV) { sH = "--"; sS = "--"; sV = "--"; } virtual void getLABText (float l, float a, float b, Glib::ustring &sL, Glib::ustring &sA, Glib::ustring &sB) { sL = "--"; sA = "--"; sB = "--"; }