/* -----------------------------------------------------------------------------
   XSheet Viewer
----------------------------------------------------------------------------- */

/* ScrollAreas (Row, Column and Cell)
----------------------------------------------------------------------------- */

#xsheetArea,
#ScrollArea {
  background-color: @xsheet-empty-bg-color;
  border: 0;
}

#xsheetScrollArea {	
  border: 0;
}

#cornerWidget {
  & QToolButton {
    padding: 0;
  }
}

/* xsheetColumnHeader (Context Menus)
----------------------------------------------------------------------------- */

#xsheetColumnAreaMenu_Preview {	
  background-color: @xsheet-menu-preview-color;
}

#xsheetColumnAreaMenu_Lock {
  background-color: @xsheet-menu-lock-color;	
}

#xsheetColumnAreaMenu_Camstand {
  background-color: @xsheet-menu-camstand-color;	
}

#xsheetColumnAreaMenu_Preview, 
#xsheetColumnAreaMenu_Lock, 
#xsheetColumnAreaMenu_Camstand {
  color: @xsheet-menu-text-color;
}

#noteTextEdit{
  color: @xsheet-notes-text-color;
}

/* XSheet Spreadsheet
----------------------------------------------------------------------------- */

XsheetViewer {
  qproperty-TextColor: @xsheet-text-color;
  qproperty-BGColor: @xsheet-bg-color;
  qproperty-LightLineColor: @xsheet-LightLine-color;
  qproperty-MarkerLineColor: @xsheet-MarkerLine-color;
  qproperty-VerticalLineColor: @xsheet-VerticalLine-color;
  qproperty-VerticalLineHeadColor: @xsheet-VerticalLineHead-color;
  qproperty-PreviewFrameTextColor: @xsheet-PreviewFrameText-color;
  qproperty-CurrentRowBgColor: @xsheet-CurrentRowBG-color;
  qproperty-OnionSkinAreaBgColor: @xsheet-OnionSkinAreaBG-color;

  qproperty-EmptyColumnHeadColor: @xsheet-EmptyColumnHead-color;
  qproperty-SelectedColumnTextColor: @xsheet-SelectedColumnText-color;

  qproperty-EmptyCellColor: @xsheet-EmptyCell-color;
  qproperty-NotEmptyColumnColor: @xsheet-NotEmptyColumn-color;
  qproperty-SelectedEmptyCellColor: @xsheet-SelectedEmptyCell-color;

  qproperty-LevelColumnColor: @xsheet-LevelColumn-color;
  qproperty-LevelColumnBorderColor: @xsheet-LevelColumnBorder-color;
  qproperty-SelectedLevelColumnColor: @xsheet-SelectedLevelColumn-color;

  qproperty-VectorColumnColor: @xsheet-VectorColumn-color;
  qproperty-VectorColumnBorderColor: @xsheet-VectorColumnBorder-color;
  qproperty-SelectedVectorColumnColor: @xsheet-SelectedVectorColumn-color;

  qproperty-ChildColumnColor: @xsheet-ChildColumn-color;
  qproperty-ChildColumnBorderColor: @xsheet-ChildColumnBorder-color;
  qproperty-SelectedChildColumnColor: @xsheet-SelectedChildColumn-color;

  qproperty-FullcolorColumnColor: @xsheet-FullColorColumn-color;
  qproperty-FullcolorColumnBorderColor: @xsheet-FullColorColumnBorder-color;
  qproperty-SelectedFullcolorColumnColor: @xsheet-SelectedFullColorColumn-color;

  qproperty-FxColumnColor: @xsheet-FxColumn-color;
  qproperty-FxColumnBorderColor: @xsheet-FxColumnBorder-color;
  qproperty-SelectedFxColumnColor: @xsheet-SelectedFxColumn-color;

  qproperty-ReferenceColumnColor: @xsheet-ReferenceColumn-color;
  qproperty-ReferenceColumnBorderColor: @xsheet-ReferenceColumnBorder-color;
  qproperty-SelectedReferenceColumnColor: @xsheet-SelectedReferenceColumn-color;

  qproperty-PaletteColumnColor: @xsheet-PaletteColumn-color;
  qproperty-PaletteColumnBorderColor: @xsheet-PaletteColumnBorder-color;
  qproperty-SelectedPaletteColumnColor: @xsheet-SelectedPaletteColumn-color;

  qproperty-MeshColumnColor: @xsheet-MeshColumn-color;
  qproperty-MeshColumnBorderColor: @xsheet-MeshColumnBorder-color;
  qproperty-SelectedMeshColumnColor: @xsheet-SelectedMeshColumn-color;
  
  qproperty-SoundTextColumnColor: @xsheet-SoundTextColumn-color;
  qproperty-SoundTextColumnBorderColor: @xsheet-SoundTextColumnBorder-color;
  qproperty-SelectedSoundTextColumnColor: @xsheet-SelectedSoundTextColumn-color;

  qproperty-SoundColumnColor: @xsheet-SoundColumn-color;
  qproperty-SoundColumnBorderColor: @xsheet-SoundColumnBorder-color;
  qproperty-SelectedSoundColumnColor: @xsheet-SelectedSoundColumn-color;
  qproperty-SoundColumnHlColor: @xsheet-SoundColumnHL-color;
  qproperty-SoundColumnTrackColor: @xsheet-SoundColumnTrack-color;
  
  qproperty-ColumnHeadPastelizer: @xsheet-ColumnHeadPastelizer-color;
  qproperty-SelectedColumnHead: @xsheet-SelectedColumnHead-color;

  qproperty-LightLightBGColor: @xsheet-LightLightBG-color;
  qproperty-LightBGColor: @xsheet-LightBG-color;
  qproperty-DarkBGColor: @xsheet-DarkBG-color;
  qproperty-DarkLineColor: @xsheet-DarkLine-color;

  qproperty-XsheetColumnNameBgColor: @xsheet-ColumnNameBg-color;
  qproperty-XsheetDragBarHighlightColor: @xsheet-DragBarHighlight-color;

  qproperty-XsheetPreviewButtonBgOnColor: @xsheet-PreviewButtonBgOn-color;
  qproperty-XsheetPreviewButtonOnImage: url('@{img-url}/@{xsheet-PreviewButtonOnImage}');
  qproperty-XsheetPreviewButtonBgOffColor: @xsheet-PreviewButtonBgOff-color;
  qproperty-XsheetPreviewButtonOffImage: url('@{img-url}/@{xsheet-PreviewButtonOffImage}');

  qproperty-XsheetCamstandButtonBgOnColor: @xsheet-CamstandButtonBgOn-color;
  qproperty-XsheetCamstandButtonOnImage: url('@{img-url}/@{xsheet-CamstandButtonOnImage}');
  qproperty-XsheetCamstandButtonTranspImage: url('@{img-url}/@{xsheet-CamstandButtonTranspImage}');
  qproperty-XsheetCamstandButtonBgOffColor: @xsheet-CamstandButtonBgOff-color;
  qproperty-XsheetCamstandButtonOffImage: url('@{img-url}/@{xsheet-CamstandButtonOffImage}');

  qproperty-XsheetLockButtonBgOnColor: @xsheet-LockButtonBgOn-color;
  qproperty-XsheetLockButtonOnImage: url('@{img-url}/@{xsheet-LockButtonOnImage}');
  qproperty-XsheetLockButtonBgOffColor: @xsheet-LockButtonBgOff-color;
  qproperty-XsheetLockButtonOffImage: url('@{img-url}/@{xsheet-LockButtonOffImage}');

  qproperty-XsheetConfigButtonBgColor: @xsheet-ConfigButtonBg-color;
  qproperty-XsheetConfigButtonImage: url('@{img-url}/@{xsheet-ConfigButtonImage}');

  qproperty-TimelinePreviewButtonBgOnColor: @timeline-PreviewButtonBgOn-color;
  qproperty-TimelinePreviewButtonOnImage: url('@{img-url}/@{timeline-PreviewButtonOnImage}');
  qproperty-TimelinePreviewButtonBgOffColor: @timeline-PreviewButtonBgOff-color;
  qproperty-TimelinePreviewButtonOffImage: url('@{img-url}/@{timeline-PreviewButtonOffImage}');

  qproperty-TimelineCamstandButtonBgOnColor: @timeline-CamstandButtonBgOn-color;
  qproperty-TimelineCamstandButtonOnImage: url('@{img-url}/@{timeline-CamstandButtonOnImage}');
  qproperty-TimelineCamstandButtonTranspImage: url('@{img-url}/@{timeline-CamstandButtonTranspImage}');
  qproperty-TimelineCamstandButtonBgOffColor: @timeline-CamstandButtonBgOff-color;
  qproperty-TimelineCamstandButtonOffImage: url('@{img-url}/@{timeline-CamstandButtonOffImage}');

  qproperty-TimelineLockButtonBgOnColor: @timeline-LockButtonBgOn-color;
  qproperty-TimelineLockButtonOnImage: url('@{img-url}/@{timeline-LockButtonOnImage}');
  qproperty-TimelineLockButtonBgOffColor: @timeline-LockButtonBgOff-color;
  qproperty-TimelineLockButtonOffImage: url('@{img-url}/@{timeline-LockButtonOffImage}');

  qproperty-TimelineConfigButtonBgColor: @timeline-ConfigButtonBg-color;
  qproperty-TimelineConfigButtonImage: url('@{img-url}/@{timeline-ConfigButtonImage}');

  qproperty-LayerHeaderPreviewImage: url('@{img-url}/@{layerheader-PreviewImage}');
  qproperty-LayerHeaderPreviewOverImage: url('@{img-url}/@{layerheader-PreviewOverImage}');
  qproperty-LayerHeaderCamstandImage: url('@{img-url}/@{layerheader-CamstandImage}');
  qproperty-LayerHeaderCamstandOverImage: url('@{img-url}/@{layerheader-CamstandOverImage}');
  qproperty-LayerHeaderLockImage: url('@{img-url}/@{layerheader-LockImage}');
  qproperty-LayerHeaderLockOverImage: url('@{img-url}/@{layerheader-LockOverImage}');

  qproperty-ActiveCameraColor: @xsheet-ActiveCamera-color;
  qproperty-SelectedActiveCameraColor: @xsheet-SelectedActiveCamera-color;

  qproperty-OtherCameraColor: @xsheet-OtherCamera-color;
  qproperty-SelectedOtherCameraColor: @xsheet-SelectedOtherCamera-color;
}

/* XSheet Toolbar
----------------------------------------------------------------------------- */

#XSheetToolbar {
  margin: 0;
  padding: 0;
  border: 0;
  & QToolButton {
    padding: 0;
    margin: 4 1;
    min-height: 19;
    height: 19;
  }
  &::separator:horizontal {
    margin: 0 4;
  }
}

/* -----------------------------------------------------------------------------
   Function Editor
----------------------------------------------------------------------------- */

#FunctionEditor {
  & QToolBar {
    border-bottom: 1 solid @accent;
    & QToolBar {
      border: 0;
    }
    & QLabel {
      margin-left: 5;
    }
    & QToolButton {
      height: 18; // gives the key button increased active space
    }
  }
}

#FunctionParametersPanel {
  &:extend(.frame all);
}

#FunctionEditorTree {
  &:extend(.treeview all);
  border-top: 1 solid @accent;
}

FunctionTreeView {
  qproperty-TextColor: @function-treeview-text-color;
  qproperty-CurrentTextColor: @function-treeview-text-color-selected;
}

/* Function Editor Spreadsheet
----------------------------------------------------------------------------- */

// If a qproperty shares the same likeness with XSheet then pair the variables.
// XSheet should be considered as parent.

FunctionPanel {
  qproperty-BGColor: @function-panel-bg-color;
  qproperty-ValueLineColor: @function-panel-ValueLine-color;
  qproperty-FrameLineColor: @function-panel-FrameLine-color;
  qproperty-OtherCurvesColor: @function-panel-OtherCurves-color;
  qproperty-RulerBackground: @function-panel-RulerBG-color;
  qproperty-TextColor: @function-panel-Text-color;
  qproperty-SubColor: @function-panel-Sub-color;
  qproperty-SelectedColor: @function-panel-Selected-color;
}

SpreadsheetViewer {
  qproperty-LightLightBGColor: @xsheet-LightLightBG-color; // paired
  qproperty-CurrentRowBgColor: @xsheet-CurrentRowBG-color; // paired
  qproperty-LightLineColor: @xsheet-LightLine-color; // paired
  qproperty-MarkerLineColor: @xsheet-MarkerLine-color; // paired
  qproperty-BGColor: @xsheet-NotEmptyColumn-color; // paired
  qproperty-VerticalLineColor: @xsheet-VerticalLine-color; // paired
  qproperty-KeyFrameColor: @function-KeyFrame-color;
  qproperty-KeyFrameBorderColor: @function-KeyFrameBorder-color;
  qproperty-SelectedKeyFrameColor: @function-SelectedKeyFrame-color;
  qproperty-InBetweenColor: @function-Inbetween-color;
  qproperty-InBetweenBorderColor: @function-InbetweenBorder-color;
  qproperty-SelectedInBetweenColor: @function-SelectedInbetween-color;
  qproperty-SelectedEmptyColor: @xsheet-SelectedEmptyCell-color; // paired
  qproperty-SelectedSceneRangeEmptyColor: @function-SelectedSceneRangeEmpty-color;
  qproperty-TextColor: @xsheet-text-color; // paired
  qproperty-ColumnHeaderBorderColor: @xsheet-VerticalLineHead-color; // paired
  qproperty-SelectedColumnTextColor: @xsheet-SelectedColumnText-color; // paired
}

#FunctionSegmentViewer {
  // Placeholder
}

#ExpressionField {
  background-color: @function-ExpressionFieldBG-color;
	border: 1 solid @function-ExpressionFieldBorder-color;
	margin: 0;
}

#FunctionSegmentViewerLinkButton {
  &:extend(.QPushButton all);
  background-image: url('@{img-url}/segment_unlinked.svg');
  background-repeat: no-repeat;
  &:hover {
    background-repeat: no-repeat;
  }
  &:checked {
    background-image: url('@{img-url}/segment_linked.svg');
    background-repeat: no-repeat;
  }
  &:disabled {
    background-image: url('@{img-url}/segment_disabled.svg');
    background-repeat: no-repeat;
  }
}
