summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorNick Mainsbridge <beatroute@iprimus.com.au>2006-11-05 14:24:37 +0000
committerNick Mainsbridge <beatroute@iprimus.com.au>2006-11-05 14:24:37 +0000
commit01da28899248a46c0679da9cab33881d18b84acd (patch)
tree3c2cb065030cb297694d609c8426fdc764a06bbc /libs
parent69d27e60bac313e006397759d3c2de8998de3754 (diff)
centre gain meter display, some bbt ruler fixes
git-svn-id: svn://localhost/ardour2/trunk@1071 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/gtkmm2ext/click_box.cc17
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/click_box.h1
2 files changed, 14 insertions, 4 deletions
diff --git a/libs/gtkmm2ext/click_box.cc b/libs/gtkmm2ext/click_box.cc
index efce988c29..3ab7ea883c 100644
--- a/libs/gtkmm2ext/click_box.cc
+++ b/libs/gtkmm2ext/click_box.cc
@@ -38,17 +38,18 @@ ClickBox::ClickBox (Gtk::Adjustment *adjp, const string &name, bool round_to_ste
twidth = 0;
theight = 0;
- set_name (name);
+
add_events (Gdk::BUTTON_RELEASE_MASK|
Gdk::BUTTON_PRESS_MASK|
Gdk::ENTER_NOTIFY_MASK|
Gdk::LEAVE_NOTIFY_MASK);
- set_label ();
get_adjustment().signal_value_changed().connect (mem_fun (*this, &ClickBox::set_label));
-
+ signal_style_changed().connect (mem_fun (*this, &ClickBox::style_changed));
signal_button_press_event().connect (mem_fun (*this, &ClickBox::button_press_handler));
signal_button_release_event().connect (mem_fun (*this, &ClickBox::button_release_handler));
+ set_name (name);
+ set_label ();
}
ClickBox::~ClickBox ()
@@ -102,6 +103,14 @@ ClickBox::set_label ()
queue_draw ();
}
+void
+ClickBox::style_changed (const Glib::RefPtr<Gtk::Style>& ignored)
+{
+
+ layout->context_changed ();
+ layout->get_pixel_size (twidth, theight);
+}
+
bool
ClickBox::on_expose_event (GdkEventExpose *ev)
{
@@ -136,7 +145,7 @@ ClickBox::on_expose_event (GdkEventExpose *ev)
win->draw_rectangle (bg_gc, true, draw_rect.x, draw_rect.y, draw_rect.width, draw_rect.height);
if (twidth && theight) {
- win->draw_layout (fg_gc, width - (twidth + 2), (height - theight) + 2, layout);
+ win->draw_layout (fg_gc, (width - twidth) / 2, (height - theight) / 2, layout);
}
}
diff --git a/libs/gtkmm2ext/gtkmm2ext/click_box.h b/libs/gtkmm2ext/gtkmm2ext/click_box.h
index c6f2922f3f..e4aee36ebe 100644
--- a/libs/gtkmm2ext/gtkmm2ext/click_box.h
+++ b/libs/gtkmm2ext/gtkmm2ext/click_box.h
@@ -54,6 +54,7 @@ class ClickBox : public Gtk::DrawingArea, public AutoSpin
int theight;
void set_label ();
+ void style_changed (const Glib::RefPtr<Gtk::Style> &);
bool button_press_handler (GdkEventButton *);
bool button_release_handler (GdkEventButton *);