Made the settings menu significantly more responsive. (#454)

This commit is contained in:
Jas Singh
2024-11-07 21:35:49 -08:00
committed by GitHub
parent dbd932941b
commit d5f112e418
3 changed files with 106 additions and 108 deletions

View File

@@ -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'),
}),
];
}),
],
});
};

View File

@@ -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'),
}),
];
}),
],
});
};

View File

@@ -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'),
}),
];
}),
],
});
};