Skip to content

Commit

Permalink
fix: window drag taking precedence on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBastin committed Nov 8, 2023
1 parent 9d1d369 commit de72533
Showing 1 changed file with 54 additions and 51 deletions.
105 changes: 54 additions & 51 deletions packages/hoppscotch-selfhost-desktop/src/main.ts
Expand Up @@ -20,63 +20,66 @@ import { ioDef } from "./platform/io"
const headerPaddingLeft = ref("0px")
const headerPaddingTop = ref("0px")

createHoppApp("#app", {
ui: {
additionalFooterMenuItems: stdFooterItems,
additionalSupportOptionsMenuItems: stdSupportOptionItems,
appHeader: {
paddingLeft: headerPaddingLeft,
paddingTop: headerPaddingTop,
onHeaderAreaClick() {
// Drag thw window when the user drags the header area
// TODO: Ignore click on headers and fields
appWindow.startDragging()
;(async () => {
const platform = await type()

createHoppApp("#app", {
ui: {
additionalFooterMenuItems: stdFooterItems,
additionalSupportOptionsMenuItems: stdSupportOptionItems,
appHeader: {
paddingLeft: headerPaddingLeft,
paddingTop: headerPaddingTop,
onHeaderAreaClick() {
if (platform === "Darwin") {
// Drag thw window when the user drags the header area
// TODO: Ignore click on headers and fields
appWindow.startDragging()
}
},
},
},
},
io: ioDef,
auth: authDef,
sync: {
environments: environmentsDef,
collections: collectionsDef,
settings: settingsDef,
history: historyDef,
tabState: tabStateDef,
},
interceptors: {
default: "native",
interceptors: [
{ type: "service", service: NativeInterceptorService },
{ type: "standalone", interceptor: proxyInterceptor },
io: ioDef,
auth: authDef,
sync: {
environments: environmentsDef,
collections: collectionsDef,
settings: settingsDef,
history: historyDef,
tabState: tabStateDef,
},
interceptors: {
default: "native",
interceptors: [
{ type: "service", service: NativeInterceptorService },
{ type: "standalone", interceptor: proxyInterceptor },
],
},
additionalInspectors: [
{ type: "service", service: ExtensionInspectorService },
],
},
additionalInspectors: [
{ type: "service", service: ExtensionInspectorService },
],
platformFeatureFlags: {
exportAsGIST: false,
hasTelemetry: false,
cookiesEnabled: true,
promptAsUsingCookies: false,
},
})
platformFeatureFlags: {
exportAsGIST: false,
hasTelemetry: false,
cookiesEnabled: true,
promptAsUsingCookies: false,
},
})

watch(
useSettingStatic("BG_COLOR")[0],
async () => {
await nextTick()
watch(
useSettingStatic("BG_COLOR")[0],
async () => {
await nextTick()

await emit(
"hopp-bg-changed",
getComputedStyle(document.documentElement).getPropertyValue(
"--primary-color"
await emit(
"hopp-bg-changed",
getComputedStyle(document.documentElement).getPropertyValue(
"--primary-color"
)
)
)
},
{ immediate: true }
)
;(async () => {
const platform = await type()
},
{ immediate: true }
)

if (platform === "Darwin") {
listen("will-enter-fullscreen", () => {
Expand Down

0 comments on commit de72533

Please sign in to comment.