Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1644)

Unified Diff: chrome/common/gtk_util.cc

Issue 534006: linux: set a minimum size for dialogs based on locale resources (Closed)
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/gtk_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/gtk_util.cc
diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc
index 75a5acf617bf7f3d9f3311964ce8e031d1b1aeb6..f63fd6955f5859a70c3c1c3b7b25caf4c18fe057 100644
--- a/chrome/common/gtk_util.cc
+++ b/chrome/common/gtk_util.cc
@@ -219,6 +219,19 @@ void GetWidgetSizeFromCharacters(GtkWidget* widget, double width_chars,
g_object_unref(context);
}
+void SetWindowWidthFromResources(GtkWindow* window, int resource_id,
+ bool resizable) {
+ int width;
+ gtk_util::GetWidgetSizeFromResources(GTK_WIDGET(window), resource_id, 0,
+ &width, NULL);
+ if (resizable) {
+ gtk_window_set_default_size(window, width, -1);
+ } else {
+ gtk_widget_set_size_request(GTK_WIDGET(window), width, -1);
+ }
+ gtk_window_set_resizable(window, resizable ? TRUE : FALSE);
mattm 2010/01/09 00:06:36 hm,is this tenary bool->gboolean conversion really
Evan Martin 2010/01/09 00:08:28 I figured it couldn't hurt; the compiler can remov
+}
+
void RemoveAllChildren(GtkWidget* container) {
gtk_container_foreach(GTK_CONTAINER(container), RemoveWidget, container);
}
« no previous file with comments | « chrome/common/gtk_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698