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

Unified Diff: chrome/common/gtk_util.cc

Issue 551034: Simplify the gtk AutoFill dialog and bring it more in line with the mocks.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
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
===================================================================
--- chrome/common/gtk_util.cc (revision 36381)
+++ chrome/common/gtk_util.cc (working copy)
@@ -8,6 +8,7 @@
#include <gdk/gdkx.h>
#include <cstdarg>
+#include <map>
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
@@ -223,15 +224,18 @@
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);
+void SetWindowSizeFromResources(GtkWindow* window,
+ int width_id, int height_id, bool resizable) {
+ int width = -1;
+ int height = -1;
+ gtk_util::GetWidgetSizeFromResources(GTK_WIDGET(window), width_id, height_id,
+ (width_id != -1) ? &width : NULL,
+ (height_id != -1) ? &height : NULL);
+
if (resizable) {
- gtk_window_set_default_size(window, width, -1);
+ gtk_window_set_default_size(window, width, height);
} else {
- gtk_widget_set_size_request(GTK_WIDGET(window), width, -1);
+ gtk_widget_set_size_request(GTK_WIDGET(window), width, height);
}
gtk_window_set_resizable(window, resizable ? TRUE : FALSE);
}
« 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