BotTabBar < UITabBar
  tab-spacing: 1
  margin-left: 1
  margin-right: 1

  $on:
    visible: true
    margin-top: 2

  $!on:
    visible: false

BotTabBarPanel < TabBarPanel
BotTabBarButton < UIButton
  padding: 4
  padding-right: 5
  text-horizontal-auto-resize: true
  size: 45 18
  image-source: /images/ui/tabbutton_square
  image-color: #aaaaaa
  image-clip: 0 0 98 18
  image-border: 3
  icon-color: #dfdfdf
  color: #aaaaaa
  padding: 5
  $!first:
    margin-left: 0
  $hover !checked:
    image-clip: 0 18 98 18
    color: #ffffff
    image-color: #dfdfdf

  $disabled:
    image-color: #dfdfdf88
    icon-color: #dfdfdf

  $checked:
    image-clip: 0 36 98 18
    image-color: #ffffff
    color: #ffffff

  $on !checked:
    color: #de6f6f

MiniWindow
  id: botWindow
  !text: tr('Bot')
  height: 600
  @onClose: modules.game_bot.onMiniWindowClose()
  &save: true
  &autoOpen: 10

  UIWidget
    id: miniwindowIcon
    anchors.top: miniwindowHeader.top
    anchors.left: miniwindowHeader.left
    margin-top: 2
    margin-left: 4
    size: 12 12
    image-source: /images/topbuttons/bot
    image-smooth: false

  Label
    id: miniwindowTitle
    anchors.top: miniwindowHeader.top
    anchors.left: miniwindowHeader.left
    anchors.right: miniwindowHeader.right
    margin-top: 2
    margin-left: 20
    margin-right: 50
    font: verdana-11px-monochrome
    height: 13
    color: #9d9d9dff
    !text: tr('Bot')

  MiniWindowContents
    ComboBox
      id: config
      &menuScroll: true
      &menuHeight: 450
      &menuScrollStep: 100
      &parentWidth: true
      anchors.top: parent.top
      anchors.left: parent.left
      anchors.right: parent.right
      margin-top: 2
      margin-left: 2
      margin-right: 75
      text-offset: 3 0

    Button
      id: editConfig
      anchors.top: prev.top
      anchors.left: prev.right
      anchors.right: parent.right
      !text: tr('Edit')
      @onClick: modules.game_bot.edit()
      margin-left: 3
      margin-right: 37

    Button
      id: enableButton
      anchors.top: prev.top
      anchors.left: prev.right
      anchors.right: parent.right
      margin-left: 3
      margin-right: 2

      $on:
        text: On
        color: #00AA00

      $!on:
        text: Off
        color: #FF0000

    Label
      id: statusLabel
      anchors.top: prev.bottom
      anchors.left: parent.left
      anchors.right: parent.right
      text-wrap: true
      text-auto-resize: true
      text-align: center
      !text: tr('Status: waiting')
      margin-left: 3
      margin-right: 3

      $on:
        margin-top: 3

      $!on:
        text:
        margin-top: -13

    HorizontalSeparator
      anchors.left: parent.left
      anchors.right: parent.right
      anchors.top: prev.bottom
      margin-top: 3
      margin-left: 2
      margin-right: 2

    Panel
      anchors.top: prev.bottom
      anchors.left: parent.left
      anchors.right: parent.right
      id: messages
      layout:
        type: verticalBox
        fit-children: true

    HorizontalSeparator
      anchors.left: parent.left
      anchors.right: parent.right
      anchors.top: prev.bottom
      margin-top: 5
      margin-left: 2
      margin-right: 2

    BotTabBar
      id: botTabs
      anchors.top: prev.bottom
      anchors.left: parent.left
      anchors.right: parent.right
      margin-right: -20

      layout:
        type: grid
        cell-size: 45 18
        flow: true
        fit-children: true
    Panel
      id: botPanel
      margin-top: 2
      anchors.top: prev.bottom
      anchors.bottom: parent.bottom
      anchors.left: parent.left
      anchors.right: parent.right
