summaryrefslogtreecommitdiffstats
path: root/chrome/common/gtk_util.cc
diff options
context:
space:
mode:
authorzork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-16 20:58:28 +0000
committerzork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-16 20:58:28 +0000
commit969ee0d4eb01ab770892020e5ba7baf4bf4fda6a (patch)
treee9d1c707959392f8d7156f5b64dd330e514c813c /chrome/common/gtk_util.cc
parent3762aeb6b417e032ff7d97acaf02670fd2b83248 (diff)
downloadchromium_src-969ee0d4eb01ab770892020e5ba7baf4bf4fda6a.zip
chromium_src-969ee0d4eb01ab770892020e5ba7baf4bf4fda6a.tar.gz
chromium_src-969ee0d4eb01ab770892020e5ba7baf4bf4fda6a.tar.bz2
Fix labels on the content options page to wrap properly. Also, add a utility function to allow other labels to do the same.
BUG=29797 TEST=Open the content options page, and check that the labels wrap at the width of the page. Review URL: http://codereview.chromium.org/500026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34745 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gtk_util.cc')
-rw-r--r--chrome/common/gtk_util.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc
index 9154b92..5b078fb 100644
--- a/chrome/common/gtk_util.cc
+++ b/chrome/common/gtk_util.cc
@@ -113,6 +113,11 @@ gboolean PaintNoBackground(GtkWidget* widget,
return TRUE;
}
+void OnLabelAllocate(GtkWidget* label, GtkAllocation* allocation,
+ gpointer user_data) {
+ gtk_widget_set_size_request(label, allocation->width, -1);
+}
+
} // namespace
namespace event_utils {
@@ -660,4 +665,9 @@ void SuppressDefaultPainting(GtkWidget* container) {
G_CALLBACK(PaintNoBackground), NULL);
}
+void WrapLabelAtAllocationHack(GtkWidget* label) {
+ g_signal_connect(label, "size-allocate",
+ G_CALLBACK(OnLabelAllocate), NULL);
+}
+
} // namespace gtk_util