[gimp/metadata-browser] libgimpwidgets: add gtk_scrollbar_new() to gimp3migration.[ch]
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] libgimpwidgets: add gtk_scrollbar_new() to gimp3migration.[ch]
- Date: Fri, 2 Dec 2011 02:00:36 +0000 (UTC)
commit 08fb36bec6f32e3d2a57845b257d33e287641775
Author: Michael Natterer <mitch gimp org>
Date: Sun Oct 2 13:18:10 2011 +0200
libgimpwidgets: add gtk_scrollbar_new() to gimp3migration.[ch]
and use it all over the place.
app/display/gimpdisplayshell.c | 4 ++--
app/widgets/gimpgradienteditor.c | 3 ++-
libgimpwidgets/gimp3migration.c | 10 ++++++++++
libgimpwidgets/gimp3migration.h | 2 ++
libgimpwidgets/gimpscrolledpreview.c | 23 +++++++++++++----------
plug-ins/imagemap/imap_preview.c | 4 ++--
6 files changed, 31 insertions(+), 15 deletions(-)
---
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index 4b97daf..f03de66 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -482,13 +482,13 @@ gimp_display_shell_constructed (GObject *object)
/* the horizontal scrollbar */
shell->hsbdata = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, image_width,
1, 1, image_width));
- shell->hsb = gtk_hscrollbar_new (shell->hsbdata);
+ shell->hsb = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, shell->hsbdata);
gtk_widget_set_can_focus (shell->hsb, FALSE);
/* the vertical scrollbar */
shell->vsbdata = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, image_height,
1, 1, image_height));
- shell->vsb = gtk_vscrollbar_new (shell->vsbdata);
+ shell->vsb = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, shell->vsbdata);
gtk_widget_set_can_focus (shell->vsb, FALSE);
/* create the contents of the inner_table ********************************/
diff --git a/app/widgets/gimpgradienteditor.c b/app/widgets/gimpgradienteditor.c
index ea2cdc0..61d8a5f 100644
--- a/app/widgets/gimpgradienteditor.c
+++ b/app/widgets/gimpgradienteditor.c
@@ -375,7 +375,8 @@ gimp_gradient_editor_init (GimpGradientEditor *editor)
G_CALLBACK (gradient_editor_scrollbar_update),
editor);
- editor->scrollbar = gtk_hscrollbar_new (editor->scroll_data);
+ editor->scrollbar = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL,
+ editor->scroll_data);
gtk_box_pack_start (GTK_BOX (editor), editor->scrollbar, FALSE, FALSE, 0);
gtk_widget_show (editor->scrollbar);
diff --git a/libgimpwidgets/gimp3migration.c b/libgimpwidgets/gimp3migration.c
index 4b81626..0b9d7ce 100644
--- a/libgimpwidgets/gimp3migration.c
+++ b/libgimpwidgets/gimp3migration.c
@@ -46,3 +46,13 @@ gtk_button_box_new (GtkOrientation orientation)
else
return gtk_vbutton_box_new ();
}
+
+GtkWidget *
+gtk_scrollbar_new (GtkOrientation orientation,
+ GtkAdjustment *adjustment)
+{
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ return gtk_hscrollbar_new (adjustment);
+ else
+ return gtk_vscrollbar_new (adjustment);
+}
diff --git a/libgimpwidgets/gimp3migration.h b/libgimpwidgets/gimp3migration.h
index 2ecc8db..273312e 100644
--- a/libgimpwidgets/gimp3migration.h
+++ b/libgimpwidgets/gimp3migration.h
@@ -36,6 +36,8 @@
GtkWidget * gtk_box_new (GtkOrientation orientation,
gint spacing);
GtkWidget * gtk_button_box_new (GtkOrientation orientation);
+GtkWidget * gtk_scrollbar_new (GtkOrientation orientation,
+ GtkAdjustment *adjustment);
#endif /* __GIMP_3_MIGRATION_H__ */
diff --git a/libgimpwidgets/gimpscrolledpreview.c b/libgimpwidgets/gimpscrolledpreview.c
index a6c6ed7..b0097db 100644
--- a/libgimpwidgets/gimpscrolledpreview.c
+++ b/libgimpwidgets/gimpscrolledpreview.c
@@ -24,9 +24,12 @@
#include "libgimpmath/gimpmath.h"
-#include "gimpwidgets.h"
+#include "gimpwidgetstypes.h"
+#include "gimppreviewarea.h"
#include "gimpscrolledpreview.h"
+#include "gimpstock.h"
+#include "gimp3migration.h"
#include "libgimp/libgimp-intl.h"
@@ -146,7 +149,7 @@ gimp_scrolled_preview_init (GimpScrolledPreview *preview)
{
GimpScrolledPreviewPrivate *priv;
GtkWidget *image;
- GtkObject *adj;
+ GtkAdjustment *adj;
preview->priv = G_TYPE_INSTANCE_GET_PRIVATE (preview,
GIMP_TYPE_SCROLLED_PREVIEW,
@@ -163,28 +166,28 @@ gimp_scrolled_preview_init (GimpScrolledPreview *preview)
priv->frozen = 1; /* we are frozen during init */
/* scrollbars */
- adj = gtk_adjustment_new (0, 0, GIMP_PREVIEW (preview)->width - 1, 1.0,
- GIMP_PREVIEW (preview)->width,
- GIMP_PREVIEW (preview)->width);
+ adj = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, GIMP_PREVIEW (preview)->width - 1, 1.0,
+ GIMP_PREVIEW (preview)->width,
+ GIMP_PREVIEW (preview)->width));
g_signal_connect (adj, "value-changed",
G_CALLBACK (gimp_scrolled_preview_h_scroll),
preview);
- preview->hscr = gtk_hscrollbar_new (GTK_ADJUSTMENT (adj));
+ preview->hscr = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, adj);
gtk_table_attach (GTK_TABLE (GIMP_PREVIEW (preview)->table),
preview->hscr, 0, 1, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
- adj = gtk_adjustment_new (0, 0, GIMP_PREVIEW (preview)->height - 1, 1.0,
- GIMP_PREVIEW (preview)->height,
- GIMP_PREVIEW (preview)->height);
+ adj = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, GIMP_PREVIEW (preview)->height - 1, 1.0,
+ GIMP_PREVIEW (preview)->height,
+ GIMP_PREVIEW (preview)->height));
g_signal_connect (adj, "value-changed",
G_CALLBACK (gimp_scrolled_preview_v_scroll),
preview);
- preview->vscr = gtk_vscrollbar_new (GTK_ADJUSTMENT (adj));
+ preview->vscr = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, adj);
gtk_table_attach (GTK_TABLE (GIMP_PREVIEW (preview)->table),
preview->vscr, 1, 2, 0, 1,
GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
diff --git a/plug-ins/imagemap/imap_preview.c b/plug-ins/imagemap/imap_preview.c
index 49a74d8..c577f64 100644
--- a/plug-ins/imagemap/imap_preview.c
+++ b/plug-ins/imagemap/imap_preview.c
@@ -520,12 +520,12 @@ make_preview (GimpDrawable *drawable)
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW(window), preview);
- scrollbar = gtk_hscrollbar_new (hadj);
+ scrollbar = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, hadj);
gtk_table_attach(GTK_TABLE(table), scrollbar, 1, 2, 2, 3,
GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK, 0, 0);
gtk_widget_show (scrollbar);
- scrollbar = gtk_vscrollbar_new (vadj);
+ scrollbar = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, vadj);
gtk_table_attach(GTK_TABLE(table), scrollbar, 2, 3, 1, 2,
GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK, 0, 0);
gtk_widget_show (scrollbar);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]