Commit 1ff5548b authored by estade@chromium.org's avatar estade@chromium.org

GTK: Allow the user to resize the chromium window as small as they like.

Review URL: http://codereview.chromium.org/100219

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14993 0039d316-1c4b-4281-b951-d872f2087c98
parent f30ce3b1
......@@ -206,7 +206,7 @@ BrowserWindowGtk::BrowserWindowGtk(Browser* browser)
full_screen_(false),
method_factory_(this) {
window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
gtk_window_set_default_size(window_, 640, 480);
SetGeometryHints();
g_object_set_data(G_OBJECT(window_), "browser_window_gtk", this);
g_signal_connect(window_, "delete-event",
G_CALLBACK(MainWindowDeleteEvent), this);
......@@ -659,6 +659,16 @@ void BrowserWindowGtk::AddFindBar(FindBarGtk* findbar) {
gtk_box_reorder_child(GTK_BOX(content_vbox_), findbar->widget(), 2);
}
void BrowserWindowGtk::SetGeometryHints() {
gtk_window_set_default_size(window_, 640, 480);
// Allow the user to resize us arbitrarily small.
GdkGeometry geometry;
geometry.min_width = 1;
geometry.min_height = 1;
gtk_window_set_geometry_hints(window_, NULL, &geometry, GDK_HINT_MIN_SIZE);
}
void BrowserWindowGtk::ConnectAccelerators() {
GtkAccelGroup* accel_group = gtk_accel_group_new();
gtk_window_add_accel_group(window_, accel_group);
......
......@@ -118,6 +118,10 @@ class BrowserWindowGtk : public BrowserWindow,
scoped_ptr<Browser> browser_;
private:
// Sets the default size for the window and the the way the user is allowed to
// resize it.
void SetGeometryHints();
// Connect accelerators that aren't connected to menu items (like ctrl-o,
// ctrl-l, etc.).
void ConnectAccelerators();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment