mirror of
https://github.com/zombieFox/nightTab.git
synced 2025-06-30 22:30:38 +02:00
improve theme random accent setting control nesting
This commit is contained in:
@ -71,10 +71,10 @@ themeSetting.control = {
|
|||||||
themeSetting.disable = () => {
|
themeSetting.disable = () => {
|
||||||
|
|
||||||
if (state.get.current().theme.accent.random.active) {
|
if (state.get.current().theme.accent.random.active) {
|
||||||
themeSetting.control.accent.style.enable();
|
themeSetting.control.accent.random.style.enable();
|
||||||
themeSetting.control.accent.randomiseNow.enable();
|
themeSetting.control.accent.randomiseNow.enable();
|
||||||
} else {
|
} else {
|
||||||
themeSetting.control.accent.style.disable();
|
themeSetting.control.accent.random.style.disable();
|
||||||
themeSetting.control.accent.randomiseNow.disable();
|
themeSetting.control.accent.randomiseNow.disable();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ themeSetting.saved = (parent) => {
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
edit: new Button({
|
edit: new Button({
|
||||||
text: 'Edit',
|
text: 'Edit saved themes',
|
||||||
iconName: 'edit',
|
iconName: 'edit',
|
||||||
style: ['line'],
|
style: ['line'],
|
||||||
srOnly: true,
|
srOnly: true,
|
||||||
@ -594,7 +594,21 @@ themeSetting.accent = (parent) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
themeSetting.control.accent.style = new Control_radio({
|
themeSetting.control.accent.random = {};
|
||||||
|
|
||||||
|
themeSetting.control.accent.random.active = new Control_checkbox({
|
||||||
|
object: state.get.current(),
|
||||||
|
path: 'theme.accent.random.active',
|
||||||
|
id: 'theme-accent-random-active',
|
||||||
|
labelText: 'Random Accent colour on load/refresh',
|
||||||
|
action: () => {
|
||||||
|
themeSetting.disable();
|
||||||
|
themeSetting.control.accent.random.collapse.update();
|
||||||
|
data.save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
themeSetting.control.accent.random.style = new Control_radio({
|
||||||
object: state.get.current(),
|
object: state.get.current(),
|
||||||
radioGroup: [
|
radioGroup: [
|
||||||
{ id: 'theme-accent-random-style-any', labelText: 'Any', value: 'any' },
|
{ id: 'theme-accent-random-style-any', labelText: 'Any', value: 'any' },
|
||||||
@ -610,20 +624,6 @@ themeSetting.accent = (parent) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
themeSetting.control.accent.random = {};
|
|
||||||
|
|
||||||
themeSetting.control.accent.random.active = new Control_checkbox({
|
|
||||||
object: state.get.current(),
|
|
||||||
path: 'theme.accent.random.active',
|
|
||||||
id: 'theme-accent-random-active',
|
|
||||||
labelText: 'Random Accent colour on load/refresh',
|
|
||||||
action: () => {
|
|
||||||
themeSetting.disable();
|
|
||||||
themeSetting.control.accent.random.collapse.update();
|
|
||||||
data.save();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
themeSetting.control.accent.randomiseNow = new Button({
|
themeSetting.control.accent.randomiseNow = new Button({
|
||||||
text: 'Randomise now',
|
text: 'Randomise now',
|
||||||
style: ['line'],
|
style: ['line'],
|
||||||
@ -645,7 +645,7 @@ themeSetting.accent = (parent) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
themeSetting.control.accent.random.area = node('div', [
|
themeSetting.control.accent.random.area = node('div', [
|
||||||
themeSetting.control.accent.style.inline(),
|
themeSetting.control.accent.random.style.inline(),
|
||||||
themeSetting.control.accent.randomiseNow.wrap()
|
themeSetting.control.accent.randomiseNow.wrap()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user