pad登陆页面修改底图,增加全屏选项,工具栏浏览器全屏改为窗口全屏

This commit is contained in:
fangxiang 2022-04-24 11:25:33 +08:00
parent 40a1705c07
commit 9b33a7783b
5 changed files with 74 additions and 15 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 KiB

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@ -67,6 +67,9 @@ export default defineComponent({
(window as any).controlLogout = () => {
Cookies.remove("auto_login");
SessionStorage.clear();
try {
$q.fullscreen.exit();
} catch {}
window.location.reload();
};

View File

@ -26,13 +26,13 @@
class="row items-center"
style="position: ; /*fixed*/"
:class="landspace ? '' : 'justify-evenly'"
:style="landspace ? { left: '11.5%' } : {}"
:style="landspace ? { left: '7%' } : {}"
>
<q-card
class="transparent"
class="transparent no-box-shadow"
:style="{
width: (landspace ? 40 : 70) + 'vw',
top: landspace ? '4vh' : 'unset',
width: (landspace ? 48 : 70) + 'vw',
top: landspace ? '-2vh' : 'unset',
}"
>
<div v-if="!landspace">
@ -178,7 +178,7 @@
</q-input>
</q-item-section>
</q-item>
<q-item class="q-mt-md">
<q-item class="q-mt-sm">
<q-item-section>
<q-checkbox
:label="$t('remember password')"
@ -200,6 +200,17 @@
:disable="data.loading"
/>
</q-item-section>
<q-item-section>
<q-checkbox
:label="$t('full screen')"
v-model="full_screen"
@update:model-value="toogleFullScreen"
color="accent"
class="text-accent"
:dark="landspace"
:disable="data.loading"
/>
</q-item-section>
</q-item>
</q-list>
</q-form>
@ -283,6 +294,9 @@ export default defineComponent({
const $store = useStore();
const data = reactive(new _Data());
const ____temp = $q.fullscreen.isActive;
const full_screen = ref(____temp);
try {
(window as any).setPadTheme();
} catch {}
@ -365,6 +379,7 @@ export default defineComponent({
landspace,
is_pwa,
show_show_password,
full_screen,
async onSubmit() {
return new Promise((resolve) => {
data.loading = true;
@ -468,6 +483,37 @@ export default defineComponent({
data.password = null;
remember_password.value = false;
},
toogleFullScreen() {
if (!$q.fullscreen.isCapable) {
if ($q.platform.is.ipad) {
$q.notify({
type: "warning",
message:
$t.t("on the iPad, only Safari supports full screen") + "!",
position: "top",
timeout: 1500,
});
} else {
$q.notify({
type: "warning",
message:
$t.t("the current browser does not support full screen") + "!",
position: "top",
timeout: 1500,
});
}
full_screen.value = $q.fullscreen.isActive;
return;
}
if ($q.fullscreen.isActive) {
$q.fullscreen.exit();
} else {
$q.fullscreen.request().catch((e: any) => {
console.log(e);
});
}
},
};
},
});

View File

@ -24,6 +24,7 @@
:label="$t('clean screen')"
@click="closeAllWindows"
/>
<q-btn
class="col-auto"
v-if="true || $q.fullscreen.isCapable"
@ -31,16 +32,9 @@
stretch
stack
flat
:icon="
'img:pad/toolbar/' +
($q.fullscreen.isActive
? 'exit_full_screen_icon.png'
: 'full_screen_icon.png')
"
:label="
$q.fullscreen.isActive ? $t('exit full screen') : $t('full screen')
"
@click="toogleFullScreen"
icon="img:pad/toolbar/full_screen_icon.png"
:label="$t('full screen')"
@click="fullscreenWindow"
/>
<q-btn
class="col-auto"
@ -225,6 +219,16 @@ export default defineComponent({
?.lowerWindow(window.window_id);
}
},
fullscreenWindow() {
const window = $store.state.windows.find(
(element) => element && element.uuid == $store.state.selected_window
);
if (window) {
GlobalData.getInstance()
.getCurrentClient()
?.setWindowGeometry(window.window_id, 0, 0, 1, 1);
}
},
closeCurrentWindow() {
const window = $store.state.windows.find(
(element) => element && element.uuid == $store.state.selected_window
@ -266,6 +270,9 @@ export default defineComponent({
} else {
Cookies.remove("auto_login");
SessionStorage.clear();
try {
$q.fullscreen.exit();
} catch {}
window.location.reload();
}
},

View File

@ -602,6 +602,9 @@ export default defineComponent({
} else {
Cookies.remove("auto_login");
SessionStorage.clear();
try {
$q.fullscreen.exit();
} catch {}
window.location.reload();
}
},