-
Notifications
You must be signed in to change notification settings - Fork 895
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
Move Vertical tab settings to brave://settings #18146
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
67 changes: 67 additions & 0 deletions
67
browser/resources/settings/brave_appearance_page/tabs.html
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,67 @@ | ||
<!-- This file will be converted into tabs.html.js using //tools/grit/preprocess_if_expr --> | ||
<style include="settings-shared iron-flex"> | ||
.border { | ||
border-top: var(--cr-separator-line); | ||
border-bottom: var(--cr-separator-line); | ||
} | ||
|
||
.settings-box { | ||
padding: 0 | ||
} | ||
</style> | ||
|
||
<div class="cr-row">$i18n{appearanceSettingsTabsSection}</div> | ||
<div class="list-frame"> | ||
<!-- Vertical Tab strip --> | ||
<template is="dom-if" if="[[isVerticalTabStripFeatureEnabled()]]"> | ||
<settings-toggle-button | ||
class="cr-row list-item" | ||
pref="{{prefs.brave.tabs.vertical_tabs_enabled}}" | ||
label="$i18n{appearanceSettingsTabsUseVerticalTabs}"> | ||
</settings-toggle-button> | ||
<template | ||
is="dom-if" | ||
if="[[prefs.brave.tabs.vertical_tabs_enabled.value]]"> | ||
<div class="cr-row"> | ||
<settings-checkbox | ||
class="cr-row list-item" | ||
pref="{{prefs.brave.tabs.vertical_tabs_show_title_on_window}}" | ||
label="$i18n{appearanceSettingsTabsShowWindowTitle}"> | ||
</settings-checkbox> | ||
</div> | ||
<div class="cr-row"> | ||
<settings-checkbox | ||
class="cr-row list-item" | ||
pref="{{prefs.brave.tabs.vertical_tabs_floating_enabled}}" | ||
label="$i18n{appearanceSettingsTabsFloatOnMouseOver}"> | ||
</settings-checkbox> | ||
</div> | ||
</template> <!-- vertical_tabs_enabled.value --> | ||
</template> <!-- isVerticalTabStripFeatureEnabled()--> | ||
|
||
<!-- Tab search button visibility --> | ||
<settings-toggle-button | ||
pref="{{prefs.brave.tabs_search_show}}" | ||
class="cr-row list-item" | ||
label="$i18n{showSearchTabsBtn}"> | ||
</settings-toggle-button> | ||
|
||
<!-- Tab speaker icons function --> | ||
<settings-toggle-button | ||
pref="{{prefs.brave.tabs.mute_indicator_not_clickable}}" | ||
class="cr-row list-item" | ||
label="$i18n{braveDisableClickableMuteIndicators}"> | ||
</settings-toggle-button> | ||
|
||
<!-- Tab hover mode --> | ||
<div class="cr-row list-item settings-box"> | ||
<div class="flex"> | ||
<div class="label">$i18n{appearanceSettingsTabHoverMode}</div> | ||
</div> | ||
<settings-dropdown-menu | ||
pref="{{prefs.brave.tabs.hover_mode}}" | ||
menu-options="[[tabTooltipModes_]]"> | ||
</settings-dropdown-menu> | ||
</div> | ||
</div> <!-- .list-frame --> | ||
|
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,42 @@ | ||
// 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/. | ||
|
||
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js' | ||
import {I18nMixin, I18nMixinInterface} from 'chrome://resources/cr_elements/i18n_mixin.js' | ||
import {PrefsMixin, PrefsMixinInterface} from '../prefs/prefs_mixin.js' | ||
import '../settings_shared.css.js' | ||
import '../settings_vars.css.js' | ||
import {getTemplate} from './tabs.html.js' | ||
import { loadTimeData } from '../i18n_setup.js' | ||
|
||
const SettingsBraveAppearanceTabsElementBase = PrefsMixin(I18nMixin(PolymerElement)) as { | ||
new (): PolymerElement & I18nMixinInterface & PrefsMixinInterface | ||
} | ||
|
||
export class SettingsBraveAppearanceTabsElement extends SettingsBraveAppearanceTabsElementBase { | ||
static get is() { | ||
return 'settings-brave-appearance-tabs' | ||
} | ||
|
||
static get template() { | ||
return getTemplate() | ||
} | ||
|
||
private isVerticalTabStripFeatureEnabled() { | ||
return loadTimeData.getBoolean('verticalTabStripFeatureEnabled') | ||
} | ||
|
||
private tabTooltipModes_ = [ | ||
{ value: 1, name: this.i18n('appearanceSettingsTabHoverModeCard') }, | ||
{ | ||
value: 2, | ||
name: this.i18n('appearanceSettingsTabHoverModeCardWithPreview') | ||
}, | ||
{ value: 0, name: this.i18n('appearanceSettingsTabHoverModeTooltip') } | ||
] | ||
|
||
} | ||
|
||
customElements.define(SettingsBraveAppearanceTabsElement.is, SettingsBraveAppearanceTabsElement) |
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just double checking we need the
TOOLKIT_VIEWS
check here - this file is in extensions, so it might only exist on desktop 😆There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm not sure about it. @simonhong , what do you think about this?
kSidebarShowOption
is guarded with TOOLKIT_VIEWS too, though it seems to be replacement of ENABLE_SIDEBAR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. I picked
TOOLKIT_VIEWS
to mark sidebar is desktop UI feature.Previously,
ENABLE_SIDEBAR
was used but realized that both are defined with same condition.So, redundant
ENABLE_SIDEBAR
is removed and all things outside of views is replaced withTOOLKIT_VIEWS
.Actually, removing this will work but I want to use it here because this file
brave_prefs_util.cc
is not guarded bytoolkit_views
in the gn file. If this file is guarded bytoolkit_views
in gn, I think we don't need to use this flag.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, unless we have
assert(tookit_views)
inbrowser/extensions/BUILD.gn
, it'd be safer to have TOOLKIT_VIEWS in sources like this. FYI, the BUILD.gn also has conditional with toolkit_views.So, we might want to check if assert(toolkit_views) is better, but I think we can deal with it in a separate issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed an issue for it : brave/brave-browser#29918