diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-02 18:10:09 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-02 18:10:09 +0000 |
commit | 3856915fc4df49cdc68a63ba5875031ed9701281 (patch) | |
tree | 36923d9880a9136d8a99dbe8e3b112c5ea102747 /chrome/browser/gtk/bookmark_bar_gtk.h | |
parent | 576df512b17a274862f27633e89a68e1030f9f59 (diff) | |
download | chromium_src-3856915fc4df49cdc68a63ba5875031ed9701281.zip chromium_src-3856915fc4df49cdc68a63ba5875031ed9701281.tar.gz chromium_src-3856915fc4df49cdc68a63ba5875031ed9701281.tar.bz2 |
GTK: Implement the bookmark bar chevron.
I didn't use the native GtkToolbar version of this because, as usual, GTK doesn't give us enough flexibility to do what we want. But it wasn't too hard or super hacky to re-implement it.
The chromium version (and hence the Windows version) looks bad. This is not my fault. I don't know why it points right rather than down, when the menu pops down, not to the right. This is why I used a down arrow for the GTK version rather than matching with a right arrow.
BUG=15845
Review URL: http://codereview.chromium.org/187001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25200 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/bookmark_bar_gtk.h')
-rw-r--r-- | chrome/browser/gtk/bookmark_bar_gtk.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.h b/chrome/browser/gtk/bookmark_bar_gtk.h index 0f44bf6..afc7e8a 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.h +++ b/chrome/browser/gtk/bookmark_bar_gtk.h @@ -84,6 +84,9 @@ class BookmarkBarGtk : public AnimationDelegate, // any bookmarks in the bookmark bar node. void SetInstructionState(); + // Sets the visibility of the overflow chevron. + void SetChevronState(); + // Helper function which destroys all the bookmark buttons in the GtkToolbar. void RemoveAllBookmarkButtons(); @@ -92,6 +95,17 @@ class BookmarkBarGtk : public AnimationDelegate, // bookmark bar model has. int GetBookmarkButtonCount(); + // Set the appearance of the overflow button appropriately (either chromium + // style or GTK style). + void SetOverflowButtonAppearance(); + + // Returns the index of the first bookmark that is not visible on the bar. + // Returns -1 if they are all visible. + // |extra_space| is how much extra space to give the toolbar during the + // calculation (for the purposes of determining if ditching the chevron + // would be a good idea). + int GetFirstHiddenBookmark(int extra_space); + // Overridden from BookmarkModelObserver: // Invoked when the bookmark model has finished loading. Creates a button @@ -173,6 +187,9 @@ class BookmarkBarGtk : public AnimationDelegate, GdkDragContext* context, guint time, BookmarkBarGtk* bar); + static void OnToolbarSizeAllocate(GtkWidget* widget, + GtkAllocation* allocation, + BookmarkBarGtk* bar); // Used for both folder buttons and the toolbar. static void OnDragReceived(GtkWidget* widget, @@ -215,6 +232,10 @@ class BookmarkBarGtk : public AnimationDelegate, // GtkToolbar which contains all the bookmark buttons. OwnedWidgetGtk bookmark_toolbar_; + // The button that shows extra bookmarks that don't fit on the bookmark + // bar. + GtkWidget* overflow_button_; + // The other bookmarks button. GtkWidget* other_bookmarks_button_; |