SideActionButton < Panel
  font: cipsoftFont
  height: 40
  padding: 1 1 1 1
  
  $first:
    margin-top: -4

  $!first:
    margin-top: -1
    
  Item
    id: item
    anchors.fill: parent
    &selectable: true
    &editable: false
    virtual: true
    border-width: 1
    
    border-color: #00000000
    
    $!on:
      image-source: /images/game/actionbarslot

  Label
    id: text
    anchors.fill: parent
    text-auto-resize: true
    text-wrap: true
    phantom: true
    text-align: center
    font: verdana-9px

  Label
    id: hotkeyLabel
    anchors.top: parent.top
    anchors.right: parent.right
    margin: 2 3 3 3
    text-auto-resize: true
    text-wrap: false
    phantom: true
    font: cipsoftFont
    color: white
    background: #292A2A

  UIProgressRect
    id: cooldown
    background: #585858AA
    percent: 100
    focusable: false
    phantom: true
    anchors.fill: parent
    margin: 1 1 1 1
    font: verdana-11px-rounded
    color: white
    
Panel
  id: actionBar
  focusable: false
  image-source: /images/ui/panel_side
  image-border: 4
  margin-top: -2
  
  $on:
    width: 40
    visible: true
    
  $!on:
    width: 0
    visible: false

  TabButton
    id: prevButton
    icon: /images/game/console/uparrow
    anchors.left: parent.left
    anchors.top: parent.top
    anchors.right: parent.right
    margin-top: -1
    margin-left: 1
    margin-right: 1
    
  Panel
    id: tabBar
    anchors.top: prev.bottom
    anchors.right: parent.right
    anchors.left: parent.left
    anchors.bottom: next.top
    margin-top: 3
    clipping: true
    layout: verticalBox
    
  TabButton
    id: nextButton
    icon: /images/game/console/downarrow
    anchors.right: parent.right
    anchors.left: parent.left
    anchors.bottom: parent.bottom
    margin-right: 1
    margin-left: 1
    margin-bottom: 2

ActionAssignWindow < MainWindow
  id: assignWindow
  !text: tr('Button Assign')
  size: 360 150
  @onEscape: self:destroy()

  Label
    !text: tr('Please, press the key you wish to use for action')
    anchors.left: parent.left
    anchors.right: parent.right
    anchors.top: parent.top
    text-auto-resize: true
    text-align: left

  Label
    id: comboPreview
    !text: tr('Current action hotkey: %s', 'none')
    anchors.horizontalCenter: parent.horizontalCenter
    anchors.top: prev.bottom
    margin-top: 10
    text-auto-resize: true

  HorizontalSeparator
    id: separator
    anchors.left: parent.left
    anchors.right: parent.right
    anchors.bottom: next.top
    margin-bottom: 10

  Button
    id: addButton
    !text: tr('Add')
    width: 64
    anchors.right: next.left
    anchors.bottom: parent.bottom
    margin-right: 10

  Button
    id: cancelButton
    !text: tr('Cancel')
    width: 64
    anchors.right: parent.right
    anchors.bottom: parent.bottom
    @onClick: self:getParent():destroy()