-
Notifications
You must be signed in to change notification settings - Fork 127
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
profile name shown on action bar #1799
Changes from 1 commit
67b8bf1
bbde265
bce5de9
2d372e5
bc9010c
404da78
d4083b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,6 +199,8 @@ export class Display extends EventDispatcher { | |
this._languageSummaries = []; | ||
/** @type {import('dictionary-importer').Summary[]} */ | ||
this._dictionaryInfo = []; | ||
/** @type {?HTMLElement} */ | ||
this._profileName = document.querySelector('#profile-name'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. variable now unused? |
||
|
||
/* eslint-disable @stylistic/no-multi-spaces */ | ||
this._hotkeyHandler.registerActions([ | ||
|
@@ -486,6 +488,8 @@ export class Display extends EventDispatcher { | |
this._updateContentTextScanner(options); | ||
|
||
this.trigger('optionsUpdated', {options}); | ||
|
||
await this._updateCurrentProfileDisplay(options); | ||
} | ||
|
||
/** | ||
|
@@ -2280,4 +2284,18 @@ export class Display extends EventDispatcher { | |
this._searchHeader.classList.toggle('sticky-header', options.general.stickySearchHeader); | ||
} | ||
} | ||
|
||
/** | ||
* @param {import('settings').ProfileOptions} currentProfile | ||
*/ | ||
async _updateCurrentProfileDisplay(currentProfile) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it would be simpler to not have this function, and just use CSS like [data-popup-action-bar-location="right"] .sidebar-profile-name,
[data-popup-action-bar-location="left"] .sidebar-profile-name {
writing-mode: vertical-rl;
text-orientation: vertical;
letter-spacing: 2px;
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that makes life a lot easier @.@! |
||
if (!this._profileName) { | ||
return; | ||
} | ||
if (currentProfile.general.popupActionBarLocation === 'left' || currentProfile.general.popupActionBarLocation === 'right') { | ||
this._profileName.classList.add('vertical-text'); | ||
} else { | ||
this._profileName.classList.remove('vertical-text'); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,7 @@ <h3>Default Profile</h3> | |
<button type="button" class="sidebar-button" disabled id="navigate-next-button" title="Next definition" data-hotkey='["historyForward","title","Next definition ({0})"]'><span class="sidebar-button-icon icon" data-icon="right-chevron"></span></button> | ||
</div> | ||
<div class="content-sidebar-bottom"> | ||
<p class="sidebar-profile-language" id="profile-name"></p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
<button type="button" class="sidebar-button" id="profile-button"><span class="sidebar-button-icon icon" data-icon="profile"></span></button> | ||
</div> | ||
</div> | ||
|
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.
whitespace change