Skip to content

Commit

Permalink
Toolbar and omnibar changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterK0927 committed Apr 6, 2024
1 parent 94cc10f commit ef65323
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 66 deletions.
32 changes: 16 additions & 16 deletions browser/ui/views/brave_actions/brave_actions_container.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ void BraveActionsContainer::Init() {
SetLayoutManager(std::move(vertical_container_layout));

// children
RoundedSeparator* brave_button_separator_ = new RoundedSeparator();
// TODO(petemill): theme color
brave_button_separator_->SetColor(SkColorSetRGB(0xb2, 0xb5, 0xb7));
constexpr int kSeparatorMargin = 3;
constexpr int kSeparatorWidth = 1;
brave_button_separator_->SetPreferredSize(
gfx::Size(kSeparatorWidth + kSeparatorMargin * 2,
GetLayoutConstant(LOCATION_BAR_ICON_SIZE)));
// separator left & right margin
brave_button_separator_->SetBorder(views::CreateEmptyBorder(
gfx::Insets::TLBR(0, kSeparatorMargin, 0, kSeparatorMargin)));
// Just in case the extensions load before this function does (not likely!)
// make sure separator is at index 0
AddChildViewAt(brave_button_separator_, 0);
AddActionViewForShields();
AddActionViewForRewards();
// RoundedSeparator* brave_button_separator_ = new RoundedSeparator();
// // TODO(petemill): theme color
// brave_button_separator_->SetColor(SkColorSetRGB(0xb2, 0xb5, 0xb7));
// constexpr int kSeparatorMargin = 3;
// constexpr int kSeparatorWidth = 1;
// brave_button_separator_->SetPreferredSize(
// gfx::Size(kSeparatorWidth + kSeparatorMargin * 2,
// GetLayoutConstant(LOCATION_BAR_ICON_SIZE)));
// // separator left & right margin
// brave_button_separator_->SetBorder(views::CreateEmptyBorder(
// gfx::Insets::TLBR(0, kSeparatorMargin, 0, kSeparatorMargin)));
// // Just in case the extensions load before this function does (not likely!)
// // make sure separator is at index 0
// AddChildViewAt(brave_button_separator_, 0);
// AddActionViewForShields();
// AddActionViewForRewards();

// React to Brave Rewards preferences changes.
show_brave_rewards_button_.Init(
Expand Down
24 changes: 12 additions & 12 deletions components/brave_new_tab_ui/components/default/footer/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import {
// IconButtonContainer,
// IconButtonSideText,
IconLink,
Label,
Link,
// Label,
// Link,
Navigation,
PhotoName
// PhotoName
} from '..'
import * as S from '../page'

Expand All @@ -40,17 +40,17 @@ export interface Props {

export default class FooterInfo extends React.PureComponent<Props, {}> {
render () {
const {
// textDirection,
// supportsBraveTalk,
backgroundImageInfo,
showPhotoInfo,
// onClickSettings
} = this.props
// const {
// // textDirection,
// // supportsBraveTalk,
// backgroundImageInfo,
// showPhotoInfo,
// // onClickSettings
// } = this.props

return (
<>
{ showPhotoInfo && backgroundImageInfo?.type === 'brave' &&
{/* { showPhotoInfo && backgroundImageInfo?.type === 'brave' &&
<S.GridItemCredits>
<PhotoName>
{`${getLocale('photoBy')} `}
Expand All @@ -62,7 +62,7 @@ export default class FooterInfo extends React.PureComponent<Props, {}> {
}
</PhotoName>
</S.GridItemCredits>
}
} */}
<S.GridItemNavigation>
<Navigation>
{/* <IconButtonContainer textDirection={textDirection}>
Expand Down
4 changes: 2 additions & 2 deletions components/brave_shields/resources/panel/brave_shields.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!-- <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
Expand All @@ -18,4 +18,4 @@
<script type="module" src="brave_shields_panel.bundle.js"></script>
<div id="mountPoint" />
</body>
</html>
</html> -->
72 changes: 36 additions & 36 deletions script/generate_licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,36 +161,36 @@ def validated_data_field(data, field_name):
return field_value


def generate_backgrounds_license(preamble, backgrounds):
notices = ''

for background in backgrounds:
if notices:
notices += '\n'

filename = validated_data_field(background, 'wallpaperImageUrl')
author_name = validated_data_field(background, 'author')
# Don't validate link. it can be empty.
author_link = background['link']
original_url = validated_data_field(background, 'originalUrl')
license_text = validated_data_field(background, 'license')
if license_text != 'used with permission' \
and license_text[0:8] != 'https://' \
and license_text[0:7] != 'http://':
print('Invalid license for background image ' \
f"{background['name']}. It needs to be a URL or the " \
'string "used with permission".')
sys.exit(1)

if author_link != '':
notices += f'File: {filename}\nAuthor: {author_name} ' \
f'({author_link})\nURL: {original_url}\n' \
f'License: {license_text}\n'
else:
notices += f'File: {filename}\nAuthor: {author_name}\n' \
f'URL: {original_url}\nLicense: {license_text}\n'

return f'{preamble}\n\n{notices}'
# def generate_backgrounds_license(preamble, backgrounds):
# notices = ''

# for background in backgrounds:
# if notices:
# notices += '\n'

# filename = validated_data_field(background, 'wallpaperImageUrl')
# author_name = validated_data_field(background, 'author')
# # Don't validate link. it can be empty.
# author_link = background['link']
# original_url = validated_data_field(background, 'originalUrl')
# license_text = validated_data_field(background, 'license')
# if license_text != 'used with permission' \
# and license_text[0:8] != 'https://' \
# and license_text[0:7] != 'http://':
# print('Invalid license for background image ' \
# f"{background['name']}. It needs to be a URL or the " \
# 'string "used with permission".')
# sys.exit(1)

# if author_link != '':
# notices += f'File: {filename}\nAuthor: {author_name} ' \
# f'({author_link})\nURL: {original_url}\n' \
# f'License: {license_text}\n'
# else:
# notices += f'File: {filename}\nAuthor: {author_name}\n' \
# f'URL: {original_url}\nLicense: {license_text}\n'

# return f'{preamble}\n\n{notices}'


def main():
Expand Down Expand Up @@ -233,12 +233,12 @@ def main():
'background images used on the new tab page. The Brave Browser and ' \
'such data files are separate and independent works.'

ntp_backgrounds = list_ntp_backgrounds(
os.path.join(ntp_data_dir, 'backgrounds.ts'))
if write_license_file(ntp_data_dir, generate_backgrounds_license(
ntp_backgrounds_preamble, ntp_backgrounds)):
print(f'- {len(ntp_backgrounds)} sub-components added in ' \
'brave_new_tab_ui/data/LICENSE')
# ntp_backgrounds = list_ntp_backgrounds(
# os.path.join(ntp_data_dir, 'backgrounds.ts'))
# if write_license_file(ntp_data_dir, generate_backgrounds_licens(
# ntp_backgrounds_preamble, ntp_backgrounds)):
# print(f'- {len(ntp_backgrounds)} sub-components added in ' \
# 'brave_new_tab_ui/data/LICENSE')


if __name__ == '__main__':
Expand Down

0 comments on commit ef65323

Please sign in to comment.