Blob Blame Raw

// The Less compiler has trouble compiling Qt selectors when they have been
// extended to, so extend Qt selectors to mixins as workaround for now

/* -----------------------------------------------------------------------------
   Push Button
----------------------------------------------------------------------------- */

.Button {
  background-color: @button-bg-color;
  border: 1 solid @button-border-color;
  border-radius: 2;
  color: @button-text-color;
  margin: 0;
  padding: 3 15;
  &:hover {
    background-color: @button-bg-color-hover;
    border-color: @button-border-color-hover;
    color: @button-text-color-hover;
  } 
  &:pressed {
    background-color: @button-bg-color-pressed;
    border-color: @button-border-color-pressed;
    color: @button-text-color-pressed;
  }
  &:checked {
    background-color: @button-bg-color-checked;
    border-color: @button-border-color-checked;
    color: @button-text-color-checked;
    &:hover {
      background-color: @button-bg-color-checked-hover;
      &:pressed {
        background: @button-bg-color-checked-hover-pressed;
      }
    }
  }
  &:disabled {
    background-color: @button-bg-color-disabled;
    border-color: @button-border-color-disabled;
    color: @button-text-color-disabled;
  }
}

QPushButton {
  &:extend(.Button all);
}

#PushButton_NoPadding {
  padding: 3;
}

/* -----------------------------------------------------------------------------
   Combo Box
----------------------------------------------------------------------------- */

.ComboBox {
  &:extend(.Button);
  padding: 1 0 1 4;
  margin: 1 0;
  &:hover {
    &:extend(.Button:hover);
  }
  &:checked {
    &:extend(.ComboBox);
  }
  &:disabled {
    &:extend(.Button:disabled);
  }
  &::drop-down {
    image: url('@{img-url}/combo_downarrow.svg');
    image-position: center center;
    width: 16;
    &:disabled {
      image: url('@{img-url}/combo_downarrow_disabled.svg');
    }
  }
  & QAbstractItemView {
    background-color: @menu-bg-color;
    border: 1 solid @menu-border-color;
    selection-background-color: @hl-bg-color;
    selection-color: @hl-text-color;
  }
}

QComboBox {
  &:extend(.ComboBox all);
}

/* -----------------------------------------------------------------------------
   Textfield
----------------------------------------------------------------------------- */

.LineEdit {
  background-color: @input-bg-color;
  border: 1 solid @input-border-color;
  border-radius: 2;
  color: @input-text-color;
  selection-background-color: @input-selection-bg-color;
  selection-color: @input-selection-text-color;
  padding: 0 0 0 1;
  &:focus {
    background-color: @input-bg-color-focus;
    border-color: @input-border-color-focus;
    color: @input-text-color-focus;
  }
  &:disabled {
    background-color: @input-bg-color-disabled;
    border-color: @input-border-color-disabled;
    color: @input-text-color-disabled;
  }
}

QPlainTextEdit
,QLineEdit {
  &:extend(.LineEdit all);
}

/* -----------------------------------------------------------------------------
   CheckBox
----------------------------------------------------------------------------- */

.CheckBox {
  color: @text-color;
  &:hover {
    color: @checkbox-text-color-hover;
  }
  &:disabled {
    color: @text-color-disabled;
  }
  &::indicator {
    background-color: @checkbox-bg-color;
    border: 1 solid @checkbox-border-color;
    border-radius: 2;
    height: 9;      /* fix for QGroupBox */
    padding: 1;
    width: 9;       /* fix for QMenu */
    &:hover {
      background-color: @checkbox-bg-color-hover;
      border-color: @checkbox-border-color-hover;
    }
    &:checked {
      background-color: @checkbox-bg-color-checked;
      border-color: @checkbox-border-color-checked;
      image: url('@{img-url}/checkmark.svg');
      &:hover {
        &:extend(.CheckBox::indicator:hover);
      }
      &:disabled {
        background-color: @checkbox-bg-color-disabled;
        border-color: @checkbox-border-color-disabled;
        image: url('@{img-url}/checkmark_disabled.svg');
      }
    }
    &:indeterminate {
      background-color: @checkbox-bg-color-checked;
      border-color: @checkbox-border-color-checked;
      image: url('@{img-url}/checkpartially.svg');
      &:hover {
        &:extend(.CheckBox::indicator:hover);
      }
      &:disabled {
        background-color: @checkbox-bg-color-disabled;
        border-color: @checkbox-border-color-disabled;
        image: url('@{img-url}/checkpartially_disabled.svg');
      }
    }
    &:disabled {
      background-color: @checkbox-bg-color-disabled;
      border-color: @checkbox-border-color-disabled;
    }
  }
}

QCheckBox {
  &:extend(.CheckBox all);
}

/* -----------------------------------------------------------------------------
   Radio Button
----------------------------------------------------------------------------- */

.RadioButton {
  &:hover {
    &:extend(.CheckBox:hover);
  }
  &::indicator {
    &:unchecked {
      image: url('@{img-url}/radiobutton_unchecked.svg');
      image-position: center center;
    }
    &:checked {
      image: url('@{img-url}/radiobutton_checked.svg');
      image-position: center center;
    }
  }
}

QRadioButton {
  &:extend(.RadioButton all);
}

/* -----------------------------------------------------------------------------
   GroupBox
----------------------------------------------------------------------------- */

.GroupBox {
  &:extend(.frame all);
  margin: 6 0 0 0;
  padding: 5 0;
  &::title {
    subcontrol-origin: margin;
    left: 15;
    margin: -3 0 0 0;
    padding: 0 3;
    &:hover {
      color: @checkbox-text-color-hover;
    }
    &:disabled {
      color: @text-color-disabled;
    }
  }
  &::indicator {
    &:extend(.CheckBox::indicator all);
    subcontrol-origin: margin;
    margin-top: 2;
  }
  &:disabled {
    color: @text-color-disabled;
  }
}

QGroupBox {
  &:extend(.GroupBox all);
}

/* -----------------------------------------------------------------------------
   Slider
----------------------------------------------------------------------------- */

.Slider {
  &::groove:horizontal {
    background-color: transparent;
    background-image: url('@{img-url}/@{slider-groove-img}');
    background-position: center center;
    background-repeat: repeat-x;
    margin: 0;
    height: 20;
    min-height: 20;
    &:disabled {
      background-image: url('@{img-url}/@{slider-groove-img-disabled}');
    }
  }
  &::handle:horizontal {
    width: @slider-handle-width;
    margin: @slider-handle-margin;
    image: url('@{img-url}/@{slider-handle-img}');
    &:disabled {
      image: url('@{img-url}/@{slider-handle-img-disabled}');
    }
  }
}

QSlider {
  &:extend(.Slider all);
}

/* -----------------------------------------------------------------------------
   Double Slider
----------------------------------------------------------------------------- */

#IntPairField, 
#DoublePairField {
	qproperty-LightLineColor: @slider-groove-color;
  qproperty-LightLineEdgeColor: @slider-groove-color;
	qproperty-DarkLineColor: @slider-groove-color;
  qproperty-MiddleLineColor: @slider-groove-color;

	qproperty-HandleLeftPixmap: url("@{img-url}/@{slider-left-handle}");
	qproperty-HandleRightPixmap: url("@{img-url}/@{slider-right-handle}");

	qproperty-HandleLeftGrayPixmap: url("@{img-url}/@{slider-left-handle-disabled}");
  qproperty-HandleRightGrayPixmap: url("@{img-url}/@{slider-right-handle-disabled}");
}