pixfaders should invalidate their patterns and layout on style change, helps fix #5275
git-svn-id: svn://localhost/ardour2/branches/3.0@13949 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
c939a66249
commit
3b17107417
@ -61,6 +61,7 @@ class PixFader : public Gtk::DrawingArea
|
||||
bool on_enter_notify_event (GdkEventCrossing* ev);
|
||||
bool on_leave_notify_event (GdkEventCrossing* ev);
|
||||
void on_state_changed (Gtk::StateType);
|
||||
void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
|
||||
|
||||
enum Orientation {
|
||||
VERT,
|
||||
|
@ -107,6 +107,10 @@ PixFader::create_patterns ()
|
||||
|
||||
double w = get_width();
|
||||
|
||||
if (w <= 1 || get_height() <= 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((pattern = find_pattern (fr, fg, fb, br, bg, bb, get_width(), get_height())) != 0) {
|
||||
/* found it - use it */
|
||||
return;
|
||||
@ -304,11 +308,6 @@ PixFader::on_size_allocate (Gtk::Allocation& alloc)
|
||||
}
|
||||
|
||||
update_unity_position ();
|
||||
|
||||
if (is_realized()) {
|
||||
create_patterns();
|
||||
queue_draw ();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
@ -594,3 +593,19 @@ PixFader::on_state_changed (Gtk::StateType old_state)
|
||||
Widget::on_state_changed (old_state);
|
||||
create_patterns ();
|
||||
}
|
||||
|
||||
void
|
||||
PixFader::on_style_changed (const Glib::RefPtr<Gtk::Style>&)
|
||||
{
|
||||
if (_layout) {
|
||||
std::string txt = _layout->get_text();
|
||||
_layout.clear (); // drop reference to existing layout
|
||||
set_text (txt);
|
||||
}
|
||||
|
||||
/* remember that all patterns are cached and not owned by an individual
|
||||
pixfader. we will lazily create a new pattern when needed.
|
||||
*/
|
||||
|
||||
pattern = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user