From ee489eafb07e12f09b2e708eeeeb1b386710a485 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Tue, 23 Dec 1997 20:13:14 +0000 Subject: [PATCH] this macro computes the spacing from klass->scrollbar_spacing now. adapted * gtk/gtkscrolledwindow.c (SCROLLBAR_SPACING): this macro computes the spacing from klass->scrollbar_spacing now. adapted all functions that used this macro (based on a patch from Patrice Fortier). * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindowClass): added scrollbar_spacing to substitute a define (patch from Patrice Fortier). -timj --- ChangeLog | 6 ++++++ ChangeLog.pre-2-0 | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkscrolledwindow.c | 14 +++++++------- gtk/gtkscrolledwindow.h | 2 ++ 9 files changed, 51 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b1466863..7111f2a41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ Tue Dec 23 03:03:17 1997 Tim Janik + * gtk/gtkscrolledwindow.c (SCROLLBAR_SPACING): this macro computes + the spacing from klass->scrollbar_spacing now. adapted all functions + that used this macro (based on a patch from Patrice Fortier). + * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindowClass): added + scrollbar_spacing to substitute a define (patch from Patrice Fortier). + * gtk/gtkrc.h (gtk_rc_parse_string): new function. * gtk/gtkrc.c: many functions adapted to use GScanner for scanning. (gtk_rc_parse): use gtk_rc_parse_any for parsing. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 3b1466863..7111f2a41 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,5 +1,11 @@ Tue Dec 23 03:03:17 1997 Tim Janik + * gtk/gtkscrolledwindow.c (SCROLLBAR_SPACING): this macro computes + the spacing from klass->scrollbar_spacing now. adapted all functions + that used this macro (based on a patch from Patrice Fortier). + * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindowClass): added + scrollbar_spacing to substitute a define (patch from Patrice Fortier). + * gtk/gtkrc.h (gtk_rc_parse_string): new function. * gtk/gtkrc.c: many functions adapted to use GScanner for scanning. (gtk_rc_parse): use gtk_rc_parse_any for parsing. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 3b1466863..7111f2a41 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,11 @@ Tue Dec 23 03:03:17 1997 Tim Janik + * gtk/gtkscrolledwindow.c (SCROLLBAR_SPACING): this macro computes + the spacing from klass->scrollbar_spacing now. adapted all functions + that used this macro (based on a patch from Patrice Fortier). + * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindowClass): added + scrollbar_spacing to substitute a define (patch from Patrice Fortier). + * gtk/gtkrc.h (gtk_rc_parse_string): new function. * gtk/gtkrc.c: many functions adapted to use GScanner for scanning. (gtk_rc_parse): use gtk_rc_parse_any for parsing. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 3b1466863..7111f2a41 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,5 +1,11 @@ Tue Dec 23 03:03:17 1997 Tim Janik + * gtk/gtkscrolledwindow.c (SCROLLBAR_SPACING): this macro computes + the spacing from klass->scrollbar_spacing now. adapted all functions + that used this macro (based on a patch from Patrice Fortier). + * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindowClass): added + scrollbar_spacing to substitute a define (patch from Patrice Fortier). + * gtk/gtkrc.h (gtk_rc_parse_string): new function. * gtk/gtkrc.c: many functions adapted to use GScanner for scanning. (gtk_rc_parse): use gtk_rc_parse_any for parsing. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 3b1466863..7111f2a41 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,5 +1,11 @@ Tue Dec 23 03:03:17 1997 Tim Janik + * gtk/gtkscrolledwindow.c (SCROLLBAR_SPACING): this macro computes + the spacing from klass->scrollbar_spacing now. adapted all functions + that used this macro (based on a patch from Patrice Fortier). + * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindowClass): added + scrollbar_spacing to substitute a define (patch from Patrice Fortier). + * gtk/gtkrc.h (gtk_rc_parse_string): new function. * gtk/gtkrc.c: many functions adapted to use GScanner for scanning. (gtk_rc_parse): use gtk_rc_parse_any for parsing. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 3b1466863..7111f2a41 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,11 @@ Tue Dec 23 03:03:17 1997 Tim Janik + * gtk/gtkscrolledwindow.c (SCROLLBAR_SPACING): this macro computes + the spacing from klass->scrollbar_spacing now. adapted all functions + that used this macro (based on a patch from Patrice Fortier). + * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindowClass): added + scrollbar_spacing to substitute a define (patch from Patrice Fortier). + * gtk/gtkrc.h (gtk_rc_parse_string): new function. * gtk/gtkrc.c: many functions adapted to use GScanner for scanning. (gtk_rc_parse): use gtk_rc_parse_any for parsing. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 3b1466863..7111f2a41 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,11 @@ Tue Dec 23 03:03:17 1997 Tim Janik + * gtk/gtkscrolledwindow.c (SCROLLBAR_SPACING): this macro computes + the spacing from klass->scrollbar_spacing now. adapted all functions + that used this macro (based on a patch from Patrice Fortier). + * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindowClass): added + scrollbar_spacing to substitute a define (patch from Patrice Fortier). + * gtk/gtkrc.h (gtk_rc_parse_string): new function. * gtk/gtkrc.c: many functions adapted to use GScanner for scanning. (gtk_rc_parse): use gtk_rc_parse_any for parsing. diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 79cc67aaf..8c1c9dc39 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -19,7 +19,7 @@ #include "gtksignal.h" -#define SCROLLBAR_SPACING 5 +#define SCROLLBAR_SPACING(w) (GTK_SCROLLED_WINDOW_CLASS (GTK_OBJECT (w)->klass)->scrollbar_spacing) static void gtk_scrolled_window_class_init (GtkScrolledWindowClass *klass); @@ -310,7 +310,7 @@ gtk_scrolled_window_size_request (GtkWidget *widget, &scrolled_window->hscrollbar->requisition); requisition->width = MAX (requisition->width, scrolled_window->hscrollbar->requisition.width); - extra_height = SCROLLBAR_SPACING + scrolled_window->hscrollbar->requisition.height; + extra_height = SCROLLBAR_SPACING (scrolled_window) + scrolled_window->hscrollbar->requisition.height; } if ((scrolled_window->vscrollbar_policy == GTK_POLICY_AUTOMATIC) || @@ -320,7 +320,7 @@ gtk_scrolled_window_size_request (GtkWidget *widget, &scrolled_window->vscrollbar->requisition); requisition->height = MAX (requisition->height, scrolled_window->vscrollbar->requisition.height); - extra_width = SCROLLBAR_SPACING + scrolled_window->vscrollbar->requisition.width; + extra_width = SCROLLBAR_SPACING (scrolled_window) + scrolled_window->vscrollbar->requisition.width; } requisition->width += GTK_CONTAINER (widget)->border_width * 2 + extra_width; @@ -369,7 +369,7 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget, if (GTK_WIDGET_VISIBLE (scrolled_window->hscrollbar)) { child_allocation.x = viewport_allocation.x; - child_allocation.y = viewport_allocation.y + viewport_allocation.height + SCROLLBAR_SPACING; + child_allocation.y = viewport_allocation.y + viewport_allocation.height + SCROLLBAR_SPACING (scrolled_window); child_allocation.width = viewport_allocation.width; child_allocation.height = scrolled_window->hscrollbar->requisition.height; child_allocation.x += allocation->x; @@ -380,7 +380,7 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget, if (GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar)) { - child_allocation.x = viewport_allocation.x + viewport_allocation.width + SCROLLBAR_SPACING; + child_allocation.x = viewport_allocation.x + viewport_allocation.width + SCROLLBAR_SPACING (scrolled_window); child_allocation.y = viewport_allocation.y; child_allocation.width = scrolled_window->vscrollbar->requisition.width; child_allocation.height = viewport_allocation.height; @@ -454,9 +454,9 @@ gtk_scrolled_window_viewport_allocate (GtkWidget *widget, allocation->height = widget->allocation.height - allocation->y * 2; if (GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar)) - allocation->width -= scrolled_window->vscrollbar->requisition.width + SCROLLBAR_SPACING; + allocation->width -= scrolled_window->vscrollbar->requisition.width + SCROLLBAR_SPACING (scrolled_window); if (GTK_WIDGET_VISIBLE (scrolled_window->hscrollbar)) - allocation->height -= scrolled_window->hscrollbar->requisition.height + SCROLLBAR_SPACING; + allocation->height -= scrolled_window->hscrollbar->requisition.height + SCROLLBAR_SPACING (scrolled_window); } static void diff --git a/gtk/gtkscrolledwindow.h b/gtk/gtkscrolledwindow.h index 34a01ef6c..54ed5637e 100644 --- a/gtk/gtkscrolledwindow.h +++ b/gtk/gtkscrolledwindow.h @@ -53,6 +53,8 @@ struct _GtkScrolledWindow struct _GtkScrolledWindowClass { GtkContainerClass parent_class; + + gint scrollbar_spacing; }; -- 2.43.2