--- gigedit/trunk/src/gigedit/wrapLabel.cc 2008/12/06 13:49:26 1799 +++ gigedit/trunk/src/gigedit/wrapLabel.cc 2011/03/06 07:51:04 2169 @@ -51,7 +51,8 @@ */ WrapLabel::WrapLabel(const Glib::ustring &text) // IN: The label text - : mWrapWidth(0) + : mWrapWidth(0), + mWrapHeight(0) { get_layout()->set_wrap(Pango::WRAP_WORD_CHAR); set_alignment(0.0, 0.0); @@ -132,15 +133,21 @@ void WrapLabel::on_size_request(Gtk::Requisition *req) // OUT: Our requested size { - int width; - int height; - - get_layout()->get_pixel_size(width, height); - req->width = 0; - req->height = height; + req->height = mWrapHeight; +} + +// Gigedit addtion: gtk 3 compatibility +void WrapLabel::get_preferred_width_vfunc(int& minimum_width, int& natural_width) const +{ + minimum_width = natural_width = 0; } +// Gigedit addtion: gtk 3 compatibility +void WrapLabel::get_preferred_height_vfunc(int& minimum_height, int& natural_height) const +{ + minimum_height = natural_height = mWrapHeight; +} /* *----------------------------------------------------------------------------- @@ -185,7 +192,7 @@ */ void -WrapLabel::SetWrapWidth(size_t width) // IN: The wrap width +WrapLabel::SetWrapWidth(int width) // IN: The wrap width { if (width == 0) { return; @@ -197,6 +204,9 @@ */ get_layout()->set_width(width * Pango::SCALE); + int unused; + get_layout()->get_pixel_size(unused, mWrapHeight); + if (mWrapWidth != width) { mWrapWidth = width; queue_resize();