import bpy
from .settings_scene import tryGetMainSceneSettings
from .utils_icons import getPreviewIcon


class SceneSettings(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_idname = "OBJECT_PT_NEEDLE_settings"
    bl_label = "Needle Scene Settings"
    # show in output scene
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"
    # bl_category = "Name of your tab"

    @classmethod
    def poll(self, context):
        # until we have any settings to draw here we just hide this panel
        return False

    def draw_header(self, context):
        layout = self.layout
        icon = getPreviewIcon("logo_small")
        layout.label(text="", icon_value=icon)

    def draw(self, context):
        settings = tryGetMainSceneSettings()
        if not settings:
            return
        layout = self.layout
        el = layout.column(align=True)
        el.label(text="Currently nothing here. Please see the addon settings")
        #, icon="MOD_MULTIRES"
        # el.prop(settings, "useProgressive", text="Use Progressive Textures")
        return 