diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-11-10 03:53:52 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-12-01 16:17:15 +0000 |
| commit | 4d1ba71e8d611170cf35345343f82de639db9aa4 (patch) | |
| tree | 5e78b4cdec9bbd1862a492746ff2b9d1b3f6e772 /src/desktop.cpp | |
| parent | Working with canvas to split (diff) | |
| download | inkscape-4d1ba71e8d611170cf35345343f82de639db9aa4.tar.gz inkscape-4d1ba71e8d611170cf35345343f82de639db9aa4.zip | |
Handling cursor for dragin split
Diffstat (limited to 'src/desktop.cpp')
| -rw-r--r-- | src/desktop.cpp | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp index b3065c2d4..7cb90ebb2 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -910,6 +910,62 @@ Geom::Rect SPDesktop::get_display_area() const return viewbox * Geom::Scale(1. / scale, _doc2dt[3] / scale); } +guint +SPDesktop::get_hruler_thickness() +{ + Gtk::Window *parent = getToplevel(); + if (parent) { + SPDesktopWidget *dtw = static_cast<SPDesktopWidget *>(parent->get_data("desktopwidget")); + GtkAllocation allocation; + gtk_widget_get_allocation(dtw->hruler, &allocation); + return allocation.height; + } + return 0; +} + +guint +SPDesktop::get_vruler_thickness() +{ + Gtk::Window *parent = getToplevel(); + if (parent) { + SPDesktopWidget *dtw = static_cast<SPDesktopWidget *>(parent->get_data("desktopwidget")); + GtkAllocation allocation; + gtk_widget_get_allocation(dtw->vruler, &allocation); + return allocation.width; + } + return 0; +} + +guint +SPDesktop::get_hscrool_thickness() +{ + Gtk::Window *parent = getToplevel(); + if (parent) { + SPDesktopWidget *dtw = static_cast<SPDesktopWidget *>(parent->get_data("desktopwidget")); + GtkAllocation allocation; + gtk_widget_get_allocation(dtw->hscrollbar, &allocation); + return allocation.height; + } + return 0; +} + +guint +SPDesktop::get_vscrool_thickness() +{ + Gtk::Window *parent = getToplevel(); + if (parent) { + SPDesktopWidget *dtw = static_cast<SPDesktopWidget *>(parent->get_data("desktopwidget")); + GtkAllocation allocation; + gtk_widget_get_allocation(dtw->vscrollbar_box, &allocation); + return allocation.width; + } + return 0; +} + + int get_hruler_thickness(); + int get_vruler_thickness(); + int get_vscrool_thickness(); + int get_hscrool_thickness(); /** * Zoom keeping the point 'c' fixed in the desktop window. @@ -1555,7 +1611,8 @@ void SPDesktop::toggleSplitMode() dtw->splitCanvas(_split_canvas); GtkAllocation allocation; gtk_widget_get_allocation(GTK_WIDGET(dtw->canvas), &allocation); - getCanvas()->requestRedraw(getCanvas()->_x0, getCanvas()->_y0, getCanvas()->_x0 + allocation.width, getCanvas()->_y0 + allocation.height); + SPCanvas * canvas = getCanvas(); + canvas->requestRedraw(canvas->_x0, canvas->_y0, canvas->_x0 + allocation.width, canvas->_y0 + allocation.height); } } |
