/* -----------------------------------------------------------------------------
   Main
----------------------------------------------------------------------------- */

QWidget {
  background-color: @bg;
  color: @text-color;
  &:disabled {
    color: @text-color-disabled;
  }
}

QFrame {
  border: 0;
  margin: 0;
  padding: 0;
}

/* -----------------------------------------------------------------------------
   Tooltip
----------------------------------------------------------------------------- */

QToolTip,
#helpToolTip {
  background-color: #ffffe1;
  border: 1px solid #000;
  color: #000;
  padding: 1px 0;
}

/* -----------------------------------------------------------------------------
   Dock Separator
----------------------------------------------------------------------------- */

#DockSeparator,
QMainWindow::separator,
QSplitter::handle,
TPanel {
  background-color: @dock-bg-color;
  height: 4px;
  width: 4px;
}

#TDockPlaceholder {
  background-color: @dock-placeholder-color;
}

/* -----------------------------------------------------------------------------
   TopBar / QMenuBar
----------------------------------------------------------------------------- */

#TopBar {
  background: @topbar-bg-color;
  border: 0;
  border-bottom: 1px solid @topbar-border-color; // I have conditions (#C001)
  height: 21px;
  & #EditToolLockButton {
    spacing: 0;
    &::indicator {
      // Inherits from #ToolOptions (toolbar.less)
      &:extend(.button-tool all);
      height: 17px;
      margin: 1px 2px 0 0;
      padding-left: 1px;
      padding-right: 1px;
    }
  }
}

#TopBarTabContainer {
  background-color: @topbar-bg-color;
  margin-bottom: 1px; // (#C001) Required for #TopBar border-bottom to show
}

#StackedMenuBar {
  border: 0;
  margin: 0;
  padding: 0;
}

QMenuBar {
  background-color: @topbar-bg-color;
  border: 0;
  &::item {
    background-color: @topbar-bg-color;
    border-left: 1px solid @topbar-bg-color; // Spacing for QMenu
    margin: 0;
    padding: 3px 5px;
    &:selected {
      .selected-secondary; // base/mixins.less
    }
    &:pressed {
      .selected-primary; // base/mixins.less
    }
  }
}

/* -----------------------------------------------------------------------------
   Room Tabs
----------------------------------------------------------------------------- */

#TopBarTab {
  margin: 0;
  padding: 0;
  &::tab {
    background-color: @rooms-tab-bg-color;
    border-top: 1px solid @rooms-tab-border-color;
    border-right: 1px solid @rooms-tab-border-color;
    color: @rooms-tab-text-color;
    margin: 0 0 0 0;
    padding: 2px 10px 3px 10px;
    &:hover {
      background-color: @rooms-tab-bg-color-hover;
    }
    &:selected {
      background-color: @rooms-tab-bg-color-selected;
      color: @rooms-tab-text-color-selected;
    }
    &:first {
      border-left: 1px solid @rooms-tab-border-color;
    }
    &:last {
      border-right: 1px solid @rooms-tab-border-color;
    }
  }
}

/* -----------------------------------------------------------------------------
   QMenu (Context Menu)
----------------------------------------------------------------------------- */

QMenu {
  background-color: @menu-bg-color;
  border: 1px solid @menu-border-color;
  padding: 2px 0;
  &::item {
    padding: 3px 28px;
    &:selected {
      .selected-primary; // base/mixins.less
    }
    &:checked {
      color: @menu-checkbox-text-color-checked;
      &:selected {
        .selected-primary; // base/mixins.less
      }
    }
    &:disabled {
      background: none;
      color: @text-color-disabled;
      &:selected {
        border-color: transparent;
      }
    }
  }
  &::separator {
    border-top: 1px solid @menu-separator-color;
    height: 0;
    margin: 2px 0;
  }
  &::icon {
    border-radius: 2px;
    margin: 0 0 0 3px;
    padding: 1px;
    &:checked {
      background-color: @selected-bg-color;
    }
  }
  &::indicator {
    &:extend(.QCheckBox::indicator all); // views/controls.less
    margin-left: 7px;
  }
}

/* -----------------------------------------------------------------------------
   Title Bars (Global)
----------------------------------------------------------------------------- */

TPanelTitleBar {
  background-color: @title-bg-color;
  border-color: @title-border-color;
  border-style: solid;
  border-width: @title-border-width;
  font-weight: 700;
  height: @title-size;
  min-height: @title-size;
  qproperty-TitleColor: @title-text-color;
  qproperty-ActiveTitleColor: @title-text-color-active;
  qproperty-BorderPixmap: url('@{img-url}/@{title-img}');
  qproperty-ActiveBorderPixmap: url('@{img-url}/@{title-img-active}');
  qproperty-FloatBorderPixmap: url('@{img-url}/@{title-img-float}');
  qproperty-FloatActiveBorderPixmap: url('@{img-url}/@{title-img-float-active}');
}

/* -----------------------------------------------------------------------------
   Scroll Bars (Global)
----------------------------------------------------------------------------- */

QAbstractScrollArea::corner {
  background-color: @scrollbar-bg-color;
}

QScrollBar {
  background-color: @scrollbar-bg-color;
  border: 0;
  &:horizontal {
    height: 16px;
    margin: 0;
  }
  &:vertical {
    margin: 0;
    width: 16px;
  }

  &::handle {
    border: 0;
    &:horizontal,
    &:vertical {
      &:hover {
        background-color: @scrollbar-handle-bg-color-hover;
      }
      &:pressed {
        background-color: @scrollbar-handle-bg-color-pressed;
      }
    }
    &:horizontal {
      background-color: @scrollbar-handle-bg-color;
      margin: 2px 16px;
      min-width: 20px;
    }
    &:vertical {
      background-color: @scrollbar-handle-bg-color;
      margin: 16px 2px;
      min-height: 20px;
    }
  }

  &::add-line {
    subcontrol-origin: margin;
    border: 0;
    &:horizontal { // right
      subcontrol-position: right;
      background-color: @scrollbar-button-bg-color;
      margin: 0;
      width: 16px;
      &:pressed {
        background-color: @scrollbar-button-bg-color-pressed;
      }
    }
    &:vertical { // down
      subcontrol-position: bottom;
      background-color: @scrollbar-button-bg-color;
      margin: 0;
      height: 16px;
      &:pressed {
        background-color: @scrollbar-button-bg-color-pressed;
      }
    }
  }

  &::sub-line {
    border: 0;
    subcontrol-origin: margin;
    &:horizontal { // left
      subcontrol-position: left;
      background-color: @scrollbar-button-bg-color;
      margin: 0;
      width: 16px;
      &:pressed {
        background-color: @scrollbar-button-bg-color-pressed;
      }
    }
    &:vertical { // up
      subcontrol-position: top;
      background-color: @scrollbar-button-bg-color;
      margin: 0;
      height: 16px;
      &:pressed {
        background-color: @scrollbar-button-bg-color-pressed;
      }
    }
  }

  &::up-arrow:vertical {
    image: url('@{img-url}/scroll-up.svg');
    image-position: center center;
  }

  &::down-arrow:vertical {
    image: url('@{img-url}/scroll-down.svg');
    image-position: center center;
  }

  &::left-arrow:horizontal {
    image: url('@{img-url}/scroll-left.svg');
    image-position: center center;
  }

  &::right-arrow:horizontal {
    image: url('@{img-url}/scroll-right.svg');
    image-position: center center;
  }

  &::sub-page,
  &::add-page {
    &:horizontal,
    &:vertical {
      background: none;
    }
  }
}

/* -----------------------------------------------------------------------------
   Tool Bars (Global)
----------------------------------------------------------------------------- */

// Don't over-develop here, it could cause things to break in other places.
// If you're looking for the #ToolBar DockWidget look in /layouts/toolbar.less.

QToolBar {
  padding: 0;
  &::separator {
    &:horizontal {
      border-left: 1px solid @accent1;
      margin: 0 1px;
      width: 0;
    }
    &:vertical {
      border-top: 1px solid @accent1;
      height: 0;
      margin: 1px 0;
    }
  }
  QToolButton {
    &:extend(.button-tool all); // components/buttons.less
    &::menu-indicator {
      image: none;
    }
    &::menu-button {
      border-image: none;
    }
  }
  & QLabel {
    margin-top: 1px;
  }
  & QToolBar {
    border: 0;
  }
}

/* -------------------------------------------------------------------------- */

// Scrollable QToolBar buttons - these show when QToolBar is too small to show
// all of its content.
//
// This is a generic global style, pay attention to #ComboViewer and
// #PaletteViewer variants when tweaking these.

 DvScrollWidget {
  & QPushButton {
    background-color: @toolbar-scrollbutton-bg-color;
    border: 0;
    border-radius: 0;
    padding: 0;
    max-width: 16px;
    min-width: 16px;
    &:hover {
      background-color: @toolbar-scrollbutton-bg-color-hover;
    }
    &:pressed {
      background-color: @toolbar-scrollbutton-bg-color-pressed;
    }
  }
}

#ScrollLeftButton,
#ScrollRightButton,
#ScrollUpButton,
#ScrollDownButton {
  background-color: @toolbar-scrollbutton-bg-color;
  border: 0;
  border-radius: 0;
  max-width: 16px;
  min-width: 16px;
  padding: 0;
  &:hover {
    background-color: @toolbar-scrollbutton-bg-color-hover;
  }
  &:pressed {
    background-color: @toolbar-scrollbutton-bg-color-pressed;
  }
}
#ScrollLeftButton {
  image: url('@{img-url}/scroll-left.svg');
  border-right: 1px solid @accent1;
}
#ScrollRightButton {
  image: url('@{img-url}/scroll-right.svg');
  border-left: 1px solid @accent1;
  border-right: 1px solid @accent1; // FPS Slider
}
#ScrollUpButton {
  image: url('@{img-url}/scroll-up.svg');
}
#ScrollDownButton {
  image: url('@{img-url}/scroll-down.svg');
}

#keyFrameNavigator {
  background: none; // Fixes BG overflow
  margin: 0;
  padding: 0;
  & QToolButton {
    min-width: 18px;
  }
  #PreviousKey{
    image: url('@{img-url}/prevkey.png');
	  &:disabled{
		  image: url('@{img-url}/prevkey_disabled.png');
	  }
  }
  #NextKey{
	  image: url('@{img-url}/nextkey.png');
	  &:disabled{
		  image: url('@{img-url}/nextkey_disabled.png');
	  }
  }
}

/* -----------------------------------------------------------------------------
   Treeviews (Global)
----------------------------------------------------------------------------- */

QTreeWidget {
  &:extend(.tree-list all); // components/treeviews.less
}

QListView {
  outline: 0; // Hide dotted border on focus
}

/* -----------------------------------------------------------------------------
   Tabs (Global)
----------------------------------------------------------------------------- */

#TabBarContainer {
  &:extend(.tab-container all); // components/tabs.less
  background-color: @tabbar-bg-color;
}
