-
Notifications
You must be signed in to change notification settings - Fork 888
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added separator to sidebar ctx menu between show sidebar and position
fix brave/brave-browser#27880 New separator type(BOTH_SIDE_PADDED_SEPARATOR) is introduced to have padding on both side.
- Loading branch information
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
// You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
#ifndef BRAVE_CHROMIUM_SRC_UI_BASE_MODELS_MENU_SEPARATOR_TYPES_H_ | ||
#define BRAVE_CHROMIUM_SRC_UI_BASE_MODELS_MENU_SEPARATOR_TYPES_H_ | ||
|
||
#define PADDED_SEPARATOR BOTH_SIDE_PADDED_SEPARATOR, PADDED_SEPARATOR | ||
|
||
#include "src/ui/base/models/menu_separator_types.h" | ||
|
||
#undef PADDED_SEPARATOR | ||
|
||
#endif // BRAVE_CHROMIUM_SRC_UI_BASE_MODELS_MENU_SEPARATOR_TYPES_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
// You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
#define BRAVE_MENU_SEPARATOR_ON_PAINT \ | ||
else if (type_ == ui::BOTH_SIDE_PADDED_SEPARATOR) \ | ||
paint_rect.Inset(gfx::Insets::VH(0, 8)); | ||
|
||
#include "src/ui/views/controls/menu/menu_separator.cc" | ||
|
||
#undef BRAVE_MENU_SEPARATOR_ON_PAINT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/ui/views/controls/menu/menu_separator.cc b/ui/views/controls/menu/menu_separator.cc | ||
index be7ca4059bc2d7f78419dbf863fdb7c74070e9dc..6391ae9d86b0d66cca37d98f71506c2733b12edd 100644 | ||
--- a/ui/views/controls/menu/menu_separator.cc | ||
+++ b/ui/views/controls/menu/menu_separator.cc | ||
@@ -43,6 +43,7 @@ void MenuSeparator::OnPaint(gfx::Canvas* canvas) { | ||
if (type_ == ui::PADDED_SEPARATOR) | ||
paint_rect.Inset( | ||
gfx::Insets::TLBR(0, menu_config.padded_separator_left_margin, 0, 0)); | ||
+ BRAVE_MENU_SEPARATOR_ON_PAINT | ||
else if (menu_config.use_outer_border) | ||
paint_rect.Inset(gfx::Insets::VH(0, 1)); | ||
|