backport: statusbar code needed for GTK+ >= 2.19.1 (#559726)

This commit is contained in:
Nils Philippsen 2010-03-25 09:02:31 +00:00
parent 63415c8a9d
commit 43320f6182
2 changed files with 86 additions and 1 deletions

79
gimp-2.6.8-gtk219.patch Normal file
View File

@ -0,0 +1,79 @@
From 59f3ad346b22c85618b0c7cffcce4d1c816ca3b6 Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com>
Date: Wed, 24 Mar 2010 18:08:01 +0100
Subject: [PATCH] patch: gtk219
Squashed commit of the following:
commit 726878e604e663488757a3220246c2054f54b843
Author: Nils Philippsen <nils@redhat.com>
Date: Wed Mar 24 15:43:10 2010 +0100
backport statusbar code needed for GTK+ >= 2.19.1
Use the hbox that is provided via gtk_statusbar_get_message_area()
since GTK+ 2.19.1.
---
app/display/gimpstatusbar.c | 32 +++++++++++++++++++++++++-------
1 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c
index 5e89427..36651cd 100644
--- a/app/display/gimpstatusbar.c
+++ b/app/display/gimpstatusbar.c
@@ -49,6 +49,9 @@
/* maximal width of the string holding the cursor-coordinates */
#define CURSOR_LEN 256
+/* the spacing of the hbox */
+#define HBOX_SPACING 1
+
/* spacing between the icon and the statusbar label */
#define ICON_SPACING 2
@@ -152,6 +155,7 @@ static void
gimp_statusbar_init (GimpStatusbar *statusbar)
{
GtkWidget *hbox;
+ GtkWidget *label;
GtkWidget *image;
GimpUnitStore *store;
@@ -171,13 +175,27 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
statusbar->progress_active = FALSE;
statusbar->progress_shown = FALSE;
- /* remove the label and insert a hbox */
- gtk_container_remove (GTK_CONTAINER (GTK_STATUSBAR (statusbar)->frame),
- g_object_ref (GTK_STATUSBAR (statusbar)->label));
-
- hbox = gtk_hbox_new (FALSE, 1);
- gtk_container_add (GTK_CONTAINER (GTK_STATUSBAR (statusbar)->frame), hbox);
- gtk_widget_show (hbox);
+ label = g_object_ref (GTK_STATUSBAR (statusbar)->label);
+
+ /* remove the message area or label and insert a hbox */
+#if GTK_CHECK_VERSION (2, 19, 1)
+ {
+ hbox = gtk_statusbar_get_message_area (GTK_STATUSBAR (statusbar));
+ gtk_box_set_spacing (GTK_BOX (hbox), HBOX_SPACING);
+ gtk_container_remove (GTK_CONTAINER (hbox), label);
+ }
+#else
+ {
+ GtkWidget *label_parent;
+
+ label_parent = gtk_widget_get_parent (label);
+ gtk_container_remove (GTK_CONTAINER (label_parent), label);
+
+ hbox = gtk_hbox_new (FALSE, HBOX_SPACING);
+ gtk_container_add (GTK_CONTAINER (label_parent), hbox);
+ gtk_widget_show (hbox);
+ }
+#endif
statusbar->cursor_label = gtk_label_new ("8888, 8888");
gtk_misc_set_alignment (GTK_MISC (statusbar->cursor_label), 0.5, 0.5);
--
1.6.6.1

View File

@ -31,7 +31,7 @@ Summary: GNU Image Manipulation Program
Name: gimp
Epoch: 2
Version: 2.6.8
Release: 5%{?dist}
Release: 6%{?dist}
%define binver 2.6
%define gimp_lang_ver 20
%define interfacever 2.0
@ -128,6 +128,8 @@ Patch1: gimp-2.6.7-jpeg-units.patch
Patch2: gimp-2.6.6-minimize-dialogs.patch
# backport: fix building with "gold" linker
Patch3: gimp-2.6.8-gold.patch
# backport: statusbar code needed for GTK+ >= 2.19.1 (#559726)
Patch4: gimp-2.6.8-gtk219.patch
# Makefile.in files generated by Makefile.am changed in patches
Patch10: gimp-2.6.8-4-automake.patch.bz2
@ -213,6 +215,7 @@ EOF
%patch1 -p1 -b .jpeg-units
%patch2 -p1 -b .minimize-dialogs
%patch3 -p1 -b .gold
%patch4 -p1 -b .gtk219
%patch10 -p1 -b .automake
%build
@ -504,6 +507,9 @@ fi
%{_libdir}/gimp/%{interfacever}/plug-ins/help-browser
%changelog
* Wed Mar 24 2010 Nils Philippsen <nils@redhat.com> - 2:2.6.8-6
- backport: statusbar code needed for GTK+ >= 2.19.1 (#559726)
* Fri Feb 26 2010 Nils Philippsen <nils@redhat.com> - 2:2.6.8-5
- require gtk-doc in devel package