summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/tabs/tab_strip_gtk.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 23:28:02 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 23:28:02 +0000
commit85b893f08d534d5146d94de1863a4e0ac0cbf75c (patch)
tree7bb5c85d3873d706a8d9fab0e71e6bd3a89ade64 /chrome/browser/gtk/tabs/tab_strip_gtk.cc
parente9696d5781422146bfd90766ab9307dc614c587a (diff)
downloadchromium_src-85b893f08d534d5146d94de1863a4e0ac0cbf75c.zip
chromium_src-85b893f08d534d5146d94de1863a4e0ac0cbf75c.tar.gz
chromium_src-85b893f08d534d5146d94de1863a4e0ac0cbf75c.tar.bz2
Two tweaks to the linux tab strip code:
. Adds a 3 pixel gap between pinned and non-pinned tabs. . Fixes bug when rapdily dragging pinned tabs that could result in unpinning all tabs to right of pinned tab being dragged. BUG=none TEST=none Review URL: http://codereview.chromium.org/155725 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/tabs/tab_strip_gtk.cc')
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
index c931ab0..191d027 100644
--- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
@@ -55,8 +55,8 @@ const int kTabStripAnimationVSlop = 40;
const int kHorizontalMoveThreshold = 16; // pixels
-// The horizontal offset from one tab to the next,
-// which results in overlapping tabs.
+// The horizontal offset from one tab to the next, which results in overlapping
+// tabs.
const int kTabHOffset = -16;
// A linux specific menu item for toggling window decorations.
@@ -654,6 +654,9 @@ class PinAndMoveAnimation : public TabStripGtk::TabAnimation {
////////////////////////////////////////////////////////////////////////////////
// TabStripGtk, public:
+// static
+const int TabStripGtk::pinned_to_non_pinned_gap_ = 3;
+
TabStripGtk::TabStripGtk(TabStripModel* model)
: current_unselected_width_(TabGtk::GetStandardSize().width()),
current_selected_width_(TabGtk::GetStandardSize().width()),
@@ -1341,6 +1344,10 @@ void TabStripGtk::GetDesiredTabWidths(int tab_count,
}
int TabStripGtk::GetTabHOffset(int tab_index) {
+ if (tab_index < GetTabCount() && GetTabAt(tab_index - 1)->is_pinned() &&
+ !GetTabAt(tab_index)->is_pinned()) {
+ return pinned_to_non_pinned_gap_ + kTabHOffset;
+ }
return kTabHOffset;
}