fix style overwriting done by fastmeter, and lack of clip mask/clip origin restore in pixscroller; fixes meter redraw botch when moving fader, and the style fix corrects visual problems with Clearlooks as soon a ameter is realized
git-svn-id: svn://localhost/trunk/ardour2@323 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
e603d95830
commit
e92c949f3c
|
@ -126,7 +126,7 @@ style "black_mackie_menu_bar" = "medium_bold_text"
|
||||||
bg[NORMAL] = { 0, 0, 0 }
|
bg[NORMAL] = { 0, 0, 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
style "default_buttons_menus" = "small_button"
|
style "default_buttons_menus"
|
||||||
{
|
{
|
||||||
font_name = "sans 8"
|
font_name = "sans 8"
|
||||||
fg[ACTIVE] = { 0, 0, 0 }
|
fg[ACTIVE] = { 0, 0, 0 }
|
||||||
|
|
|
@ -2080,6 +2080,7 @@ Editor::set_state (const XMLNode& node)
|
||||||
int x, y, xoff, yoff;
|
int x, y, xoff, yoff;
|
||||||
Gdk::Geometry g;
|
Gdk::Geometry g;
|
||||||
|
|
||||||
|
|
||||||
if ((geometry = find_named_node (node, "geometry")) == 0) {
|
if ((geometry = find_named_node (node, "geometry")) == 0) {
|
||||||
|
|
||||||
g.base_width = default_width;
|
g.base_width = default_width;
|
||||||
|
@ -2119,6 +2120,15 @@ Editor::set_state (const XMLNode& node)
|
||||||
set_snap_mode ((SnapMode) atoi (prop->value()));
|
set_snap_mode ((SnapMode) atoi (prop->value()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((prop = node.property ("mouse-mode"))) {
|
||||||
|
MouseMode m = str2mousemode(prop->value());
|
||||||
|
mouse_mode = MouseMode ((int) m + 1); /* lie, force mode switch */
|
||||||
|
set_mouse_mode (m, true);
|
||||||
|
} else {
|
||||||
|
mouse_mode = MouseGain; /* lie, to force the mode switch */
|
||||||
|
set_mouse_mode (MouseObject, true);
|
||||||
|
}
|
||||||
|
|
||||||
if ((prop = node.property ("show-waveforms"))) {
|
if ((prop = node.property ("show-waveforms"))) {
|
||||||
bool yn = (prop->value() == "yes");
|
bool yn = (prop->value() == "yes");
|
||||||
_show_waveforms = !yn;
|
_show_waveforms = !yn;
|
||||||
|
@ -2166,24 +2176,16 @@ Editor::set_state (const XMLNode& node)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((prop = node.property ("xfades-visible"))) {
|
|
||||||
bool yn = (prop->value() == "yes");
|
|
||||||
_xfade_visibility = !yn;
|
|
||||||
set_xfade_visibility (yn);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((prop = node.property ("region-list-sort-type"))) {
|
if ((prop = node.property ("region-list-sort-type"))) {
|
||||||
region_list_sort_type = (Editing::RegionListSortType) -1; // force change
|
region_list_sort_type = (Editing::RegionListSortType) -1; // force change
|
||||||
reset_region_list_sort_type(str2regionlistsorttype(prop->value()));
|
reset_region_list_sort_type(str2regionlistsorttype(prop->value()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((prop = node.property ("mouse-mode"))) {
|
if ((prop = node.property ("xfades-visible"))) {
|
||||||
MouseMode m = str2mousemode(prop->value());
|
bool yn = (prop->value() == "yes");
|
||||||
mouse_mode = MouseMode ((int) m + 1); /* lie, force mode switch */
|
_xfade_visibility = !yn;
|
||||||
set_mouse_mode (m, true);
|
set_xfade_visibility (yn);
|
||||||
} else {
|
|
||||||
mouse_mode = MouseGain; /* lie, to force the mode switch */
|
|
||||||
set_mouse_mode (MouseObject, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((prop = node.property ("show-editor-mixer"))) {
|
if ((prop = node.property ("show-editor-mixer"))) {
|
||||||
|
|
|
@ -95,14 +95,14 @@ Editor::show_editor_mixer (bool yn)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_mixer_strip->get_parent() == 0) {
|
if (current_mixer_strip->get_parent() == 0) {
|
||||||
|
|
||||||
current_mixer_strip->set_embedded (true);
|
current_mixer_strip->set_embedded (true);
|
||||||
current_mixer_strip->Hiding.connect (mem_fun(*this, &Editor::current_mixer_strip_hidden));
|
current_mixer_strip->Hiding.connect (mem_fun(*this, &Editor::current_mixer_strip_hidden));
|
||||||
current_mixer_strip->GoingAway.connect (mem_fun(*this, &Editor::current_mixer_strip_removed));
|
current_mixer_strip->GoingAway.connect (mem_fun(*this, &Editor::current_mixer_strip_removed));
|
||||||
current_mixer_strip->set_width (editor_mixer_strip_width);
|
current_mixer_strip->set_width (editor_mixer_strip_width);
|
||||||
|
|
||||||
global_hpacker.pack_start (*current_mixer_strip, Gtk::PACK_SHRINK );
|
global_hpacker.pack_start (*current_mixer_strip, Gtk::PACK_SHRINK );
|
||||||
global_hpacker.reorder_child (*current_mixer_strip, 0);
|
global_hpacker.reorder_child (*current_mixer_strip, 0);
|
||||||
|
|
||||||
current_mixer_strip->show_all ();
|
current_mixer_strip->show_all ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -181,8 +181,8 @@ GainMeter::GainMeter (IO& io, Session& s)
|
||||||
hbox.pack_start (meter_packer, Gtk::PACK_SHRINK);
|
hbox.pack_start (meter_packer, Gtk::PACK_SHRINK);
|
||||||
|
|
||||||
set_spacing (4);
|
set_spacing (4);
|
||||||
|
|
||||||
pack_start (top_table, Gtk::PACK_SHRINK);
|
pack_start (top_table, Gtk::PACK_SHRINK);
|
||||||
/* here's the culprit gain display box*/
|
|
||||||
pack_start (gain_display_box, Gtk::PACK_SHRINK);
|
pack_start (gain_display_box, Gtk::PACK_SHRINK);
|
||||||
pack_start (hbox, Gtk::PACK_SHRINK);
|
pack_start (hbox, Gtk::PACK_SHRINK);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2003 Paul Davis
|
Copyright (C) 2003-2006 Paul Davis
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -71,20 +71,6 @@ FastMeter::~FastMeter ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
FastMeter::on_realize ()
|
|
||||||
{
|
|
||||||
DrawingArea::on_realize();
|
|
||||||
|
|
||||||
RefPtr<Style> style = get_style();
|
|
||||||
Color black = style->get_black();
|
|
||||||
|
|
||||||
style->set_bg (STATE_NORMAL, black);
|
|
||||||
style->set_bg (STATE_ACTIVE, black);
|
|
||||||
style->set_bg (STATE_SELECTED, black);
|
|
||||||
style->set_bg (STATE_INSENSITIVE, black);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
FastMeter::set_vertical_xpm (const char **xpm)
|
FastMeter::set_vertical_xpm (const char **xpm)
|
||||||
{
|
{
|
||||||
|
@ -149,11 +135,24 @@ FastMeter::vertical_expose (GdkEventExpose* ev)
|
||||||
{
|
{
|
||||||
gint top_of_meter;
|
gint top_of_meter;
|
||||||
GdkRectangle intersection;
|
GdkRectangle intersection;
|
||||||
|
GdkRectangle background;
|
||||||
|
|
||||||
top_of_meter = (gint) floor (v_pixheight * current_level);
|
top_of_meter = (gint) floor (v_pixheight * current_level);
|
||||||
pixrect.height = top_of_meter;
|
pixrect.height = top_of_meter;
|
||||||
|
|
||||||
if (gdk_rectangle_intersect (&pixrect, &ev->area, &intersection)) {
|
background.x = 0;
|
||||||
|
background.y = 0;
|
||||||
|
background.width = pixrect.width;
|
||||||
|
background.height = v_pixheight - top_of_meter;
|
||||||
|
|
||||||
|
if (gdk_rectangle_intersect (&background, &ev->area, &intersection)) {
|
||||||
|
get_window()->draw_rectangle (get_style()->get_black_gc(), true,
|
||||||
|
intersection.x, intersection.y,
|
||||||
|
intersection.width, intersection.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gdk_rectangle_intersect (&pixrect, &ev->area, &intersection)) {
|
||||||
|
|
||||||
/* draw the part of the meter image that we need. the area we draw is bounded "in reverse" (top->bottom)
|
/* draw the part of the meter image that we need. the area we draw is bounded "in reverse" (top->bottom)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,6 @@ class FastMeter : public Gtk::DrawingArea {
|
||||||
protected:
|
protected:
|
||||||
bool on_expose_event (GdkEventExpose*);
|
bool on_expose_event (GdkEventExpose*);
|
||||||
void on_size_request (GtkRequisition*);
|
void on_size_request (GtkRequisition*);
|
||||||
void on_realize ();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Glib::RefPtr<Gdk::Pixmap> h_pixmap;
|
static Glib::RefPtr<Gdk::Pixmap> h_pixmap;
|
||||||
|
|
|
@ -96,9 +96,9 @@ PixScroller::on_expose_event (GdkEventExpose* ev)
|
||||||
if (gdk_rectangle_intersect (sliderrect.gobj(), &ev->area, &intersect)) {
|
if (gdk_rectangle_intersect (sliderrect.gobj(), &ev->area, &intersect)) {
|
||||||
Glib::RefPtr<Gdk::GC> gc(get_style()->get_fg_gc(get_state()));
|
Glib::RefPtr<Gdk::GC> gc(get_style()->get_fg_gc(get_state()));
|
||||||
Glib::RefPtr<Gdk::Bitmap> mask (slider_mask);
|
Glib::RefPtr<Gdk::Bitmap> mask (slider_mask);
|
||||||
// Do these have a gtk2 equivalent?
|
|
||||||
// Gdk::GCValues values;
|
GdkGCValues values;
|
||||||
// gc->get_values(values);
|
gdk_gc_get_values(gc->gobj(), &values);
|
||||||
gc->set_clip_origin (sliderrect.get_x(), sliderrect.get_y());
|
gc->set_clip_origin (sliderrect.get_x(), sliderrect.get_y());
|
||||||
gc->set_clip_mask (mask);
|
gc->set_clip_mask (mask);
|
||||||
win->draw_drawable (gc, slider,
|
win->draw_drawable (gc, slider,
|
||||||
|
@ -108,9 +108,8 @@ PixScroller::on_expose_event (GdkEventExpose* ev)
|
||||||
intersect.y,
|
intersect.y,
|
||||||
intersect.width,
|
intersect.width,
|
||||||
intersect.height);
|
intersect.height);
|
||||||
// gc->set_clip_origin(values.clip_x_origin, values.clip_y_origin);
|
gc->set_clip_origin (values.clip_x_origin, values.clip_y_origin);
|
||||||
// Gdk::Bitmap i_hate_gdk (values.clip_mask);
|
gdk_gc_set_clip_mask (gc->gobj(), values.clip_mask);
|
||||||
// gc->set_clip_mask (i_hate_gdk);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user