/* 
QCAD Dark Theme
IconPostfix:inverse

-- Leave this header intact --
*/

/* Affects QTreeView, QTextEdit, QLabel, etc. if not overwritten below */
QFrame,
QDialog {
    background-color: #2D2F32;
}

QLabel, QCheckBox, QRadioButton {
    background-color: transparent;
    color: #DEDEDE;
    selection-color: #DEDEDE;
}

QStatusBar {
    background-color: #2D2F32;
    color: #DEDEDE;
}

QMenu, QMenu::item {
    background-color: #2D2F32;
    color: #DEDEDE;
}

QMenu {
    border: 1px solid #2d2d2d;
}
QMenu::item:disabled {
    /*color: #323232;*/
    color: #707070;
}
QMenu::item:selected {
    background-color: #157EF2;
}
QMenu::icon {
    border: 0px solid transparent;
    background-color: transparent;
}
QMenu::icon:checked {
    background-color: blue;
    border: 1px inset red;
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    left: 1px;
}
QMenu::separator {
    height: 2px;
    background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 #282a2b, stop:1 #45484b);
    margin: 0 1px;
}

QTextEdit,
QPlainTextEdit {
    background-color: #404040;
    color: #DEDEDE;
}


QDialog#AboutDialog QTextBrowser,
QDialog#AboutDialog QPlainTextEdit {
    background-color: #222222;
}

QDialog#TextDialog QTextEdit#Text {
    background-color: white;
}

/*
QLineEdit {
    background-color: #67686A;
    color: #DEDEDE;

    / *background-origin: border;
    border: 1px solid #646464;
    selection-background-color: #4b6eaf;* /
}
*/

QStackedWidget {
    background-color: #222222;
}

/*QComboBox > QWidget > QLineEdit {
    color: #DEDEDE;
    background-color: #696969;
}*/

/*QComboBox::drop-down {
    background: palette(base);
}*/

QComboBox QAbstractItemView {
    background-color: #696969;
    color: #DEDEDE;
}

/* Dock widgets: */
QDockWidget {
    /*background-color: transparent;*/
    background-color: #2D2F32;
    /* Affects also text in title bar when docked: */
    color: #DEDEDE;
}
QDockWidget::title {
    background: #535353;
    text-align: center;
    padding-left: 5px;
}

QDockWidget > QWidget {
    background: transparent;
    background: #535353;
}

QTreeView {
    background-color: #1B1D20;
    color: #DEDEDE;
}
QTreeView::branch,
QAbstractItemView::item {
    background-color: #1B1B1B;
    color: #DEDEDE;
}
QTreeView::branch:selected:active,
QAbstractItemView::item:selected {
    background-color: #005DE5;
}
QHeaderView {
    color: #DEDEDE;
}
/*QTreeView::branch,
QAbstractItemView::item {
    background-color: #1B1B1B;
}
QTreeView::branch:selected:active,
QAbstractItemView::item:selected {
    background-color: #4b6eaf;
}*/

QListView {
    background-color: #1B1D20;
    color: #DEDEDE;
}

/* Group box */
QGroupBox {
    border: 1px solid #45474A;
    background-color: #343638;
    margin-top: 1.2em;
}

/* Scroll areas: */
QScrollArea {
    background: transparent;
    /*background-color: #2D2F32;*/
}
QScrollArea > QWidget > QWidget {
    background: transparent;
}
QScrollArea > QWidget > QScrollBar {
    background: palette(base);
}

QGroupBox::title {
    /* place label of group box higher: */
    subcontrol-origin: margin;
    subcontrol-position: top left;
    font-size: 80%;

    /*
    padding: 0 3px;
    background-color: #2D2F32;
    */
    color: white;
}

/*QTreeView::branch:selected:active {
    background-color: #4b6eaf;
}*/

/*QAbstractItemView::item:selected {
    background-color: #4b6eaf;
}*/

QToolBar {
    border-width: 0; /* Cancels gradiend */
    background-color: #282A2D;
}

QToolButton {
  background-color: transparent;
}

QToolButton:checked {
  background-color: #848484;
}

QToolButton:pressed {
  background-color: #949494;
}

QToolButton:disabled {
  background-color: #323232;
}

/* Options tool bar */

/* Current tool icon in options tool bar */
QToolBar#Options QLabel#Icon {
    border-radius: 6px;
    background-color: qlineargradient(spread:pad, x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #666666, stop: 0.5 #888888, stop: 1 #666666 );
    /*background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #666666, stop:1 #555555);*/
    /*border: 2px solid #555555;
    border: 1px solid #27292a;*/
    border: 1px solid #27292a;
    border-top: 1px solid #797B7E;
    border-right: 1px solid #797B7E;
    margin: 3px 3px 3px 3px;
}

/* Tool buttons in options tool bar and CAD tool bar */
QDockWidget QToolButton,
QDialog QToolButton,
QToolBar#Options QToolButton,
QToolBar#CadQToolBar QToolButton,
QTreeWidget#ToolMatrix QToolButton {
    border: 1px solid #27292a;
    border-top: 1px solid #797B7E;
    border-right: 1px solid #797B7E;
    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #505050, stop:1 #404040);
}
QDockWidget QToolButton:checked,
QDialog QToolButton:checked,
QToolBar#Options QToolButton:checked,
QToolBar#CadQToolBar QToolButton:checked,
QTreeWidget#ToolMatrix QToolButton:checked {
    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #909090, stop:1 #808080);
}
QDockWidget QToolButton:pressed,
QDialog QToolButton:pressed,
QToolBar#Options QToolButton:pressed,
QToolBar#CadQToolBar QToolButton:pressed,
QTreeWidget#ToolMatrix QToolButton:pressed {
  /*background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #777777);*/
  background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #909090, stop:1 #808080);
}
QDockWidget QToolButton:disabled,
QDialog QToolButton:disabled,
QToolBar#Options QToolButton:disabled,
QToolBar#CadQToolBar QToolButton:disabled,
QTreeWidget#ToolMatrix QToolButton:disabled {
    border: 1px solid #101010;
    border-top: 1px solid #303030;
    border-right: 1px solid #303030;
    background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #202020, stop:1 #303030);
}

QTreeView::branch:has-siblings:adjoins-item,
QTreeView::branch:has-siblings:!adjoins-item,
QTreeView::branch:!has-children:!has-siblings:adjoins-item {
    border-image: none;
    image: none;
}
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
    border-image: none;
    image: url(triangle_right.png);
}
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings {
    border-image: none;
    image: url(triangle_down.png);
}

QDialog QToolButton {
    padding: 4px;
}

/* Tab bar: */
QTabBar::tab {
    background-color: #1D1D1D;
    color: #DEDEDE;
    /*border-bottom: 1px solid #121212;*/
    border: 1px solid #2D2D2D;
    /*border-bottom: 1px solid #121212;*/
    padding: 4px;
}
QTabBar::tab:selected {
    background-color: #2E2E2E;
    border: 1px solid #4D4D4D;
    color: #DEDEDE;
    border-bottom: 1px solid #121212;
}

QTabBar::close-button { 
    image: url(close.png);
    subcontrol-position: left;
} 

QTabBar::close-button:hover {
    image: url(close-hover.png);
}

/* CAD tool bar tool buttons */
/*QToolBar#CadQToolBar QToolButton {
  border: 1px solid #27292a;
  border-top: 1px solid #797B7E;
  border-right: 1px solid #797B7E;
  background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #505050, stop:1 #404040);
}*/
/*QToolBar#CadQToolBar QToolButton:checked {
  background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #909090, stop:1 #808080);
}*/


/*QApplication,
QMainWindow, QFrame, QDockWidget, QDialog, QFileDialog, QMessageBox,
QMenuBar, QMenu, QMenu::item,
QTreeView, QListWidget, QListView, QTableWidget, QTableView,
QTextEdit, QTextBrowser, QToolBar {*/
/*QToolBar {
    background-color: #2D2F32;
    color: white;
}*/


/* Scroll bar modifications */
QScrollBar {
    background-color: transparent;
    margin: 0;
    height: 12px;
    width: 12px;
}
QScrollBar::handle {
    border: 1px solid #555555;
    border-radius: 4px;
    margin: 1px;
}
QScrollBar::handle:vertical {
    background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop:0 #5c5c5c, stop:1 #515151);
    min-height: 20px;
    min-width: 8px;
}
QScrollBar::handle:vertical:hover {
    background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop:0 #666666, stop:1 #5b5b5b);
}
QScrollBar::handle:horizontal {
    background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 #5c5c5c, stop:1 #515151);
    min-height: 8px;
    min-width: 20px;
}
QScrollBar::handle:horizontal:hover {
    background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 #666666, stop:1 #5b5b5b);
}
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical,
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
    background-color: transparent;
}
QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical,
QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal {
    height: 0;
    width: 0;
}

/* Background of tool matrix panels */
QTreeWidget#ToolMatrix > QWidget > QWidget {
    background-color: #282A2D;
}

QTreeWidget#ToolMatrix QToolButton {
    color: #DEDEDE;
}

/* ToolTip */
/*
QToolTip, QTipLabel {
    border: 1px solid #3D3D3D;
    border-radius: 3px;
    background: #292929;
    color: #DEDEDE;
    margin: 0;
    padding: 0;
}
*/

QMainWindow::separator {
    background-color: #2D2F32;
    spacing: 0;
    padding: 0;
    margin: 0;
}
