Made the settings menu significantly more responsive. (#454)
This commit is contained in:
@@ -39,8 +39,7 @@ const PageContainer = (): GBox => {
|
|||||||
hpack: 'fill',
|
hpack: 'fill',
|
||||||
hexpand: true,
|
hexpand: true,
|
||||||
vertical: true,
|
vertical: true,
|
||||||
children: CurrentPage.bind('value').as((v) => {
|
children: [
|
||||||
return [
|
|
||||||
Widget.Box({
|
Widget.Box({
|
||||||
class_name: 'option-pages-container',
|
class_name: 'option-pages-container',
|
||||||
hpack: 'center',
|
hpack: 'center',
|
||||||
@@ -49,7 +48,9 @@ const PageContainer = (): GBox => {
|
|||||||
return Widget.Button({
|
return Widget.Button({
|
||||||
xalign: 0,
|
xalign: 0,
|
||||||
hpack: 'center',
|
hpack: 'center',
|
||||||
class_name: `pager-button ${v === page ? 'active' : ''} category`,
|
class_name: CurrentPage.bind('value').as(
|
||||||
|
(v) => `pager-button ${v === page ? 'active' : ''} category`,
|
||||||
|
),
|
||||||
label: page,
|
label: page,
|
||||||
on_primary_click: () => (CurrentPage.value = page),
|
on_primary_click: () => (CurrentPage.value = page),
|
||||||
});
|
});
|
||||||
@@ -64,8 +65,7 @@ const PageContainer = (): GBox => {
|
|||||||
},
|
},
|
||||||
shown: CurrentPage.bind('value'),
|
shown: CurrentPage.bind('value'),
|
||||||
}),
|
}),
|
||||||
];
|
],
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,7 @@ const pagerMap: Page[] = [
|
|||||||
export const SettingsMenu = (): GBox => {
|
export const SettingsMenu = (): GBox => {
|
||||||
return Widget.Box({
|
return Widget.Box({
|
||||||
vertical: true,
|
vertical: true,
|
||||||
children: CurrentPage.bind('value').as((v) => {
|
children: [
|
||||||
return [
|
|
||||||
Widget.Box({
|
Widget.Box({
|
||||||
class_name: 'option-pages-container',
|
class_name: 'option-pages-container',
|
||||||
hpack: 'center',
|
hpack: 'center',
|
||||||
@@ -52,7 +51,7 @@ export const SettingsMenu = (): GBox => {
|
|||||||
children: pagerMap.map((page) => {
|
children: pagerMap.map((page) => {
|
||||||
return Widget.Button({
|
return Widget.Button({
|
||||||
hpack: 'center',
|
hpack: 'center',
|
||||||
class_name: `pager-button ${v === page ? 'active' : ''}`,
|
class_name: CurrentPage.bind('value').as((v) => `pager-button ${v === page ? 'active' : ''}`),
|
||||||
label: page,
|
label: page,
|
||||||
on_primary_click: () => (CurrentPage.value = page),
|
on_primary_click: () => (CurrentPage.value = page),
|
||||||
});
|
});
|
||||||
@@ -76,7 +75,6 @@ export const SettingsMenu = (): GBox => {
|
|||||||
},
|
},
|
||||||
shown: CurrentPage.bind('value'),
|
shown: CurrentPage.bind('value'),
|
||||||
}),
|
}),
|
||||||
];
|
],
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -58,8 +58,7 @@ const pagerMap: Page[] = [
|
|||||||
export const ThemesMenu = (): GBox => {
|
export const ThemesMenu = (): GBox => {
|
||||||
return Widget.Box({
|
return Widget.Box({
|
||||||
vertical: true,
|
vertical: true,
|
||||||
children: CurrentPage.bind('value').as((v) => {
|
children: [
|
||||||
return [
|
|
||||||
Widget.Box({
|
Widget.Box({
|
||||||
class_name: 'option-pages-container',
|
class_name: 'option-pages-container',
|
||||||
hpack: 'center',
|
hpack: 'center',
|
||||||
@@ -72,7 +71,9 @@ export const ThemesMenu = (): GBox => {
|
|||||||
return Widget.Button({
|
return Widget.Button({
|
||||||
hpack: 'center',
|
hpack: 'center',
|
||||||
xalign: 0,
|
xalign: 0,
|
||||||
class_name: `pager-button ${v === page ? 'active' : ''}`,
|
class_name: CurrentPage.bind('value').as(
|
||||||
|
(v) => `pager-button ${v === page ? 'active' : ''}`,
|
||||||
|
),
|
||||||
label: page,
|
label: page,
|
||||||
on_primary_click: () => (CurrentPage.value = page),
|
on_primary_click: () => (CurrentPage.value = page),
|
||||||
});
|
});
|
||||||
@@ -105,7 +106,6 @@ export const ThemesMenu = (): GBox => {
|
|||||||
},
|
},
|
||||||
shown: CurrentPage.bind('value'),
|
shown: CurrentPage.bind('value'),
|
||||||
}),
|
}),
|
||||||
];
|
],
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user