ModuleListLabel < Label
  font: verdana-11px-monochrome
  background-color: alpha
  text-offset: 2 0
  focusable: true
  color: #cccccc

  $focus:
    color: #ffffff

  $on:
    background-color: #006600
  $!on:
    background-color: #660000

  $on focus:
    background-color: #004400
  $!on focus:
    background-color: #440000

ModuleInfoLabel < Label
  $!first:
    margin-top: 5
  margin-bottom: 2

ModuleValueLabel < FlatLabel
  font: verdana-11px-antialised
  color: #aaaaaa
  text-offset: 2 3
  padding-bottom: 5
  height: 20

MainWindow
  id: moduleManagerWindow
  size: 450 450
  !text: tr('Module Manager')

  @onEscape: modules.client_modulemanager.hide()

  TextList
    id: moduleList
    anchors.top: parent.top
    anchors.left: parent.left
    anchors.bottom: parent.bottom
    width: 190
    padding: 1
    focusable: false
    margin-bottom: 30
    vertical-scrollbar: moduleListScrollBar

  VerticalScrollBar
    id: moduleListScrollBar
    anchors.top: moduleList.top
    anchors.bottom: moduleList.bottom
    anchors.left: moduleList.right
    step: 14
    pixels-scroll: true

  Button
    id: refreshModulesButton
    anchors.top: moduleList.bottom
    anchors.left: moduleList.left
    margin-top: 8
    !text: tr('Refresh')
    text-auto-resize: true
    @onClick: modules.client_modulemanager.refreshModules()

  Button
    id: reloadAllModulesButton
    anchors.top: moduleList.bottom
    anchors.right: moduleListScrollBar.right
    margin-top: 8
    !text: tr('Reload All')
    text-auto-resize: true
    @onClick: modules.client_modulemanager.reloadAllModules()

  Panel
    id: moduleInfo
    anchors.left: moduleListScrollBar.right
    anchors.top: parent.top
    anchors.right: parent.right
    margin: 0 5 5 15
    layout:
      type: verticalBox
      fit-children: true
    height: 265

    ModuleInfoLabel
      !text: tr('Module name')
    ModuleValueLabel
      id: moduleName

    ModuleInfoLabel
      !text: tr('Description')
    ModuleValueLabel
      id: moduleDescription
      text-wrap: true
      height: 100

    //ModuleInfoLabel
    //  !text: tr('Autoload')
    //ModuleValueLabel
    //  id: moduleAutoload

    //ModuleInfoLabel
    //  !text: tr('Autoload priority')
    //ModuleValueLabel
    //  id: moduleLoadPriority
    //  text: 1000

    ModuleInfoLabel
      !text: tr('Author')
    ModuleValueLabel
      id: moduleAuthor

    ModuleInfoLabel
      !text: tr('Website')
    TextEdit
      id: moduleWebsite

    ModuleInfoLabel
      !text: tr('Version')
    ModuleValueLabel
      id: moduleVersion

  Button
    id: moduleReloadButton
    anchors.top: moduleInfo.bottom
    anchors.left: moduleInfo.left
    margin-top: 8
    !text: tr('Load')
    enabled: false
    width: 90
    @onClick: modules.client_modulemanager.reloadCurrentModule()

  Button
    id: moduleUnloadButton
    anchors.top: moduleInfo.bottom
    anchors.right: moduleInfo.right
    margin-left: 10
    margin-top: 8
    !text: tr('Unload')
    enabled: false
    width: 90
    @onClick: modules.client_modulemanager.unloadCurrentModule()

  Button
    id: closeButton
    anchors.bottom: parent.bottom
    anchors.right: parent.right
    !text: tr('Close')
    width: 90
    @onClick: modules.client_modulemanager.hide()

