summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/gtk_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/gtk/gtk_util.h')
-rw-r--r--chrome/browser/gtk/gtk_util.h19
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_