defauls state is None, state and sizes are not updated when Save or Reload is pressed
This commit is contained in:
@@ -200,7 +200,7 @@ def ui_rules():
|
||||
Rule("sidebar-control-always-compact", False, bool),
|
||||
Rule("sidebar-default-width", 0.5, float, 0.0, 1.0),
|
||||
Rule("sidebar-default-height", 0.5, float, 0.0, 1.0),
|
||||
Rule("sidebar-default-state", "Left", str),
|
||||
Rule("sidebar-default-state", "None", str),
|
||||
Rule("text-input-always-hide-search-button", False, bool),
|
||||
Rule("text-input-always-hide-clear-button", False, bool),
|
||||
|
||||
|
||||
@@ -4611,7 +4611,7 @@ class SettingsView {
|
||||
}),
|
||||
$select({
|
||||
$: (el) => (settings['sidebar-default-state'] = el),
|
||||
textContent: 'Default model manager position',
|
||||
textContent: 'Default model manager position (on start up)',
|
||||
options: ['Left', 'Right', 'Top', 'Bottom', 'None'],
|
||||
}),
|
||||
$checkbox({
|
||||
@@ -5356,37 +5356,27 @@ class ModelManager extends ComfyDialog {
|
||||
async #init() {
|
||||
await this.#settingsView.reload(false);
|
||||
await this.#refreshModels();
|
||||
}
|
||||
|
||||
#updateSidebarSettings = (settings) => {
|
||||
|
||||
const newSidebarState = settings['sidebar-default-state'].value;
|
||||
let buttonNumb = 0;
|
||||
if (newSidebarState === 'Left') {
|
||||
buttonNumb = 4;
|
||||
} else if (newSidebarState === 'Right') {
|
||||
buttonNumb = 1;
|
||||
} else if (newSidebarState === 'Top') {
|
||||
buttonNumb = 2;
|
||||
} else if (newSidebarState === 'Bottom') {
|
||||
buttonNumb = 3;
|
||||
}
|
||||
if(!this.#sidebarButtonGroup.children[buttonNumb].classList.contains('radio-button-group-active')){
|
||||
this.#sidebarButtonGroup.children[buttonNumb].click();
|
||||
}
|
||||
|
||||
const settings = this.#settingsView.elements.settings;
|
||||
|
||||
{
|
||||
// initialize buttons' visibility state
|
||||
const hideSearchButtons =
|
||||
settings['text-input-always-hide-search-button'].checked;
|
||||
const hideClearSearchButtons =
|
||||
settings['text-input-always-hide-clear-button'].checked;
|
||||
this.#downloadView.elements.searchButton.style.display = hideSearchButtons
|
||||
? 'none'
|
||||
: '';
|
||||
this.#downloadView.elements.clearSearchButton.style.display =
|
||||
hideClearSearchButtons ? 'none' : '';
|
||||
}
|
||||
// set initial sidebar state
|
||||
const newSidebarState = settings['sidebar-default-state'].value;
|
||||
let buttonNumb = 0;
|
||||
if (newSidebarState === 'Right') {
|
||||
buttonNumb = 1;
|
||||
} else if (newSidebarState === 'Top') {
|
||||
buttonNumb = 2;
|
||||
} else if (newSidebarState === 'Bottom') {
|
||||
buttonNumb = 3;
|
||||
} else if (newSidebarState === 'Left') {
|
||||
buttonNumb = 4;
|
||||
}
|
||||
const button = this.#sidebarButtonGroup.children[buttonNumb];
|
||||
if(!button.classList.contains('radio-button-group-active')){
|
||||
button.click();
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
// set initial sidebar widths & heights
|
||||
@@ -5430,6 +5420,21 @@ class ModelManager extends ComfyDialog {
|
||||
}
|
||||
}
|
||||
|
||||
#updateSidebarSettings = (settings) => {
|
||||
{
|
||||
// update buttons' visibility state
|
||||
const hideSearchButtons =
|
||||
settings['text-input-always-hide-search-button'].checked;
|
||||
const hideClearSearchButtons =
|
||||
settings['text-input-always-hide-clear-button'].checked;
|
||||
this.#downloadView.elements.searchButton.style.display = hideSearchButtons
|
||||
? 'none'
|
||||
: '';
|
||||
this.#downloadView.elements.clearSearchButton.style.display =
|
||||
hideClearSearchButtons ? 'none' : '';
|
||||
}
|
||||
}
|
||||
|
||||
#resetManagerContentsScroll = () => {
|
||||
this.#tabManagerContents.scrollTop = 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user