Skip to content

Commit

Permalink
Quick fix for the re-opened issue #9 (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
beebls authored Jul 30, 2022
1 parent 72921b5 commit 694d7d6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
32 changes: 17 additions & 15 deletions src/components/ThemePatch.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import { DropdownItem } from "decky-frontend-lib";
import { DropdownItem, PanelSectionRow } from "decky-frontend-lib";
import * as python from "../python";
import { VFC } from "react";
import { Patch } from "../theme";

export const ThemePatch: VFC<{ data: Patch }> = ({ data }) => {
return (
<DropdownItem
rgOptions={data.options.map((x, i) => {
return { data: i, label: x };
})}
label={`${data.name} of ${data.theme.name}`}
selectedOption={data.index}
onChange={(index) => {
data.index = index.data;
data.value = index.label;
python.execute(
python.setPatchOfTheme(data.theme.name, data.name, data.value)
);
}}
/>
<PanelSectionRow>
<DropdownItem
rgOptions={data.options.map((x, i) => {
return { data: i, label: x };
})}
label={`${data.name} of ${data.theme.name}`}
selectedOption={data.index}
onChange={(index) => {
data.index = index.data;
data.value = index.label;
python.execute(
python.setPatchOfTheme(data.theme.name, data.name, data.value)
);
}}
/>
</PanelSectionRow>
);
};
4 changes: 1 addition & 3 deletions src/components/ThemeToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ export const ThemeToggle: VFC<{ data: Theme; setThemeList: any }> = ({
}}
/>
</PanelSectionRow>
<PanelSectionRow>
{data.checked && data.patches.map((x) => <ThemePatch data={x} />)}
</PanelSectionRow>
{data.checked && data.patches.map((x) => <ThemePatch data={x} />)}
</>
);
};

0 comments on commit 694d7d6

Please sign in to comment.