import bpy
from .utils.trans import t
from .utils import functions


class EasyPatchPrefs(bpy.types.AddonPreferences):
    bl_idname = functions.get_package_name()  # 設置爲package的名字否則不識別

    desc_position_x: bpy.props.IntProperty(name=t("font_size"), default=5, min=0, max=100)  # type: ignore
    desc_position_y: bpy.props.IntProperty(name=t("font_size"), default=15, min=0, max=100)  # type: ignore

    # TODO:经典模式开关，注意要在g建立一个变量确保一致性

    def draw(self, context):
        layout = self.layout
        layout.label(text=t("hotkey_display_position"))

        row = layout.row()
        row.prop(self, "desc_position_x", text="x", expand=True)
        row.prop(self, "desc_position_y", text="y", expand=True)


classes = (EasyPatchPrefs,)
