Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolbar and omnibar changes #18

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this file doing?

<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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont need to comment this out if already commented below

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually yes, but this code is not needed by us

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(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to remove only the things not needed. if this is already removed from react then need not comment this

# 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
Loading