diff options
author | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-06 04:00:03 +0000 |
---|---|---|
committer | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-06 04:00:03 +0000 |
commit | c4673fde58e0d5dc11060d9875b38516d785deed (patch) | |
tree | df9379e79fff755a9193dc7a0f38fe646293be95 /chrome/browser/gtk/bookmark_bar_gtk.cc | |
parent | 9c44e82ffdef31fa7658772a668954c6b8c62bd8 (diff) | |
download | chromium_src-c4673fde58e0d5dc11060d9875b38516d785deed.zip chromium_src-c4673fde58e0d5dc11060d9875b38516d785deed.tar.gz chromium_src-c4673fde58e0d5dc11060d9875b38516d785deed.tar.bz2 |
[Linux] Make bookmark bar instructions shrinkable.
BUG=36876
BUG=34479
TEST=Delete all bookmarks and show bookmark bar, then shirnk the browser window, the bookmark bar instructions should be shrinkable.
Review URL: http://codereview.chromium.org/661364
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40815 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/bookmark_bar_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/bookmark_bar_gtk.cc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index 265664e..5e93378 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -213,7 +213,7 @@ void BookmarkBarGtk::Init(Profile* profile) { instructions_gtk_.reset(new BookmarkBarInstructionsGtk(this, profile)); gtk_container_add(GTK_CONTAINER(instructions_), instructions_gtk_->widget()); gtk_box_pack_start(GTK_BOX(bookmark_hbox_), instructions_, - FALSE, FALSE, 0); + TRUE, TRUE, 0); gtk_drag_dest_set(instructions_, GtkDestDefaults(GTK_DEST_DEFAULT_DROP | GTK_DEST_DEFAULT_MOTION), @@ -273,7 +273,7 @@ void BookmarkBarGtk::Init(Profile* profile) { ResourceBundle::GetSharedInstance().GetPixbufNamed(IDR_WARNING))); g_signal_connect(sync_error_button_, "button-press-event", G_CALLBACK(OnSyncErrorButtonPressed), this); - gtk_box_pack_start(GTK_BOX(bookmark_hbox_), sync_error_button_ , + gtk_box_pack_start(GTK_BOX(bookmark_hbox_), sync_error_button_, FALSE, FALSE, 0); gtk_widget_set_size_request(event_box_.get(), -1, kBookmarkBarMinimumHeight); @@ -282,10 +282,13 @@ void BookmarkBarGtk::Init(Profile* profile) { ViewIDUtil::SetID(other_bookmarks_button_, VIEW_ID_OTHER_BOOKMARKS); ViewIDUtil::SetID(widget(), VIEW_ID_BOOKMARK_BAR); + + gtk_widget_show_all(widget()); + gtk_widget_hide(widget()); } void BookmarkBarGtk::Show(bool animate) { - gtk_widget_show_all(widget()); + gtk_widget_show(widget()); bool old_floating = floating_; UpdateFloatingState(); // TODO(estade): animate the transition between floating and non. @@ -326,10 +329,14 @@ void BookmarkBarGtk::Show(bool animate) { // Maybe show the instructions if (show_instructions_) { + gtk_widget_hide(bookmark_toolbar_.get()); gtk_widget_show(instructions_); } else { gtk_widget_hide(instructions_); + gtk_widget_show(bookmark_toolbar_.get()); } + + SetChevronState(); } void BookmarkBarGtk::Hide(bool animate) { @@ -510,9 +517,11 @@ void BookmarkBarGtk::CreateAllBookmarkButtons() { void BookmarkBarGtk::SetInstructionState() { show_instructions_ = (model_->GetBookmarkBarNode()->GetChildCount() == 0); if (show_instructions_) { + gtk_widget_hide(bookmark_toolbar_.get()); gtk_widget_show_all(instructions_); } else { gtk_widget_hide(instructions_); + gtk_widget_show(bookmark_toolbar_.get()); } } @@ -520,6 +529,11 @@ void BookmarkBarGtk::SetChevronState() { if (!GTK_WIDGET_VISIBLE(bookmark_hbox_)) return; + if (show_instructions_) { + gtk_widget_hide(overflow_button_); + return; + } + int extra_space = 0; if (GTK_WIDGET_VISIBLE(overflow_button_)) extra_space = overflow_button_->allocation.width; |