Skip to content

Commit

Permalink
linux options
Browse files Browse the repository at this point in the history
  • Loading branch information
Manwe-777 committed May 4, 2024
1 parent 38e3803 commit 5005a49
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 6 deletions.
9 changes: 9 additions & 0 deletions src/common/defaultConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export const defaultConfig = {
overlayOverview: true,
overlayHover: true,
overlaysTransparency: !!(electron && process.platform !== "linux"),
overlayResizable: false,
overlaySkipTaskbar: false,
overlayFrame: false,
overlayAcceptFirstMouse: true,
settingsSection: 1,
settingsOverlaySection: 0,
cardsQuality: "normal" as CardQuality,
Expand Down Expand Up @@ -80,6 +84,7 @@ export const defaultConfig = {
...overlayCfg.bounds,
width: 280,
height: 600,
y: 64,
},
mode: OVERLAY_MIXED,
autosize: true,
Expand All @@ -95,6 +100,7 @@ export const defaultConfig = {
width: 280,
height: 600,
x: 300,
y: 64,
},
mode: OVERLAY_SEEN,
autosize: true,
Expand All @@ -108,6 +114,7 @@ export const defaultConfig = {
...overlayCfg.bounds,
width: 300,
height: 600,
y: 64,
},
mode: OVERLAY_DRAFT,
clock: false,
Expand All @@ -119,6 +126,7 @@ export const defaultConfig = {
...overlayCfg.bounds,
width: 300,
height: 600,
y: 64,
},
mode: OVERLAY_LOG,
clock: false,
Expand All @@ -130,6 +138,7 @@ export const defaultConfig = {
...overlayCfg.bounds,
width: 300,
height: 600,
y: 64,
},
mode: OVERLAY_FULL,
autosize: true,
Expand Down
8 changes: 7 additions & 1 deletion src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,13 @@ function App(props: AppProps) {
<SettingsPersistor />
<PopupComponent
open={false}
className={isElectron() ? "settings-popup" : ""}
className={
isElectron()
? os == "linux"
? "settings-popup-linux"
: "settings-popup"
: ""
}
width="100%"
height="100%"
openFnRef={openSettings}
Expand Down
52 changes: 52 additions & 0 deletions src/components/views/settings/OverlaySettingsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,34 @@ function setOverlaysTransparency(checked: boolean): void {
});
}

// function setOverlaysResizable(checked: boolean): void {
// reduxAction(store.dispatch, {
// type: "SET_SETTINGS",
// arg: { overlayResizable: checked },
// });
// }

// function setOverlaysSkipTaskbar(checked: boolean): void {
// reduxAction(store.dispatch, {
// type: "SET_SETTINGS",
// arg: { overlaySkipTaskbar: checked },
// });
// }

function setOverlaysFrame(checked: boolean): void {
reduxAction(store.dispatch, {
type: "SET_SETTINGS",
arg: { overlayFrame: checked },
});
}

// function setOverlaysAcceptFirstMouse(checked: boolean): void {
// reduxAction(store.dispatch, {
// type: "SET_SETTINGS",
// arg: { overlayAcceptFirstMouse: checked },
// });
// }

export default function OverlaySettingsPanel() {
const dispatch = useDispatch();
const settings = useSelector((state: AppState) => state.settings);
Expand Down Expand Up @@ -482,6 +510,30 @@ export default function OverlaySettingsPanel() {
callback={setOverlaysTransparency}
/>

{/* <Toggle
text="Resizable overlays"
value={settings.overlayResizable}
callback={setOverlaysResizable}
/>
<Toggle
text="Skip overlays on taskbar"
value={settings.overlaySkipTaskbar}
callback={setOverlaysSkipTaskbar}
/> */}

<Toggle
text="Show frame on overlays"
value={settings.overlayFrame}
callback={setOverlaysFrame}
/>

{/* <Toggle
text="Accept first mouse click on overlays"
value={settings.overlayAcceptFirstMouse}
callback={setOverlaysAcceptFirstMouse}
/> */}

<div
className="settings-note"
style={{ margin: "24px auto 0px auto", width: "fit-content" }}
Expand Down
2 changes: 1 addition & 1 deletion src/info.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"6.6.8","branch":"dev","timestamp":1714786203110}
{"version":"6.6.8","branch":"dev","timestamp":1714838419904}
10 changes: 6 additions & 4 deletions src/overlay/createOverlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,23 @@ export default function createOverlay(
const allSettings = JSON.parse(getLocalSetting("settings")) as Settings;
const settings: OverlaySettings = allSettings.overlays[id];

console.warn("allSettings", id, allSettings);

const newWindow = new remote.BrowserWindow({
transparent: allSettings.overlaysTransparency,
// resizable: false,
// skipTaskbar: true,
// resizable: allSettings.overlayResizable,
// skipTaskbar: allSettings.overlaySkipTaskbar,
focusable: !!allSettings.overlaysTransparency,
backgroundColor: allSettings.overlaysTransparency ? undefined : "#0d0d0f",
title: overlayIdToTitle[id],
show: false,
frame: false,
frame: allSettings.overlayFrame,
width: settings.bounds.width,
height: settings.bounds.height,
x: settings.bounds.x,
y: settings.bounds.y,
alwaysOnTop: true,
acceptFirstMouse: true,
acceptFirstMouse: allSettings.overlayAcceptFirstMouse,
webPreferences: {
webSecurity: false,
nodeIntegration: true,
Expand Down
12 changes: 12 additions & 0 deletions src/scss/popups.scss
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,18 @@
}
}

.settings-popup-linux {
background-color: transparent;
pointer-events: none;

.popup-box {
max-width: 100%;
max-height: 100%;
box-shadow: none;
pointer-events: all;
}
}

.electron-popup {
top: 24px;
height: calc(100% - 24px);
Expand Down

0 comments on commit 5005a49

Please sign in to comment.