summaryrefslogtreecommitdiffstats
path: root/views/widget/gtk_views_fixed.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-15 17:19:26 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-15 17:19:26 +0000
commit47aeffb5c6da28dacae6d0457b6ae8966c169e23 (patch)
tree6ecbf5ed9aa921577890a1a0c1d87fee579a6bbb /views/widget/gtk_views_fixed.h
parentf4abfbb568e292857badbf4cfd1787ca66e02376 (diff)
downloadchromium_src-47aeffb5c6da28dacae6d0457b6ae8966c169e23.zip
chromium_src-47aeffb5c6da28dacae6d0457b6ae8966c169e23.tar.gz
chromium_src-47aeffb5c6da28dacae6d0457b6ae8966c169e23.tar.bz2
Fixes two related bugs:
. Native buttons were adding 8 pixels to each side of the preferred size. This isn't necessary on Gtk as the preferred size already includes padding. . I changed WidgetGtk so that it no longer needs to explicitly set a size request. Explicitly setting a size request is a bit of pain because it means you can't ask for the widget real size request without unsetting the explicit size request. Instead I've subclassed GtkFixed so that you can either have the default behavior, or use the allocated size rather than current size. CHROME_OS_BUG=1003 TEST=see bug Review URL: http://codereview.chromium.org/504003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34564 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/gtk_views_fixed.h')
-rw-r--r--views/widget/gtk_views_fixed.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/views/widget/gtk_views_fixed.h b/views/widget/gtk_views_fixed.h
new file mode 100644
index 0000000..8fa3b80
--- /dev/null
+++ b/views/widget/gtk_views_fixed.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef VIEWS_WIDGET_GTK_VIEWS_FIXED_H_
+#define VIEWS_WIDGET_GTK_VIEWS_FIXED_H_
+
+#include <gdk/gdk.h>
+#include <gtk/gtkfixed.h>
+
+// GtkViewsFixed is a subclass of GtkFixed that can give child widgets their
+// current size rather than their requested size. This behavior is controlled
+// by gtk_views_fixed_set_use_allocated_size; the default is to use the
+// Widget's requested size.
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_VIEWS_FIXED (gtk_views_fixed_get_type ())
+#define GTK_VIEWS_FIXED(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_VIEWS_FIXED, GtkViewsFixed))
+#define GTK_VIEWS_FIXED_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_VIEWS_FIXED, GtkViewsFixedClass))
+#define GTK_IS_VIEWS_FIXED(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VIEWS_FIXED))
+#define GTK_IS_VIEWS_FIXED_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VIEWS_FIXED))
+#define GTK_VIEWS_FIXED_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_VIEWS_FIXED, GtkViewsFixed))
+
+typedef struct _GtkViewsFixed GtkViewsFixed;
+typedef struct _GtkViewsFixedClass GtkViewsFixedClass;
+
+struct _GtkViewsFixed {
+ GtkFixed fixed;
+};
+
+struct _GtkViewsFixedClass {
+ GtkFixedClass parent_class;
+};
+
+GtkWidget* gtk_views_fixed_new();
+
+GType gtk_views_fixed_get_type();
+
+void gtk_views_fixed_set_use_allocated_size(GtkWidget* widget, bool value);
+
+G_END_DECLS
+
+#endif // VIEWS_WIDGET_GTK_VIEWS_FIXED_H