"""Import settings panel."""

import bpy

from rizomuvbridge_ultimate.functions.bpy_funcs.get_prefs import get_addon_prefs


class RizomUVImportSettingsPanel(bpy.types.Panel):
    """Import settings panel."""

    bl_idname = "PANEL_PT_RizomUVBridgeImportSettings"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "RizomUV"
    bl_context = "objectmode"
    bl_label = "Import Settings"
    bl_parent_id = "PANEL_PT_RizomUVBridge"

    def __init__(self):
        """Access to the addon preferences."""
        self.prefs = get_addon_prefs()

    @classmethod
    def poll(cls, context):
        """Only show the panel if the user is on the operations tab."""
        return context.window_manager.RizomUVBridgeGUITabs.names == "OPERATIONS"

    def draw(self, context):
        """Draw method (Required)."""
        layout = self.layout
        box = layout.box()
        row = box.row()
        row.scale_y = 1.3
        row.prop(self.prefs, "delete_uvsets")
        row.prop(self.prefs, "add_uvsets")

        row = box.row(align=True)
        row.scale_y = 1.3
        row.prop(self.prefs, "reveal_hidden")
        row.prop(self.prefs, "replace_objects")

        row = box.row(align=True)
        row.scale_y = 1.3
        row.prop(self.prefs, "mark_sharp")
        row.prop(self.prefs, "mark_seams")
