mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-03-03 19:27:07 +08:00
fix: 自定义按键布局
This commit is contained in:
parent
cf741cc697
commit
bfc4f70160
@ -87,7 +87,7 @@ function draw() {
|
|||||||
/**
|
/**
|
||||||
* 计算元素总长度
|
* 计算元素总长度
|
||||||
*/
|
*/
|
||||||
async function calHeight(first: boolean) {
|
async function calHeight(first: boolean = false) {
|
||||||
if (!first) {
|
if (!first) {
|
||||||
await sleep(20);
|
await sleep(20);
|
||||||
}
|
}
|
||||||
@ -207,6 +207,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
window.addEventListener('resize', resize);
|
window.addEventListener('resize', resize);
|
||||||
await calHeight(true);
|
await calHeight(true);
|
||||||
|
await calHeight();
|
||||||
draw();
|
draw();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -38,9 +38,14 @@ function BooleanSetting(props: SettingComponentProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div class="editor-boolean">
|
||||||
<span>当前 {item.value ? '开启' : '关闭'}</span>
|
<span>当前 {item.value ? '开启' : '关闭'}</span>
|
||||||
<Button type="primary" size="large" onClick={changeValue}>
|
<Button
|
||||||
|
class="boolean-button"
|
||||||
|
type="primary"
|
||||||
|
size="large"
|
||||||
|
onClick={changeValue}
|
||||||
|
>
|
||||||
{item.value ? '开启' : '关闭'}设置
|
{item.value ? '开启' : '关闭'}设置
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@ -55,7 +60,7 @@ function NumberSetting(props: SettingComponentProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div class="editor-number">
|
||||||
<span> 修改设置: </span>
|
<span> 修改设置: </span>
|
||||||
<InputNumber
|
<InputNumber
|
||||||
class="number-input"
|
class="number-input"
|
||||||
@ -81,10 +86,10 @@ function showSpecialSetting(id: string, vBind?: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function HotkeySetting(props: SettingComponentProps) {
|
function HotkeySetting(props: SettingComponentProps) {
|
||||||
// todo: hotkey.vue
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div style="display: flex; justify-content: center">
|
||||||
<Button
|
<Button
|
||||||
|
style="font-size: 75%"
|
||||||
type="primary"
|
type="primary"
|
||||||
size="large"
|
size="large"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
@ -102,8 +107,9 @@ function HotkeySetting(props: SettingComponentProps) {
|
|||||||
function ToolbarSetting(props: SettingComponentProps) {
|
function ToolbarSetting(props: SettingComponentProps) {
|
||||||
// todo: toolSetting.vue
|
// todo: toolSetting.vue
|
||||||
return (
|
return (
|
||||||
<div>
|
<div style="display: flex; justify-content: center">
|
||||||
<Button
|
<Button
|
||||||
|
style="font-size: 75%"
|
||||||
type="primary"
|
type="primary"
|
||||||
size="large"
|
size="large"
|
||||||
onClick={() => showSpecialSetting('toolSetting')}
|
onClick={() => showSpecialSetting('toolSetting')}
|
||||||
|
@ -193,14 +193,14 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.hotkey-group-one {
|
.hotkey-group-one {
|
||||||
margin: 2px 0;
|
margin: 0 0 4px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hotkey-one {
|
.hotkey-one {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin: 2% 3%;
|
margin: 0 3% 2% 3%;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,6 +261,31 @@ onUnmounted(() => {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.setting-info::v-deep(.editor-boolean) {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 10% 0 5%;
|
||||||
|
|
||||||
|
.boolean-button {
|
||||||
|
font-size: 75%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-info::v-deep(.editor-number) {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 10% 0 5%;
|
||||||
|
|
||||||
|
.number-input {
|
||||||
|
font-size: 80%;
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.setting-info {
|
.setting-info {
|
||||||
width: 25vw;
|
width: 25vw;
|
||||||
|
|
||||||
@ -269,35 +294,10 @@ onUnmounted(() => {
|
|||||||
margin: 2% 0;
|
margin: 2% 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-boolean {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-around;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0 10% 0 5%;
|
|
||||||
|
|
||||||
.boolean-button {
|
|
||||||
font-size: 75%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.info-text {
|
.info-text {
|
||||||
font-size: 85%;
|
font-size: 85%;
|
||||||
min-height: 30%;
|
min-height: 30%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-number {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-around;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0 10% 0 5%;
|
|
||||||
|
|
||||||
.number-input {
|
|
||||||
font-size: 80%;
|
|
||||||
width: 40%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 600px) {
|
@media screen and (max-width: 600px) {
|
||||||
|
Loading…
Reference in New Issue
Block a user