include "menus"
include "../icons/hover"
include "icons/icons"
include "style"

screen {
  background = "$$/background.png"

  panel {
    halign = center
    attach_vcenter = 0
    height = 19
    # Flip so the cursor defaults to the main menu
    direction = bottom_to_top

    ### Main Menu ###
    panel {
      min_width = 36
      class = container-body
      height = 14
#      margin_top = 0
      max_width = 128

      panel {
        halign = center

        space = 0
        direction = left_to_right
        anchor = 1
        id = __menu__
        popup = bottom
      }
    }

    panel {
      halign = center
      height = 4
      min_width = 36
      class = container-title

      space = 0
      direction = left_to_right
      anchor = 1

      image {
	 halign=center
        image = "$$/images/txt-select.png"
        attach_top = 2
        attach_left = 2
      }

      ### Tools Menu ###
#      image {
#        attach_right = 2
#        image = "$$/images/button-tools.png:$$/images/button-tools-hover.png"
#        command = "menu_popup tools_menu"
#      }
    }
  }

  ### Progress Bar ###
  panel {
    halign = center
    attach_bottom = 4
    width = 60
    class = progressbar-background
    id = __timeout__

    progressbar { }
  }
}

template_menuitem {
  panel {
    width = 20
    height = 10

    parameters = "class=image.class:title=panel.text.text"

    ### Icon ###
    image {
      attach_vcenter = 0
      attach_hcenter = 0
    }

    ### Text ###
#    panel {
#      attach_vcenter = 0
#      attach_hcenter = 0
#      margin_left = 1
#      margin_right = 1
#      class = text-line
#      text {}
#    }
  }
}

template_submenu {
  panel {
    class = dialog
  }
}

template_subitem {
  panel {
    parameters = "title=text.text"
    text {}
  }
}

template_popup {
  panel {
    attach_hcenter = 0
    attach_vcenter = 0
    class = dialog
  }
}

dialog_line {
  panel {
    parameters = "text=edit.text"
    class = dialog
    width = 60
    attach_hcenter = 0
    attach_vcenter = 0

    edit {
      lines = 1
      max_lines = 1
    }
  }
}

dialog_edit {
  panel {
    parameters = "text=edit.text"
    class = dialog
    width = 90
    attach_hcenter = 0
    attach_vcenter = 0

    edit {
      lines = 10
    }
  }
}

dialog_message {
  panel {
    parameters = "text=text.text"
    class = dialog
    margin_size = 1
    margin_bottom = 0
    space = 1
    attach_hcenter = 0
    attach_vcenter = 0
    text {}
    panel {
      class = button
      command = true
      halign = center
      text { text = OK class = button-text }
    }
  }
}

dialog_password {
  panel {
    parameters = "username=__user__.text:password=__pass__.text"
    class = dialog
    margin_size = 1
    margin_bottom = 0
    attach_hcenter = 0
    attach_vcenter = 0

    panel {
      direction = left_to_right
      space = 1
      text {
        extend = 1
        valign = center
        text = Username
      }

      panel {
        margin_left = 1
        margin_right = 1
        edit {
          id = __user__
          max_lines = 1
        }
      }
    }

    panel {
      direction = left_to_right
      space = 1
      text {
        extend = 1
        valign = center
        text = Password
      }
      panel {
        margin_left = 1
        margin_right = 1
        password {
          id = __pass__
        }
      }
    }

    panel {
      class = button
      command = true
      halign = center
      margin_left = 1
      margin_right = 1
      text {
        text = OK
        class = button-text
      }
    }
  }
}
menu {

#  Shutdown {
#    command = "halt"
#    class = "shutdown"
#  }
}
