Re: horizontal space problem with paragraphs (due to listitem plugin?)

"Nickolay V. Shmyrev" <[email protected]>
Newsgroups gmane.editors.conglomerate.devel
Message-ID <[email protected]>
The attached patch fixes some issues with children allocation in cong-
editor-area-border, cong-editor-area-flow-holder and cong-editor-area-
composer. By applying this patch the problem described in previous mail
should be fixed.
patch.diff (text/x-patch, 4.1 KB)
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/conglomerate/src/ChangeLog,v
retrieving revision 1.736
diff -u -r1.736 ChangeLog
--- ChangeLog	15 Oct 2004 16:01:40 -0000	1.736
+++ ChangeLog	16 Oct 2004 22:56:38 -0000
@@ -1,3 +1,9 @@
+2004-10-17 Nickolay V. Shmyrev <[email protected]>
+
+	* cong-editor-area-composer.c, cong-editor-area-flow-holder.c, cong-editor-area-border.c:
+	
+	Fix issues with allocation of children.
+
 2004-10-15  Douglas Burke  <[email protected]>
 
 	* cong-attribute-editor-cdata.c, cong-attribute-editor-cdata.h, cong-attribute-editor-enumeration.c, cong-attribute-editor-lang.c, cong-attribute-editor-lang.h, cong-attribute-editor-nmtoken.c, cong-attribute-editor-nmtoken.h, cong-attribute-editor.c, cong-attribute-editor.h, cong-attribute-wrapper-check-button.c, cong-attribute-wrapper-check-button.h, cong-attribute-wrapper-radio-button.c, cong-attribute-wrapper-radio-button.h, cong-attribute-wrapper.c, cong-attribute-wrapper.h, cong-glade.c:
Index: cong-editor-area-border.c
===================================================================
RCS file: /cvs/gnome/conglomerate/src/cong-editor-area-border.c,v
retrieving revision 1.7
diff -u -r1.7 cong-editor-area-border.c
--- cong-editor-area-border.c	25 Jun 2004 00:33:02 -0000	1.7
+++ cong-editor-area-border.c	16 Oct 2004 22:56:38 -0000
@@ -145,7 +145,7 @@
 	if (child) {
 		child_req = cong_editor_area_get_requisition (child,
 							      orientation,
-							      width_hint);
+							      width_hint - PRIVATE(border)->left_pixels - PRIVATE(border)->right_pixels);
 	} else {
 		child_req = 0;
 	}
Index: cong-editor-area-composer.c
===================================================================
RCS file: /cvs/gnome/conglomerate/src/cong-editor-area-composer.c,v
retrieving revision 1.14
diff -u -r1.14 cong-editor-area-composer.c
--- cong-editor-area-composer.c	25 Jun 2004 00:33:02 -0000	1.14
+++ cong-editor-area-composer.c	16 Oct 2004 22:56:38 -0000
@@ -434,17 +434,14 @@
 	gint x;
 	gint y;
 	const GdkRectangle *rect = cong_editor_area_get_window_coords(area);
-#if 0
-	guint this_width = rect->width;
-	guint this_height = rect->height;
-#else
+
 	guint this_width = cong_editor_area_get_requisition (area, 
 							     GTK_ORIENTATION_HORIZONTAL,
 							     rect->width);
 	guint this_height = cong_editor_area_get_requisition (area, 
 							      GTK_ORIENTATION_VERTICAL,
 							      rect->width);
-#endif
+
 	gint total_surplus_space = 0;
 	gint surplus_space_per_expandable_child = 0;
 	guint num_expandable_children = 0;
@@ -548,6 +545,7 @@
 		
 		if (PRIVATE(area_composer)->orientation == GTK_ORIENTATION_HORIZONTAL) {
 			x += child_req_width + PRIVATE(area_composer)->spacing + extra_offset;
+			this_width -= child_req_width + PRIVATE(area_composer)->spacing + extra_offset;
 		} else {
 			y += child_req_height + PRIVATE(area_composer)->spacing + extra_offset;
 		}
Index: cong-editor-area-flow-holder-inlines.c
===================================================================
RCS file: /cvs/gnome/conglomerate/src/cong-editor-area-flow-holder-inlines.c,v
retrieving revision 1.16
diff -u -r1.16 cong-editor-area-flow-holder-inlines.c
--- cong-editor-area-flow-holder-inlines.c	24 Aug 2004 01:58:27 -0000	1.16
+++ cong-editor-area-flow-holder-inlines.c	16 Oct 2004 22:56:38 -0000
@@ -352,18 +352,6 @@
 {
 	CongEditorAreaFlowHolderInlines *area_flow_holder_inlines = CONG_EDITOR_AREA_FLOW_HOLDER_INLINES(area);
 
-#if 1
-	if (GTK_ORIENTATION_HORIZONTAL==orientation) {
-		return width_hint;
-	} else {
-		g_assert(PRIVATE(area_flow_holder_inlines)->line_composer);
-
-		/* FIXME: do we have a sane way of calculating the height of the inlines yet? */
-		return  cong_editor_area_get_requisition (CONG_EDITOR_AREA(PRIVATE(area_flow_holder_inlines)->line_composer),
-							  orientation,
-							  width_hint);
-	}
-#else
 	if (PRIVATE(area_flow_holder_inlines)->line_composer) {
 
 		return  cong_editor_area_get_requisition (CONG_EDITOR_AREA(PRIVATE(area_flow_holder_inlines)->line_composer),
@@ -372,7 +360,6 @@
 	} else {
 		return 0;
 	}
-#endif
 }
 
 static void
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.