Skip to content

Commit

Permalink
Apply RTL appearance to the options page, group tabs, and the startup…
Browse files Browse the repository at this point in the history
… page #3689
  • Loading branch information
piroor committed Jan 6, 2025
1 parent e03504d commit e0e0aa3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webextensions/common/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const localKeys = DEVICE_SPECIFIC_CONFIG_KEYS.concat(mapAndFilter(`
optionsExpandedGroups
optionsExpandedSections
outOfScreenTabsRenderingPages
rtl,
sidebarPosition
sidebarVirtuallyClosedWindows
sidebarVirtuallyOpenedWindows
Expand Down Expand Up @@ -142,6 +143,7 @@ export const configs = new Configs({
sidebarPosition: Constants.kTABBAR_POSITION_AUTO,
sidebarPositionRighsideNotificationShown: false,
sidebarPositionOptionNotificationTimeout: 20 * 1000,
rtl: isRTL(),

style: /^Mac/i.test(navigator.platform) ? 'sidebar' : 'proton',
colorScheme: /^Linux/i.test(navigator.platform) ? 'system-color' : 'photon' ,
Expand Down
2 changes: 2 additions & 0 deletions webextensions/options/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ if ((location.hash &&
/independent=true/.test(location.search))
document.body.classList.add('independent');

document.documentElement.classList.toggle('rtl', isRTL());

const CODEMIRROR_THEMES = `
3024-day
3024-night
Expand Down
3 changes: 3 additions & 0 deletions webextensions/resources/group-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@
'renderTreeInGroupTabs',
'showAutoGroupOptionHint',
'showAutoGroupOptionHintWithOpener',
'rtl',
]
}),
browser.runtime.sendMessage({
Expand All @@ -304,6 +305,8 @@
`;
gUserStyleRules.textContent = userStyleRules;

document.documentElement.classList.toggle('rtl', configs.rtl);

updateTree.enabled = configs.renderTreeInGroupTabs;
updateTree();

Expand Down
3 changes: 3 additions & 0 deletions webextensions/resources/module/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ import '/extlib/l10n.js';

import {
configs,
isRTL,
} from '/common/common.js';
import * as Constants from '/common/constants.js';
import * as Permissions from '/common/permissions.js';

document.documentElement.classList.toggle('rtl', isRTL());

window.addEventListener('DOMContentLoaded', () => {
document.querySelector('#title').textContent = document.title = `${browser.i18n.getMessage('extensionName')} ${browser.runtime.getManifest().version}`;
document.querySelector('#syncTabsToDeviceOptionsLink').href = `${Constants.kSHORTHAND_URIS.options}#syncTabsToDeviceOptions`;
Expand Down

0 comments on commit e0e0aa3

Please sign in to comment.