summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2003-10-10 17:18:34 +0000
committerKristian Rietveld <kristian@src.gnome.org>2003-10-10 17:18:34 +0000
commite6100ecd110ab750644b6311bec304f6e1b55622 (patch)
tree5e0e740d0e55c4f281ed6682095e4a8935da8141 /gtk
parent7d9c4f6ea3d542d64f6802be9f1426cb699804d0 (diff)
downloadgdk-pixbuf-e6100ecd110ab750644b6311bec304f6e1b55622.tar.gz
Deprecate. Ditto.
Fri Oct 10 19:10:12 2003 Kristian Rietveld <kris@gtk.org> * gtk/gtkcombo.h: Deprecate. * gtk/gtkoptionmenu.h: Ditto. * gtk/gtkcombobox.c (gtk_combo_box_size_request), (gtk_combo_box_size_allocate): Rework, things behave better now. Still needs some work on requesting enough size when taking the items in the list into account. * gtk/gtkfilesel.c: put gtkoptionmenu.h include inside "enable deprecated" guards. * gtk/gtkinputdialog.c: ditto. * gtk/gtkitemfactory.c: ditto. * gtk/gtkoptionmenu.c: ditto. * demos/gtk-demo/menus.c: remove the option menu. * demos/gtk-demo/sizegroup.c: replace the option menus with GtkComboBox. * demos/gtk-demo/textview.c: ditto. (A general GtkComboBox demo will be added later on).
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkcombo.h4
-rw-r--r--gtk/gtkcombobox.c39
-rw-r--r--gtk/gtkfilesel.c5
-rw-r--r--gtk/gtkinputdialog.c5
-rw-r--r--gtk/gtkitemfactory.c5
-rw-r--r--gtk/gtkoptionmenu.c4
-rw-r--r--gtk/gtkoptionmenu.h4
7 files changed, 35 insertions, 31 deletions
diff --git a/gtk/gtkcombo.h b/gtk/gtkcombo.h
index b3cea09f6..9652dc274 100644
--- a/gtk/gtkcombo.h
+++ b/gtk/gtkcombo.h
@@ -24,6 +24,8 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+#ifndef GTK_DISABLE_DEPRECATED
+
#ifndef __GTK_SMART_COMBO_H__
#define __GTK_SMART_COMBO_H__
@@ -117,4 +119,4 @@ void gtk_combo_disable_activate (GtkCombo* combo);
#endif /* __GTK_SMART_COMBO_H__ */
-
+#endif /* GTK_DISABLE_DEPRECATED */
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 37115eea3..1c0fbeb84 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -891,14 +891,7 @@ gtk_combo_box_size_request (GtkWidget *widget,
bin_req.width = MAX (bin_req.width, combo_box->priv->width);
- /* separator */
- gtk_widget_set_size_request (combo_box->priv->separator,
- -1, bin_req.height);
gtk_widget_size_request (combo_box->priv->separator, &sep_req);
-
- /* arrow */
- gtk_widget_set_size_request (combo_box->priv->arrow,
- -1, bin_req.height);
gtk_widget_size_request (combo_box->priv->arrow, &arrow_req);
height = MAX (sep_req.height, arrow_req.height);
@@ -909,15 +902,13 @@ gtk_combo_box_size_request (GtkWidget *widget,
height += border_width + 1 + xthickness * 2 + 4;
width += border_width + 1 + ythickness * 2 + 4;
- gtk_widget_set_size_request (combo_box->priv->button, width, height);
- gtk_widget_size_request (combo_box->priv->button, requisition);
+ requisition->width = width;
+ requisition->height = height;
}
else
{
GtkRequisition but_req;
- gtk_widget_set_size_request (combo_box->priv->button,
- -1, bin_req.height);
gtk_widget_size_request (combo_box->priv->button, &but_req);
requisition->width = bin_req.width + but_req.width;
@@ -934,17 +925,15 @@ gtk_combo_box_size_request (GtkWidget *widget,
if (combo_box->priv->cell_view_frame)
{
- requisition->width +=
+ requisition->width += 2 *
(GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
- GTK_WIDGET (combo_box->priv->cell_view_frame)->style->xthickness) * 2;
- requisition->height +=
+ GTK_WIDGET (combo_box->priv->cell_view_frame)->style->xthickness);
+ requisition->height += 2 *
(GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
- GTK_WIDGET (combo_box->priv->cell_view_frame)->style->ythickness) * 2;
+ GTK_WIDGET (combo_box->priv->cell_view_frame)->style->ythickness);
}
/* the button */
- gtk_widget_set_size_request (combo_box->priv->button,
- -1, requisition->height);
gtk_widget_size_request (combo_box->priv->button, &button_req);
requisition->height = MAX (requisition->height, button_req.height);
@@ -985,13 +974,12 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
/* handle the childs */
gtk_widget_size_request (combo_box->priv->arrow, &req);
child.width = req.width;
- child.height = req.height;
+ child.height = allocation->height - 2 * (child.y - allocation->y);
child.x += width - req.width;
gtk_widget_size_allocate (combo_box->priv->arrow, &child);
gtk_widget_size_request (combo_box->priv->separator, &req);
child.width = req.width;
- child.height = req.height;
child.x -= req.width;
gtk_widget_size_allocate (combo_box->priv->separator, &child);
@@ -999,8 +987,6 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
child.x = allocation->x + border_width + 1 + xthickness + 2;
child.width -= child.x;
- gtk_widget_size_request (GTK_BIN (widget)->child, &req);
- child.height = req.height;
gtk_widget_size_allocate (GTK_BIN (widget)->child, &child);
}
else
@@ -1027,13 +1013,14 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
child.x = allocation->x + allocation->width - req.width;
child.y = allocation->y;
child.width = req.width;
- child.height = req.height;
+ child.height = allocation->height;
gtk_widget_size_allocate (combo_box->priv->button, &child);
/* frame */
child.x = allocation->x;
child.y = allocation->y;
child.width = allocation->width - req.width;
+ child.height = allocation->height;
if (combo_box->priv->cell_view_frame)
{
@@ -1046,12 +1033,12 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
child.y +=
GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
GTK_WIDGET (combo_box->priv->cell_view_frame)->style->ythickness;
- child.width -=
+ child.width -= 2 * (
GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
- GTK_WIDGET (combo_box->priv->cell_view_frame)->style->xthickness;
- child.height -=
+ GTK_WIDGET (combo_box->priv->cell_view_frame)->style->xthickness);
+ child.height -= 2 * (
GTK_CONTAINER (combo_box->priv->cell_view_frame)->border_width +
- GTK_WIDGET (combo_box->priv->cell_view_frame)->style->ythickness;
+ GTK_WIDGET (combo_box->priv->cell_view_frame)->style->ythickness);
}
gtk_widget_size_allocate (GTK_BIN (combo_box)->child, &child);
diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c
index 90e8e2b46..e2fcb465d 100644
--- a/gtk/gtkfilesel.c
+++ b/gtk/gtkfilesel.c
@@ -73,12 +73,15 @@
#include "gtkvbox.h"
#include "gtkmenu.h"
#include "gtkmenuitem.h"
-#include "gtkoptionmenu.h"
#include "gtkdialog.h"
#include "gtkmessagedialog.h"
#include "gtkdnd.h"
#include "gtkeventbox.h"
+#undef GTK_DISABLE_DEPRECATED
+#include "gtkoptionmenu.h"
+#define GTK_DISABLE_DEPRECATED
+
#define WANT_HPANED 1
#include "gtkhpaned.h"
diff --git a/gtk/gtkinputdialog.c b/gtk/gtkinputdialog.c
index 1e59f643e..cbbda5ca9 100644
--- a/gtk/gtkinputdialog.c
+++ b/gtk/gtkinputdialog.c
@@ -47,12 +47,15 @@
#include "gtkmenu.h"
#include "gtkmenuitem.h"
#include "gtknotebook.h"
-#include "gtkoptionmenu.h"
#include "gtkscrolledwindow.h"
#include "gtkstock.h"
#include "gtktable.h"
#include "gtkvbox.h"
+#undef GTK_DISABLE_DEPRECATED
+#include "gtkoptionmenu.h"
+#define GTK_DISABLE_DEPRECATED
+
#include "gtkintl.h"
typedef struct _GtkInputDialogPrivate GtkInputDialogPrivate;
diff --git a/gtk/gtkitemfactory.c b/gtk/gtkitemfactory.c
index 6e79c5e33..5fcb63eeb 100644
--- a/gtk/gtkitemfactory.c
+++ b/gtk/gtkitemfactory.c
@@ -30,7 +30,6 @@
#include "config.h"
#include "gtkitemfactory.h"
-#include "gtk/gtkoptionmenu.h"
#include "gtk/gtkmenubar.h"
#include "gtk/gtkmenu.h"
#include "gtk/gtkmenuitem.h"
@@ -51,6 +50,10 @@
#endif
#include <stdio.h>
+#undef GTK_DISABLE_DEPRECATED
+#include "gtk/gtkoptionmenu.h"
+#define GTK_DISABLE_DEPRECATED
+
/* --- defines --- */
#define ITEM_FACTORY_STRING ((gchar*) item_factory_string)
#define ITEM_BLOCK_SIZE (128)
diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c
index afab0ab13..2c8dac123 100644
--- a/gtk/gtkoptionmenu.c
+++ b/gtk/gtkoptionmenu.c
@@ -27,10 +27,12 @@
#include "gtkintl.h"
#include "gtkmenu.h"
#include "gtkmenuitem.h"
-#include "gtkoptionmenu.h"
#include "gtkmarshalers.h"
#include "gdk/gdkkeysyms.h"
+#undef GTK_DISABLE_DEPRECATED
+#include "gtkoptionmenu.h"
+#define GTK_DISABLE_DEPRECATED
#define CHILD_LEFT_SPACING 4
#define CHILD_RIGHT_SPACING 1
diff --git a/gtk/gtkoptionmenu.h b/gtk/gtkoptionmenu.h
index e692ca088..41d4d9c48 100644
--- a/gtk/gtkoptionmenu.h
+++ b/gtk/gtkoptionmenu.h
@@ -24,6 +24,8 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+#ifndef GTK_DISABLE_DEPRECATED
+
#ifndef __GTK_OPTION_MENU_H__
#define __GTK_OPTION_MENU_H__
@@ -90,3 +92,5 @@ void gtk_option_menu_set_history (GtkOptionMenu *option_menu,
#endif /* __GTK_OPTION_MENU_H__ */
+
+#endif /* GTK_DISABLE_DEPRECATED */