


/*
##############################
		Widget
##############################
*/
QWidget:focus
{
    border: 2px solid palette(highlight);
}
QWidget[error="true"]{ background-color: #880000; }

/*
##############################
		GroupBox
##############################
*/
QGroupBox
{
	border: 1px solid palette(dark);
	margin-top: 3ex;
}
QGroupBox[flat="true"]
{
	border: none;
	border-top: 1px solid palette(dark);
	margin-top: 3ex;
}
QGroupBox::title
{
	subcontrol-origin: margin;
	subcontrol-position: top left; 
	/*padding: 0 5px;*/
	background-color: palette(window);
}
QGroupBox::indicator
{
    border-bottom: 5px solid palette(window);
    border-right: 5px solid palette(window);
    border-top: 5px solid palette(dark);
    border-left: 5px solid palette(window);
    width: 0px;
    height: 0px;
    background: transparent;
}
QGroupBox::indicator:unchecked
{
    border-right: 5px solid palette(window);
    border-bottom: 5px solid palette(window);
    border-left: 5px solid palette(dark);
    border-top: 5px solid palette(window);
    width: 0px;
    height: 0px;
    background: transparent;
}
QGroupBox:focus
{
	/* prevent QWidget:focus to affect checkable group boxes */
	border-width: 1px;
    border-color: palette(dark);
}


/*
##############################
		ToolButton
##############################
*/
QToolButton
{
	border: palette(dark);
	border-width: 1px;
	border-style: solid;
	border-radius: 2px;
	padding: 1px;
}
QToolButton:checked
{
	background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4d4d4d, stop: 0.1 #646464, stop: 1 #5d5d5d);
	background: palette(midlight);
	image: none;
	border-right: 1px solid palette(light);
	border-bottom: 1px solid palette(light);
	border-top: 1px solid palette(dark);
	border-left: 1px solid palette(dark);
}
QToolButton:hover
{
	border: 1px solid palette(midlight);
}

QToolButton[square="true"]{ border-radius: 0px; }

QToolButton[no_border="true"]{ border: none; }
QToolButton[no_border="true"]:hover{
	border: 1px solid palette(midlight);
}

QToolButton[hide_arrow="true"]::menu-indicator { image: none; }
QToolButton[tight_layout="true"]{ padding-left: -.5em; padding-right: -.5em; }

/*
###############################
		PushButton
###############################
*/
QPushButton
{
	border: 1px solid palette(dark);
	border-radius: 5px;
	padding: 5px;
	text-align: center;
}
QPushButton:hover
{
    background-color: palette(midlight);
}
QPushButton:pressed
{
    background-color: palette(mid);
}
QPushButton:focus
{
	border: 1px solid palette(midlight);   
}
QPushButton:edit-focus
{
	border: 5px solid palette(midlight);   
}
QPushButton:checked
{
	background-color: palette(base);
}

/*
###############################
		ComboBox
###############################
*/
QComboBox
{
	border: 1px solid palette(dark);
	border-radius: 5px;
	padding: 5px;
	text-align: center;
}
QComboBox QAbstractItemView 
{
	border: 1px solid palette(shadow);
	border-top: none;
}
QComboBox QAbstractItemView::focus
{
	border: 1px solid palette(shadow);
	border-top: none;
}
QComboBox:editable
{
	background: palette(base);
}
QComboBox:!editable
{
	background: palette(window);
	border: 1px solid palette(dark);
	border-radius: 5px;
	padding: 5px;
	text-align: center;
}
QComboBox:!editable:focus
{
	border: 1px solid palette(highlight);
}
QComboBox::!editable:on
{
	border-radius: 0px;
	border-top-left-radius: 5px;
	border-top-right-radius: 5px;
}

QComboBox::drop-down:!editable
{	
	background: palette(mid);
	border: none;
    border-left: 1px solid palette(dark);
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    width: 1em;
}
QComboBox::drop-down:!editable:on
{	
    border-bottom-right-radius: 0px;
}
QComboBox::drop-down
{	
	background: palette(mid);
	border: none;
    border-left: 1px solid palette(dark);
    width: 1em;
}
QComboBox::down-arrow
{
    border: none;
    border-right: 3px solid palette(mid);
    border-top: 5px solid palette(midlight);
    border-left: 3px solid palette(mid);
    border-radius: 0px;
    width: 0px;
    height: 0px;
    background: transparent;
}
QComboBox::down-arrow:on
{
    border: none;
    border-right: 3px solid palette(mid);
    border-bottom: 5px solid palette(midlight);
    border-left: 3px solid palette(mid);
    border-radius: 0px;
    width: 0px;
    height: 0px;
    background: transparent;
}
 
/*
###############################
		Value Widgets
###############################
*/
QTextEdit {
	font: 9pt "Courier";
	border: 2px solid palette(dark);
}
QTextEdit:read-only{
	background-color: palette(window);
	border: 1px solid palette(dark);
}
QTextEdit[edited="false"]{ background-color: palette(base); }
QTextEdit[edited="true"]{ background-color: #000044; }
QTextEdit[applying="true"]{ background-color: #440044; }
QTextEdit[error="true"]{ background-color: #440000; }

QLineEdit,
#ImageEditor {
/*
	border: 2px solid palette(dark);
	padding: 10px;
*/
	background-color: palette(base);
	border: 2px solid palette(dark);
	padding: 5px;
}
QLineEdit[edited="true"], 
#ImageEditor[edited="true"]{ background-color: #000044; }
QLineEdit[applying="true"], 
#ImageEditor[applying="true"]{ background-color: #440044; }
QLineEdit[error="true"], 
#ImageEditor[error="true"]{ background-color: #440000; }
QLineEdit:read-only{
	background-color: palette(window);
	border: 1px solid palette(dark);
}
QSpinBox {
	border: 2px solid palette(dark);
}
QDateEdit {
	border: 2px solid palette(dark);
}
QDateTimeEdit {
	border: 2px solid palette(dark);
}

QDockWidget MapFieldFilterLineEdit {
    padding: 2px;
    font-size: 9pt;
}

/*
###############################
		PROGRESS BAR
###############################
*/
QProgressBar:horizontal {
	border: 2px solid palette(dark);
    background-color: palette(base);
	text-align: left;
	margin-left: 3em;
	height: 1em;
}
QProgressBar::chunk:horizontal {
	background: palette(Highlight);
}

/*
###############################
		Views
###############################
*/
QAbstractItemView {
	border: 2px solid palette(dark);
}

QHeaderView {
	border: none;
}
QHeaderView::section {
     background-color: palette(window);
     padding: 2px;
     padding-left: 4px;
     border: none;
     border-right: 1px solid palette(shadow);
     border-bottom: 1px solid palette(shadow);
 }
 
/*
###############################
		ToolBar
###############################
*/
QToolBar
{
	border: none;
	spacing: 2px;
	margin: 5px;
}
QToolBar::handle
{
	border-top: 2px solid palette(midlight);
	border-left: 2px solid palette(midlight);
	border-right: 2px solid palette(dark);
	border-bottom: 2px solid palette(dark);
}
QToolBar::handle:vertical
{
	margin-bottom: 10px;
	height: 1px;
}
QToolBar::handle:horizontal
{
	margin-right: 10px;
	width: 1px;
}

/*
###############################
		MenuBar
###############################
*/
QMenuBar {
    background-color: palette(window);
    border: none;
    padding: 2px;
}

xx_QMenuBar::item {
	spacing: 3px; /* spacing between menu bar items */
	padding: 1px 4px;
	background: transparent;
	border-radius: 4px;
}
QMenuBar::item
{
    background-color: palette(window);
	margin: 1px;
    padding: 2px;
}

QMenuBar::item:selected { /* when selected using mouse or keyboard */
    background-color: palette(highlight);
    color: palette(highlightedtext);
}

QMenuBar::item:pressed {	
    background-color: palette(highlight);
    color: palette(highlightedtext);
}


/*
###############################
		Menu
###############################
*/

QMenu
{
    border: 1px solid palette(shadow);
    padding: 2px;
}
QMenu::item
{
	margin: 1px;
    padding: 2px 30px 2px 30px;
	border: 1px solid transparent; /* reserve space for selection border */
}
QMenu::item:selected
{
    background-color: palette(highlight);
    color: palette(highlightedtext);
}
QMenu::separator
{
    height: 1px;
    border-top: .5em solid palette(window);
    border-bottom: .5em solid palette(window);
    background: palette(text);
}
QMenu::icon
{
	padding: 2px;	
}
QMenu::icon:checked
{
	border-right: 1px solid palette(midlight);
	border-bottom: 1px solid palette(midlight);
	border-top: 1px solid palette(dark);
	border-left: 1px solid palette(dark);
	subcontrol-position: left;
	subcontrol-origin: padding;
}
QMenu::icon:!checked
{
	padding: 3px;
}
QMenu::indicator
{
	width: 7px;
	height: 7px;
	margin: 4px;
	border-radius: 5px;
	border: 2px solid palette(shadow);
}
QMenu::indicator:checked
{
	background-color: palette(midlight);
}
QMenu::indicator:unchecked
{
	border: 2px solid palette(shadow);
}
QMenu::indicator:indeterminate
{
	border: 2px solid yellow;
}



/*
###############################
		ScrollArea
###############################
*/
QScrollArea
{
	border: none;
}


/*
###############################
		ScrollBar
###############################
*/
QScrollBar
{
	border: 1px solid palette(dark);
    background: palette(dark);
}
QScrollBar::handle
{
    background: palette(mid);
}
QScrollBar::add-line
{
	border: 1px solid palette(dark);
    background: palette(mid);
}
QScrollBar::sub-line
{
	border: 1px solid palette(dark);
	background: palette(mid);
}

/*
######	Horizontal
*/
QScrollBar:horizontal 
{
    height: 10px;
    margin: 0px 10px 0 10px;
}

QScrollBar::handle:horizontal
{
    min-height: 20px;
}

QScrollBar::add-line:horizontal
{
	width: 10px;
	subcontrol-position: right;
	subcontrol-origin: margin;
}

QScrollBar::sub-line:horizontal 
{
	width: 10px;
	subcontrol-position: left;
	subcontrol-origin: margin;
}

QScrollBar::left-arrow:horizontal
{
    border: none;
    border-top: 3px solid palette(mid);
    border-right: 5px solid palette(midlight);
    border-bottom: 3px solid palette(mid);
    border-radius: 0px;
    width: 0px;
    height: 0px;
    background: transparent;
}

QScrollBar::right-arrow:horizontal
{
	border: none;
	border-top: 3px solid palette(mid);
	border-left: 5px solid palette(midlight);
	border-bottom: 3px solid palette(mid);
	border-radius: 0px;
	width: 0px;
	height: 0px;
	background: transparent;
}

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


/*
######	Vertical
*/
QScrollBar:vertical
{
    width: 10px;
    margin: 10px 0 10px 0;
}

QScrollBar::handle:vertical
{
    min-height: 20px;
}

QScrollBar::add-line:vertical
{
	height: 10px;
	subcontrol-position: bottom;
	subcontrol-origin: margin;
}
QScrollBar::sub-line:vertical
{
	height: 10px;
	subcontrol-position: top;
	subcontrol-origin: margin;
}

QScrollBar::up-arrow:vertical
{
    border: none;
    border-right: 3px solid palette(mid);
    border-bottom: 5px solid palette(midlight);
    border-left: 3px solid palette(mid);
    border-radius: 0px;
    width: 0px;
    height: 0px;
    background: transparent;
}
QScrollBar::down-arrow:vertical
{
    border: none;
    border-right: 3px solid palette(mid);
    border-top: 5px solid palette(midlight);
    border-left: 3px solid palette(mid);
    border-radius: 0px;
    width: 0px;
    height: 0px;
    background: transparent;
}
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical
{
      background: none;
}





/*
#############################################
		DockWidget and MainWindow Separator
#############################################
*/

xx__QDockWidget
{
	border: 50px solid #00f;
	background-color: blue; /* bg when floating */
}

QDockWidget::title
{
    text-align: center;
    background-color: palette(highlight);
    border: 3px solid palette(highlight);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}
QDockWidget::float-button
{
	border-radius: 8px;
	subcontrol-position: left;
	subcontrol-origin: content;
    background-color: palette(highlight);
}
QDockWidget::close-button
{
	border-radius: 8px;
	subcontrol-position: right;
	subcontrol-origin: content;
    background-color: palette(highlight);
}
QDockWidget::close-button:hover
{
    background-color: palette(midlight);
}
QDockWidget::float-button:hover
{
    background-color: palette(midlight);
}

QDockWidget::close-button:pressed, QDockWidget::float-button:pressed
{
    padding: 1px -1px -1px 1px;
}


QMainWindow::separator
{
	height: 1px;
	width: 1px;
	
    background-color: palette(dark); 
	border: 2px solid palette(window);	
}

QMainWindow::separator:hover
{
    background-color: palette(highlight);
	border: 2px solid palette(window);	
}

/*
#############################################
		Splitter
#############################################
*/
QSplitter::handle {
    background-color: palette(highlight);
	padding: 0px;
	margin: 1px;
}
QSplitter::handle:horizontal {
	width: 2px;
	
	margin-top: 0px;
	margin-bottom: 0px;
}
QSplitter::handle:vertical {
	height: 2px;

	margin-left: 0px;
	margin-right: 0px;
}





/*
#############################################
		TabWidget
#############################################
*/

QTabWidget::pane {
    border: 1px solid palette(midlight);
    background-color: palette(window);
    margin-top: -1px;
    padding: 5px;
}
QTabBar{
    background-color: palette(dark);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    alignment: center;
    margin-top: 3px;
}
QTabBar::tab {
    border: 1px solid palette(midlight);
    border-bottom-style: none;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 5px;
    padding-bottom: 5px;
    
    margin-right: -5px;
}
QTabBar::tab:first
{
	border-top-left-radius: 10px;
}
QTabBar::tab:last
{
    margin-right: 0;
    border-top-right-radius: 10px;
}

QTabBar::tab:!selected
{
    color: #b1b1b1;
    border-bottom-style: solid;
    margin-top: 3px;
    background-color: palette(dark);
}

QTabBar::tab:selected
{
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    margin-bottom: 0px;
    background-color: palette(highlight);
}
QTabBar::tab:first:selected
{
    border-top-left-radius: 10px;
    border-top-right-radius: 3px;
}
QTabBar::tab:last:selected
{
    border-top-left-radius: 3px;
    border-top-right-radius: 13px;
}


QTabBar::tab:!selected:hover
{
    background-color: palette(midlight);
}


/*
#############################################
		PopupMenu
#############################################
*/
PopupMenu {
    border: 1px solid palette(dark);
}

PopupMenu QListWidget {
	background: palette(window);
	border : none;
}

PopupMenu QListWidget:focus
{
    border: none;
}

PopupMenu QListWidget::item:hover {
    background: palette(highlight);
    color: palette(highlighted-text);
}