diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-28 19:37:29 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-28 19:37:29 +0000 |
commit | 7110c24868971986f9e5cbd22a8dd1e87bda021f (patch) | |
tree | 0d650181d24330c4f72be140224af4a17fed4b51 /chrome/browser/gtk/gtk_util.h | |
parent | cf34891f6a2391419f416356350a542aa4c1cc0f (diff) | |
download | chromium_src-7110c24868971986f9e5cbd22a8dd1e87bda021f.zip chromium_src-7110c24868971986f9e5cbd22a8dd1e87bda021f.tar.gz chromium_src-7110c24868971986f9e5cbd22a8dd1e87bda021f.tar.bz2 |
Cleanup: Get rid of app/gtk_util.h.
* Most functions moved to chrome/browser/gtk/gtk_util.h because they're only
used within chrome/browser.
* BGRAToRGBA() is used within chrome/ and app/ so moved it to base/gtk_util.h.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/4170002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64295 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/gtk_util.h')
-rw-r--r-- | chrome/browser/gtk/gtk_util.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/gtk/gtk_util.h b/chrome/browser/gtk/gtk_util.h index 0ecafee..f7a87e1 100644 --- a/chrome/browser/gtk/gtk_util.h +++ b/chrome/browser/gtk/gtk_util.h @@ -84,6 +84,20 @@ GtkWidget* LeftAlignMisc(GtkWidget* misc); // Create a left-aligned label with the given text in bold. GtkWidget* CreateBoldLabel(const std::string& text); +// As above, but uses number of characters/lines directly rather than looking up +// a resource. +void GetWidgetSizeFromCharacters(GtkWidget* widget, + double width_chars, double height_lines, + int* width, int* height); + +// Calculates the size of given widget based on the size specified in number of +// characters/lines (in locale specific resource file) and font metrics. +// NOTE: Make sure to realize |widget| before using this method, or a default +// font size will be used instead of the actual font size. +void GetWidgetSizeFromResources(GtkWidget* widget, + int width_chars, int height_lines, + int* width, int* height); + // As above, but a convenience method for configuring dialog size. // |width_id| and |height_id| are resource IDs for the size. If either of these // are set to -1, the respective size will be set to the widget default. @@ -341,6 +355,11 @@ void InitLabelSizeRequestAndEllipsizeMode(GtkWidget* label); GdkDragAction WebDragOpToGdkDragAction(WebKit::WebDragOperationsMask op); WebKit::WebDragOperationsMask GdkDragActionToWebDragOp(GdkDragAction action); +// A helper function for gtk_message_dialog_new() to work around a few KDE 3 +// window manager bugs. You should always call it after creating a dialog with +// gtk_message_dialog_new. +void ApplyMessageDialogQuirks(GtkWidget* dialog); + } // namespace gtk_util #endif // CHROME_BROWSER_GTK_GTK_UTIL_H_ |