```
feat(popup): 移除画板功能并调整弹窗尺寸 - 删除了画板菜单项及相关功能代码 - 移除了画板相关的导入和函数定义 - 将弹窗默认项目数从3调整为2,减小弹窗高度 - 更新了弹窗尺寸计算逻辑以适应新的项目数量 ```
This commit is contained in:
@ -49,7 +49,7 @@ pub async fn create_popup_window_impl<R: Runtime>(app: &AppHandle<R>, target: &T
|
|||||||
/// 根据用户登录状态和课程选择情况动态计算弹出窗口高度
|
/// 根据用户登录状态和课程选择情况动态计算弹出窗口高度
|
||||||
pub fn calculate_popup_size_sync() -> PopupSize {
|
pub fn calculate_popup_size_sync() -> PopupSize {
|
||||||
// 默认基础项目数
|
// 默认基础项目数
|
||||||
let item_num = 3;
|
let item_num = 2;
|
||||||
// 根据项目数计算高度,每个项目40像素,加上边距2像素
|
// 根据项目数计算高度,每个项目40像素,加上边距2像素
|
||||||
let popup_height = 40 * item_num + 2;
|
let popup_height = 40 * item_num + 2;
|
||||||
let popup_width = 180;
|
let popup_width = 180;
|
||||||
|
|||||||
@ -11,11 +11,6 @@
|
|||||||
<fluent-window24-regular class="menu-icon"></fluent-window24-regular>
|
<fluent-window24-regular class="menu-icon"></fluent-window24-regular>
|
||||||
<span id="drawing-board-text">打开主窗口</span>
|
<span id="drawing-board-text">打开主窗口</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- 画板 -->
|
|
||||||
<div class="menu-item" @click="openBoardWindow">
|
|
||||||
<fluent-hand-draw24-regular class="menu-icon"></fluent-hand-draw24-regular>
|
|
||||||
<span id="drawing-board-text">打开画板</span>
|
|
||||||
</div>
|
|
||||||
<!-- 退出应用程序 -->
|
<!-- 退出应用程序 -->
|
||||||
<div class="menu-item" @click="exitApp">
|
<div class="menu-item" @click="exitApp">
|
||||||
<solar-power-linear class="menu-icon"> </solar-power-linear>
|
<solar-power-linear class="menu-icon"> </solar-power-linear>
|
||||||
@ -29,14 +24,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, nextTick, onMounted, onUnmounted, ref, useTemplateRef } from 'vue';
|
import { computed, nextTick, onMounted, onUnmounted, ref, useTemplateRef } from 'vue';
|
||||||
import FluentWindow24Regular from '~icons/fluent/window-24-regular';
|
import FluentWindow24Regular from '~icons/fluent/window-24-regular';
|
||||||
import FluentHandDraw24Regular from '~icons/fluent/hand-draw-24-regular';
|
|
||||||
import SolarPowerLinear from '~icons/solar/power-linear';
|
import SolarPowerLinear from '~icons/solar/power-linear';
|
||||||
import { playPromptTone } from '@/utils/prompt-tone';
|
import { playPromptTone } from '@/utils/prompt-tone';
|
||||||
import type { Placement } from '@/utils/tauri/windows-util';
|
import type { Placement } from '@/utils/tauri/windows-util';
|
||||||
import { WebviewWindow } from '@tauri-apps/api/webviewWindow';
|
import { WebviewWindow } from '@tauri-apps/api/webviewWindow';
|
||||||
import { exit } from '@tauri-apps/plugin-process';
|
import { exit } from '@tauri-apps/plugin-process';
|
||||||
import type { UnlistenFn } from '@tauri-apps/api/event';
|
import type { UnlistenFn } from '@tauri-apps/api/event';
|
||||||
import { createDrawingBoardWindow, createMainWindow } from '@/utils/tauri/windows-action';
|
import { createMainWindow } from '@/utils/tauri/windows-action';
|
||||||
|
|
||||||
const webviewWindow = WebviewWindow.getCurrent();
|
const webviewWindow = WebviewWindow.getCurrent();
|
||||||
const placement = ref<Placement>('auto');
|
const placement = ref<Placement>('auto');
|
||||||
@ -91,15 +85,6 @@
|
|||||||
hideWindow();
|
hideWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 打开画板窗口
|
|
||||||
*/
|
|
||||||
async function openBoardWindow() {
|
|
||||||
playPromptTone();
|
|
||||||
await createDrawingBoardWindow();
|
|
||||||
hideWindow();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退出登录
|
* 退出登录
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user