diff options
author | Robin Gareus <robin@gareus.org> | 2016-12-17 01:40:22 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-12-17 02:43:42 +0100 |
commit | fab1ef05bc22f40e6326b3f484c16711fe56589c (patch) | |
tree | 8f972fb284f9a99641e7619f8a2c97232052dd7c | |
parent | 9dad10f69133b8ae3606411f61ac9490a4057009 (diff) |
remove cruft
-rw-r--r-- | gtk2_ardour/audio_clock.cc | 32 | ||||
-rw-r--r-- | gtk2_ardour/audio_clock.h | 4 |
2 files changed, 9 insertions, 27 deletions
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 69af98be85..292ff557d4 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -83,9 +83,6 @@ AudioClock::AudioClock (const string& clock_name, bool transient, const string& , style_resets_first (true) , layout_height (0) , layout_width (0) - , info_height (0) - , upper_height (0) - , mode_based_info_ratio (1.0) , corner_radius (4) , font_size (10240) , editing (false) @@ -284,9 +281,9 @@ AudioClock::render (cairo_t* cr, cairo_rectangle_t*) if (_need_bg) { cairo_set_source_rgba (cr, bg_r, bg_g, bg_b, bg_a); if (corner_radius) { - Gtkmm2ext::rounded_rectangle (cr, 0, 0, get_width(), upper_height, corner_radius); + Gtkmm2ext::rounded_rectangle (cr, 0, 0, get_width(), get_height(), corner_radius); } else { - cairo_rectangle (cr, 0, 0, get_width(), upper_height); + cairo_rectangle (cr, 0, 0, get_width(), get_height()); } cairo_fill (cr); } @@ -294,7 +291,7 @@ AudioClock::render (cairo_t* cr, cairo_rectangle_t*) double lw = layout_width * xscale; double lh = layout_height * yscale; - cairo_move_to (cr, (get_width() - lw) / 2.0, (upper_height - lh) / 2.0); + cairo_move_to (cr, (get_width() - lw) / 2.0, (get_height() - lh) / 2.0); if (xscale != 1.0 || yscale != 1.0) { cairo_save (cr); @@ -328,7 +325,7 @@ AudioClock::render (cairo_t* cr, cairo_rectangle_t*) cairo_rectangle (cr, min (get_width() - 2.0, (double) xcenter + cursor.get_x()/PANGO_SCALE + em_width), - (upper_height - layout_height)/2.0, + (get_height() - layout_height)/2.0, 2.0, cursor.get_height()/PANGO_SCALE); cairo_fill (cr); } else { @@ -340,8 +337,8 @@ AudioClock::render (cairo_t* cr, cairo_rectangle_t*) cairo_set_source_rgba (cr, cursor_r, cursor_g, cursor_b, cursor_a); cairo_rectangle (cr, (get_width()/2.0), - (upper_height - layout_height)/2.0, - 2.0, upper_height); + (get_height() - layout_height)/2.0, + 2.0, get_height()); cairo_fill (cr); } } @@ -349,13 +346,6 @@ AudioClock::render (cairo_t* cr, cairo_rectangle_t*) } void -AudioClock::on_size_allocate (Gtk::Allocation& alloc) -{ - CairoWidget::on_size_allocate (alloc); - upper_height = get_height(); -} - -void AudioClock::set_clock_dimensions (Gtk::Requisition& req) { Glib::RefPtr<Pango::Layout> tmp; @@ -1499,7 +1489,7 @@ AudioClock::on_button_press_event (GdkEventButton *ev) */ int xcenter = (get_width() - layout_width) /2; - y = ev->y - ((upper_height - layout_height)/2); + y = ev->y - ((get_height() - layout_height)/2); x = ev->x - xcenter; if (!_layout->xy_to_index (x * PANGO_SCALE, y * PANGO_SCALE, index, trailing)) { @@ -1545,7 +1535,7 @@ AudioClock::on_button_release_event (GdkEventButton *ev) int xcenter = (get_width() - layout_width) /2; int index = 0; int trailing; - int y = ev->y - ((upper_height - layout_height)/2); + int y = ev->y - ((get_height() - layout_height)/2); int x = ev->x - xcenter; Field f; @@ -1614,7 +1604,7 @@ AudioClock::on_scroll_event (GdkEventScroll *ev) */ int xcenter = (get_width() - layout_width) /2; - y = ev->y - ((upper_height - layout_height)/2); + y = ev->y - ((get_height() - layout_height)/2); x = ev->x - xcenter; if (!_layout->xy_to_index (x * PANGO_SCALE, y * PANGO_SCALE, index, trailing)) { @@ -2063,7 +2053,6 @@ AudioClock::set_mode (Mode m, bool noemit) switch (_mode) { case Timecode: - mode_based_info_ratio = 0.6; insert_map.push_back (11); insert_map.push_back (10); insert_map.push_back (8); @@ -2075,7 +2064,6 @@ AudioClock::set_mode (Mode m, bool noemit) break; case BBT: - mode_based_info_ratio = 0.5; insert_map.push_back (11); insert_map.push_back (10); insert_map.push_back (9); @@ -2088,7 +2076,6 @@ AudioClock::set_mode (Mode m, bool noemit) break; case MinSec: - mode_based_info_ratio = 0.6; insert_map.push_back (12); insert_map.push_back (11); insert_map.push_back (10); @@ -2101,7 +2088,6 @@ AudioClock::set_mode (Mode m, bool noemit) break; case Frames: - mode_based_info_ratio = 0.45; break; } diff --git a/gtk2_ardour/audio_clock.h b/gtk2_ardour/audio_clock.h index ffd4d6b93a..62e62c5f8f 100644 --- a/gtk2_ardour/audio_clock.h +++ b/gtk2_ardour/audio_clock.h @@ -144,9 +144,6 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr bool style_resets_first; int layout_height; int layout_width; - int info_height; - int upper_height; - double mode_based_info_ratio; double corner_radius; uint32_t font_size; @@ -202,7 +199,6 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr void on_style_changed (const Glib::RefPtr<Gtk::Style>&); void on_size_request (Gtk::Requisition* req); bool on_motion_notify_event (GdkEventMotion *ev); - void on_size_allocate (Gtk::Allocation&); bool on_focus_out_event (GdkEventFocus*); void set_slave_info (); |