[gnumeric] SheetControlGUI: Fix minor sizing issue.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] SheetControlGUI: Fix minor sizing issue.
- Date: Fri, 28 Feb 2014 16:39:31 +0000 (UTC)
commit 85ba6111f4f0b1f49723b910e92bfb214e0108da
Author: Morten Welinder <terra gnome org>
Date: Fri Feb 28 11:38:54 2014 -0500
SheetControlGUI: Fix minor sizing issue.
ChangeLog | 3 +++
src/sheet-control-gui.c | 21 ++++++++++++---------
2 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1286a0f..573ec1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2014-02-28 Morten Welinder <terra gnome org>
+ * src/sheet-control-gui.c (resize_pane_pos): If row/column canvas
+ is not visible, ignore them.
+
* src/ssdiff.c (diff_sheets_attrs): Detect more sheet attribute
changes.
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index 892f3b4..09f74ea 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -1247,17 +1247,19 @@ resize_pane_pos (SheetControlGUI *scg, GtkPaned *p,
int *colrow_result, gint64 *guide_pos)
{
ColRowInfo const *cri;
- GnmPane const *pane = scg_pane (scg, 0);
- gboolean const vert = (p == scg->hpane);
+ GnmPane const *pane = scg_pane (scg, 0);
+ gboolean const vert = (p == scg->hpane);
int colrow, handle;
gint64 pos = gtk_paned_get_position (p);
gtk_widget_style_get (GTK_WIDGET (p), "handle-size", &handle, NULL);
pos += handle / 2;
if (vert) {
- GtkAllocation ca;
- gtk_widget_get_allocation (GTK_WIDGET (scg->pane[0]->row.canvas), &ca);
- pos -= ca.width;
+ if (gtk_widget_get_visible (GTK_WIDGET (pane->row.canvas))) {
+ GtkAllocation ca;
+ gtk_widget_get_allocation (GTK_WIDGET (pane->row.canvas), &ca);
+ pos -= ca.width;
+ }
if (scg->pane[1]) {
GtkAllocation pa;
gtk_widget_get_allocation (GTK_WIDGET (scg->pane[1]),
@@ -1271,10 +1273,11 @@ resize_pane_pos (SheetControlGUI *scg, GtkPaned *p,
pos += pane->first_offset.x;
colrow = gnm_pane_find_col (pane, pos, guide_pos);
} else {
- GtkAllocation ca;
- gtk_widget_get_allocation (GTK_WIDGET (scg->pane[0]->col.canvas), &ca);
-
- pos -= ca.height;
+ if (gtk_widget_get_visible (GTK_WIDGET (pane->col.canvas))) {
+ GtkAllocation ca;
+ gtk_widget_get_allocation (GTK_WIDGET (pane->col.canvas), &ca);
+ pos -= ca.height;
+ }
if (scg->pane[3]) {
GtkAllocation pa;
gtk_widget_get_allocation (GTK_WIDGET (scg->pane[3]),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]