thinner-tabbar-toolbar-bookmarkbar-downloadbar.patch 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ## This patch makes the tabbar, toolbar, bookmarkbar, and downloadbar thinner.
  2. #
  3. # These are the values that I'm comfortable with, adjust to your liking.
  4. #
  5. # Even though the download items are set to 24px, that's really a minimum.
  6. # Their height is based on the height of two rows of text using your current
  7. # font, so that could vary depending on your settings.
  8. --- a/chrome/browser/ui/views/download/download_item_view.cc
  9. +++ b/chrome/browser/ui/views/download/download_item_view.cc
  10. @@ -134,7 +134,7 @@
  11. // The vertical distance between the item's visual upper bound (as delineated
  12. // by the separator on the right) and the edge of the shelf.
  13. -constexpr int kTopBottomPadding = 6;
  14. +constexpr int kTopBottomPadding = 0;
  15. // The minimum vertical padding above and below contents of the download item.
  16. // This is only used when the text size is large.
  17. @@ -555,7 +555,7 @@
  18. }
  19. // The normal height of the item which may be exceeded if text is large.
  20. - constexpr int kDefaultDownloadItemHeight = 48;
  21. + constexpr int kDefaultDownloadItemHeight = 24;
  22. return gfx::Size(width, std::max(kDefaultDownloadItemHeight,
  23. 2 * kMinimumVerticalPadding + height));
  24. }
  25. --- a/chrome/browser/ui/layout_constants.cc
  26. +++ b/chrome/browser/ui/layout_constants.cc
  27. @@ -33,13 +33,13 @@
  28. case BOOKMARK_BAR_HEIGHT:
  29. // The fixed margin ensures the bookmark buttons appear centered relative
  30. // to the white space above and below.
  31. - static constexpr int kBookmarkBarAttachedVerticalMargin = 4;
  32. + static constexpr int kBookmarkBarAttachedVerticalMargin = 0;
  33. return GetLayoutConstant(BOOKMARK_BAR_BUTTON_HEIGHT) +
  34. kBookmarkBarAttachedVerticalMargin;
  35. case BOOKMARK_BAR_BUTTON_HEIGHT:
  36. - return touch_ui ? 36 : 28;
  37. + return touch_ui ? 36 : 24;
  38. case BOOKMARK_BAR_NTP_HEIGHT:
  39. - return touch_ui ? GetLayoutConstant(BOOKMARK_BAR_HEIGHT) : 39;
  40. + return touch_ui ? GetLayoutConstant(BOOKMARK_BAR_HEIGHT) : 27;
  41. case WEB_APP_MENU_BUTTON_SIZE:
  42. return 24;
  43. case WEB_APP_PAGE_ACTION_ICON_SIZE:
  44. @@ -47,18 +47,18 @@
  45. // stretching the container view.
  46. return 16;
  47. case LOCATION_BAR_BUBBLE_FONT_VERTICAL_PADDING:
  48. - return 2;
  49. + return 0;
  50. case LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET:
  51. return 1;
  52. case LOCATION_BAR_CHILD_INTERIOR_PADDING:
  53. - return 3;
  54. + return 1;
  55. case LOCATION_BAR_ELEMENT_PADDING:
  56. return touch_ui ? 3 : 2;
  57. case LOCATION_BAR_HEIGHT:
  58. if (OmniboxFieldTrial::RichAutocompletionShowAdditionalText() &&
  59. OmniboxFieldTrial::RichAutocompletionTwoLineOmnibox())
  60. return touch_ui ? 52 : 40;
  61. - return touch_ui ? 36 : 28;
  62. + return touch_ui ? 36 : 24;
  63. case LOCATION_BAR_ICON_SIZE:
  64. return touch_ui ? 20 : 16;
  65. case TAB_AFTER_TITLE_PADDING:
  66. @@ -68,7 +68,7 @@
  67. case TAB_ALERT_INDICATOR_ICON_WIDTH:
  68. return touch_ui ? 12 : 16;
  69. case TAB_HEIGHT:
  70. - return (touch_ui ? 41 : 34) + GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP);
  71. + return (touch_ui ? 41 : 30) + GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP);
  72. case TAB_PRE_TITLE_PADDING:
  73. return 8;
  74. case TAB_STACK_DISTANCE:
  75. @@ -76,7 +76,7 @@
  76. case TABSTRIP_TOOLBAR_OVERLAP:
  77. return 1;
  78. case TOOLBAR_BUTTON_HEIGHT:
  79. - return touch_ui ? 48 : 28;
  80. + return touch_ui ? 48 : 24;
  81. case TOOLBAR_ELEMENT_PADDING:
  82. return touch_ui ? 0 : 4;
  83. case TOOLBAR_STANDARD_SPACING:
  84. @@ -104,7 +104,7 @@
  85. }
  86. case TOOLBAR_INTERIOR_MARGIN:
  87. - return touch_ui ? gfx::Insets() : gfx::Insets(4, 8);
  88. + return touch_ui ? gfx::Insets() : gfx::Insets(0, 8);
  89. }
  90. NOTREACHED();
  91. return gfx::Insets();