summaryrefslogtreecommitdiff
path: root/libs/gtkmm2ext/cairocell.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-06-02 21:43:10 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-06-02 21:43:10 +0000
commit11bcfd84296d5c4224e94bbae606180c5b58ef5b (patch)
tree97fa2121d4ba3330795ee68f4bd5d99e5ec09e41 /libs/gtkmm2ext/cairocell.cc
parent811acc5e6ed88a8268791f7a0520d36b350f6414 (diff)
add extended info fields to clocks; clock tweaks
git-svn-id: svn://localhost/ardour2/branches/3.0@9675 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/gtkmm2ext/cairocell.cc')
-rw-r--r--libs/gtkmm2ext/cairocell.cc35
1 files changed, 25 insertions, 10 deletions
diff --git a/libs/gtkmm2ext/cairocell.cc b/libs/gtkmm2ext/cairocell.cc
index 6f9a53e314..6de397b1f3 100644
--- a/libs/gtkmm2ext/cairocell.cc
+++ b/libs/gtkmm2ext/cairocell.cc
@@ -111,9 +111,9 @@ CairoEditableText::CairoEditableText ()
, width (0)
, max_cell_height (0)
, height (0)
- , corner_radius (18)
- , xpad (10)
- , ypad (5)
+ , _corner_radius (9)
+ , _xpad (5)
+ , _ypad (5)
{
add_events (Gdk::POINTER_MOTION_HINT_MASK | Gdk::SCROLL_MASK | Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK |
Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::SCROLL_MASK);
@@ -207,7 +207,11 @@ CairoEditableText::on_expose_event (GdkEventExpose* ev)
context->clip ();
context->set_source_rgba (bg_r, bg_g, bg_b, bg_a);
- rounded_rectangle (context, 0, 0, width, height, corner_radius);
+ if (_corner_radius) {
+ rounded_rectangle (context, 0, 0, width, height, _corner_radius);
+ } else {
+ context->rectangle (0, 0, width, height);
+ }
context->fill ();
for (CellMap::iterator i = cells.begin(); i != cells.end(); ++i) {
@@ -324,23 +328,34 @@ CairoEditableText::on_size_request (GtkRequisition* req)
max_cell_height = 0;
- x = xpad;
+ x = _xpad;
- for (CellMap::iterator i = cells.begin(); i != cells.end(); ++i) {
+ CellMap::iterator i = cells.begin();
+
+ while (i != cells.end()) {
CairoCell* cell = i->second;
if (cell->visible()) {
- cell->set_position (x, ypad);
+ cell->set_position (x, _ypad);
}
- x += cell->width() + cell->xpad();
+ x += cell->width();
max_cell_height = std::max ((double) cell->height(), max_cell_height);
+
+ ++i;
+
+ if (i != cells.end()) {
+ /* only add cell padding intra-cellularly */
+ x += cell->xpad();
+ } else {
+ break;
+ }
}
- x += xpad;
+ x += _xpad;
req->width = x;
- req->height = max_cell_height + (ypad * 2);
+ req->height = max_cell_height + (_ypad * 2);
}
void