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