summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2012-12-28 18:54:09 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2012-12-28 18:54:09 +0000
commit1ffbb515a01b536b00f5542d6a01fc2ad7be0aec (patch)
tree0bfd3e079eb7a50b6c217d227ddbbc9e2d8219cf /src
parentCorrect sizing in primitives list in filter-effects dialog (diff)
downloadinkscape-1ffbb515a01b536b00f5542d6a01fc2ad7be0aec.tar.gz
inkscape-1ffbb515a01b536b00f5542d6a01fc2ad7be0aec.zip
Fix GTK+ 3 drawing of primitives list in filter effects dialog
Fixed bugs: - https://launchpad.net/bugs/1066808 (bzr r11997)
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp20
-rw-r--r--src/ui/dialog/filter-effects-dialog.h2
2 files changed, 13 insertions, 9 deletions
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 685781685..7574b9266 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -1517,8 +1517,8 @@ FilterEffectsDialog::PrimitiveList::PrimitiveList(FilterEffectsDialog& d)
_observer(new Inkscape::XML::SignalObserver)
{
#if WITH_GTKMM_3_0
- d.signal_draw().connect(sigc::mem_fun(*this, &PrimitiveList::on_draw));
- signal_draw().connect(sigc::mem_fun(*this, &PrimitiveList::on_draw));
+ d.signal_draw().connect(sigc::mem_fun(*this, &PrimitiveList::on_draw_signal));
+ signal_draw().connect(sigc::mem_fun(*this, &PrimitiveList::on_draw_signal));
#else
d.signal_expose_event().connect(sigc::mem_fun(*this, &PrimitiveList::on_expose_signal));
signal_expose_event().connect(sigc::mem_fun(*this, &PrimitiveList::on_expose_signal));
@@ -1688,25 +1688,29 @@ void FilterEffectsDialog::PrimitiveList::remove_selected()
bool FilterEffectsDialog::PrimitiveList::on_expose_signal(GdkEventExpose *e)
{
bool result = false;
- Glib::RefPtr<Gdk::Window> win = get_bin_window();
if (get_is_drawable())
{
- Cairo::RefPtr<Cairo::Context> cr = win->create_cairo_context();
- cr->rectangle(e->area.x, e->area.y, e->area.width, e->area.height);
- cr->clip();
- result = on_draw(cr);
+ Cairo::RefPtr<Cairo::Context> cr = get_bin_window()->create_cairo_context();
+ result = on_draw_signal(cr);
}
return result;
}
#endif
-bool FilterEffectsDialog::PrimitiveList::on_draw(const Cairo::RefPtr<Cairo::Context> &cr)
+bool FilterEffectsDialog::PrimitiveList::on_draw_signal(const Cairo::RefPtr<Cairo::Context> & cr)
{
cr->set_line_width(1.0);
#if GTK_CHECK_VERSION(3,0,0)
+ // In GTK+ 3, the draw function receives the widget window, not the
+ // bin_window (i.e., just the area under the column headers). We
+ // therefore translate the origin of our coordinate system to account for this
+ int x_origin, y_origin;
+ convert_bin_window_to_widget_coords(0,0,x_origin,y_origin);
+ cr->translate(x_origin, y_origin);
+
GtkStyleContext *sc = gtk_widget_get_style_context(GTK_WIDGET(gobj()));
GdkRGBA bg_color, fg_color;
gtk_style_context_get_background_color(sc, GTK_STATE_FLAG_NORMAL, &bg_color);
diff --git a/src/ui/dialog/filter-effects-dialog.h b/src/ui/dialog/filter-effects-dialog.h
index 82dc6b808..355a8b1b2 100644
--- a/src/ui/dialog/filter-effects-dialog.h
+++ b/src/ui/dialog/filter-effects-dialog.h
@@ -197,7 +197,7 @@ private:
int get_input_type_width() const;
protected:
- bool on_draw(const Cairo::RefPtr<Cairo::Context> &cr);
+ bool on_draw_signal(const Cairo::RefPtr<Cairo::Context> &cr);
#if !WITH_GTKMM_3_0
bool on_expose_signal(GdkEventExpose*);