QWidget {
 color: black;
 margin: 0px;
}

/* The background of the tab bar */
QMainWindow, BlogView {
    background-color: #ececec;
    padding: 0;
    margin: 0;
}

/* View backgrounds. Some of these may be overlapping or unnecessary. */
/* XXX: some of these are just shit
QScrollArea, QWidget#layoutWidget, QListWidget
{ 
  background: qlineargradient(
    x1: 0, y1: 0, x2: 0, y2: 1,
    stop: 0 #F0F0F0, stop: 1 #A3A3A3);
    color: black;
    padding: 0;
    margin: 0;
}
*/

/* XXX: waaay too generic, but oh so important... */
/* This is the cause of all those `... QLabel { background: none; }` things down there */
QFrame {
    background-color: #ececec;
}

/* Dialogs */
QDialog {
 background-color: #ececec;
 border: 1px solid #21759B;
}

/* Add post/page specials */
AddPostView > QLabel, 
WritePageView > QLabel 
{
 padding: 0.2em 0 0.2em 0;
}

/* Form fields */
QLabel {
 background: #ececec;
 padding: 0;
 margin: 0;
 color: black;
}

/* Form fields */
QLabel#dateTimeLabel, 
QLabel#dateLabel,
QLabel#blogStartLabel,
QLabel#resizeLabel
{
    background: none;
    padding: 0;
    margin: 0;
    color: black;
}

QCheckBox {
 background: none;
 color: #848484;

}

QCheckBox:focus {
 color: black;
}

/* Seems not to work, why?
QCheckBox::indicator {
 border: 1px solid gray;
 border-radius: 2px;
}
*/

QLineEdit, QTextEdit {
 border: 1px solid gray;
    
    background: #fafafa;
 
    color: #848484;

 padding: 0.2em;
 border-radius: 3px;
}

QLineEdit:focus, QTextEdit:focus {
 border: 1px solid black;

 color: black;
}

QTextEdit {
 /* Text color can't really be set * /
 color: black;
    */
}

/* 
 * Push-button controls 
 */
QPushButton,
QComboBox::drop-down,
QDateTimeEdit::drop-down,
QCalendarWidget QToolButton
{
    /* Blue gradient */
    background: qlineargradient(
        x1: 0, y1: 0, 
        x2: 0, y2: 1,
        stop: 0 #3783a5, 
        stop: 1 #1e698c
    );

 border: 1px solid #b3b3b3;
 border-radius: 4px;

 padding: 0.5em;

    /* White text against blue background */
    color: white;
}

QPushButton:focus {
    /* XXX: come up with some focus indicator 
    border: 1px solid black;
    */
}

QPushButton:pressed,
QComboBox::drop-down:pressed, 
QDateTimeEdit::drop-down:pressed,
QCalendarWidget QToolButton:pressed
{
    /* XXX: update */
    background: qlineargradient(
        x1: 0, y1: 1, 
        x2: 0, y2: 0,
        stop: 0 #3783a5, 
        stop: 1 #1e698c
    );
}

QPushButton:checked {
    /* XXX: update */
    background: qlineargradient(x1: 0, y1: 1, x2: 0, y2: 0,
                    stop: 0 #77c3e5, stop: 1 #5ea9cc);
}

/* QComboBox/QDateTime popups*/
QComboBox, QDateTimeEdit {
        background: none;

        border: 1px solid gray;
        border-radius: 3px;

        padding: 0.2em;

        color: gray;
}

QComboBox:focus, QDateTimeEdit:focus {
        border: 1px solid black;

        color: black;
}

/* The drop-down arrow button */
QComboBox::drop-down, QDateTimeEdit::drop-down {
 min-width: 20px;
 max-width: 20px;
 
    /* XXX: ??? */
    margin: -1px;
}

QComboBox::down-arrow, QDateTimeEdit::down-arrow {
    /* Custom dropdown symbol */
 image: url(:/images/downarrow-bg.png);
}

QDateTimeEdit * {
    color: black;
    background: #ececec;
    border: 1px solid gray;
    selection-color: white;
    selection-background-color: #21759b;
}

QCalendarWidget > QWidget {
    border: none;
}

/* Popup menu */
PopupMenu {
    background-color: #21759b; /* Light blue */
    background-clip: margin;

    color: white;
    
    padding: 0px;
}

PopupMenu::item {
    padding: 10px 40px;
    margin: 0px 5px;

    font-size: 20pt;

    border-top: 1px solid #5d8a9e;

    /* XXX: no go, needs QStyle::PM_SmallIconSize: icon-size: 30px */
}

PopupMenu::item:selected {
    background-color: #d2d2d2; /* Light grey */
    background-clip: margin;

    border-top: none;

    color: #333333; /* Dark grey */
}

/* XXX: doesn't work */
PopupMenu::item:first {
    border-top: none;
}


/* RichTextEdit */
RichTextEdit QPushButton#boldButton {
        font-weight: bold;
}

RichTextEdit QPushButton#italicButton {
    font-style: italic;
}

RichTextEdit QPushButton#quoteButton {
    font-style: normal;
    font-weight: normal;
}

RichTextEdit QPushButton#linkButton {
    color: #cce0f0;
    text-decoration: underline;
}

/*
 * Statistics View
 */
StatisticsView QTabWidget::tab-bar {
    subcontrol-position: center center;
}

StatisticsView QTabBar {
    /* Horizontal gradient */
    background-clip: border;
    background: qlineargradient(
        x1: 0,   y1: 0, 
        x2: 1,   y2: 0,
        stop: 0 #eeeeee,
        stop: 1 #c5c5c5
    ); 

    /* Drawn by tabs/gradient */
    border: none;
}

StatisticsView QTabBar::tab {
    color: #737373;
}


StatisticsView QTabBar::tab:selected {
    background: #ececec;

    /* border-width in code */
    border-style: solid;
    border-color: #c4c4c4;
}

StatisticsView QTabWidget::pane {
    margin: 0;
    border: none;
}

/* XXX: need to override gradient defined earlier */
StatisticsView QTabWidget::pane > QWidget
{
    /* XXX: move the background to ::pane? */
    padding: 5px;

    /* Horizontal gradient */
    background: qlineargradient(
        x1: 0, y1: 0, x2: 1, y2: 0,
        stop: 0 #ececec, stop: 1 #dbdbdb
    );
}

StatisticsView QLabel {
    /* XXX: override */
    background: none;
    text-align: center;
    font-weight: bold;
    color: #333;
}

/* Make this look solid */
StatisticsView #closeButton {
    margin: 0px;

    /* Vertical gradient */
    background: qlineargradient(
        x1: 0, y1: 0, x2: 0, y2: 1,
        stop: 0 #3c3c3c, stop: 1 #232323
    );

    border: none;
    border-radius: 0px;

    color: #ffffff;
}

StatisticsView #closeButton:pressed {
    /* XXX: simulate alpha */
    background: qlineargradient(
        x1: 0, y1: 0, x2: 0, y2: 1,
        stop: 0 #a0a0a0,
        stop: 1 #878787
    );
}

StatsListView QTextBrowser,
StatsListView QTextBrowser:focus
{
    border: 1px solid #aaa;
    border-radius: 2px;
    color: black;
}

/* 
 * Layout 
 */
QMainWindow > QWidget#layoutWidget {
    margin: 0px;
    padding: 0px;
}

/* 
 * Title bar 
 */
WPTitleBar {
    margin: 0px;
    padding: 0px;

    font-family: Arial; 

    background: qlineargradient(
        x1: 0,   y1: 0, 
        x2: 0,   y2: 1,
        stop: 0 #797979,
        stop: 1 #686868
    );
}

WPTitleBar QLabel {
    margin: 0px;
    background: none;
    color: #ececec;
}

/* Button on left side */
WPTitleBar QPushButton {
    margin: 0px;
    padding: 0px;

    background: none;
    
    color: #ececec;
    
    border: none;
    border-radius: none;
    border-right: 1px solid #505050;
}

/*
 * Menu 
 */
WPMenu {
    margin: 0px;
    padding: 0px;
}

WPMenuButton {
    margin: 0px;

    /* XXX: this is a horizontal gradient, it's just drawn flipped */
    background: qlineargradient(
        x1: 0,   y1: 0, 
        x2: 0,   y2: 1,
        stop: 0 #3c3c3c,
        stop: 1 #232323
    );

    color: #ffffff;

    font-family: Arial;

    border: none;
    border-radius: 0px;

/*    
    border-left: 1px qlineargradient(
        x1: 0, y1: 0,
        x2, 0, y2: 1,
        stop: 0 #585858,
        stop: 1 #434343
    );
*/    
}

/*
WPMenuButton:first {
    border-left: none;
}
*/

WPMenuButton:pressed {
    /* Simulate alpha */
    background: qlineargradient(
        x1: 0, y1: 0, 
        x2: 0, y2: 1,
        stop: 0 #a0a0a0,
        stop: 1 #878787
    );
}


/*
 * Default style for widgets
 */
QComboBox:focus, QDateTimeEdit:focus {
    border: 1px solid black;
}

QComboBox::drop-down:focus, QDateTimeEdit::drop-down:focus {
    border: 1px solid black;
}

/* 
 * Content view 
 */
QStackedWidget {
 padding: 0px;
 margin: 0px;
}

QStackedWidget > * {
    margin: 0px;
    padding: 0px;
}


/* CategoryView */
CategoryView {
    padding: 0px;
    
    /* Solid */
    background: #ececec;
}

QTreeView {
    margin: 0px 0px 5px 0px;

    /* Solid */
    background-color: #ececec;
    color: black;

    /* ??? on Maemo */
    show-decoration-selected: 0;

    /* Do not decorate branches on maemo */
    selection-background-color: #ececec;
    selection-color: black;
}

QTreeView::item {
    padding: 5px 10px;

    /* XXX: doesn't really apply */
    min-height: 20px;
   /* max-height: 80px;*/

    font-size: 18px;

    /* Gradient */
    background: qlineargradient(
        x1: 0, y1: 0, 
        x2: 0, y2: 1,
        stop: 0 #f1f1f1,
        stop: 1 #d6d6d6
    );

    border-bottom: 1px solid #b2b2b2;
 border-radius: 0px;
}

/* XXX: uncommenting these messes up the entire QSS */
QTreeView::item {
/*    border-top: qlineargradient(
        x1: 0, y1: 0,
        x2: 0, y2: 1,
        stop: 0.0 rgb(236, 236, 236),
        stop: 0.5 rgb(205, 205, 205),
        stop: 1.0 rgb(156, 156, 156)
    ); */
}

QTreeView::item {
/*    border-bottom: qlineargradient(
        x1: 0, y1: 1,
        x2: 0, y2: 0,
        stop: 0.0 rgb(236, 236, 236),
        stop: 0.5 rgb(205, 205, 205),
        stop: 1.0 rgb(156, 156, 156)
    );
    */
}

QTreeView::item:focus {
    background: #ffffff;
}

/* XXX: style from UX */
QTreeView::item:selected {
    /* Use background-color here in addition to selection-background-color */
    background-color: #B2D9FB;    /* Blue */
    color: black;
}

QTreeView::branch {

}

/* XXX: more generic style across all main views */
CategoryView QPushButton {
    margin: 5px;
}

/* 
 * SinglePostView 
 */
SinglePostView {
    background-color: #ececec;
}

SinglePostData #content,
AddComment QTextEdit
{
    background-color: #fafafa;
}

/* SinglePostData */
SinglePostData {
    border: none;
}

SinglePostData #title {
    padding: 5px;

    margin-top: 10px;
    margin-left: 15px;
    padding-left: 0px;

 font-size: 20px;
    color: #737373;
}

SinglePostData #content {
    border-width: 8px 0px;
    border-style: solid;
    border-top-color: qlineargradient(
        x1: 0, y1: 0,
        x2: 0, y2: 1,
        stop: 0.0 #ececec,
        stop: 0.5 #cdcdcd,
        stop: 1.0 #9c9c9c
    );
    border-bottom-color: qlineargradient(
        x1: 0, y1: 1,
        x2: 0, y2: 0,
        stop: 0.0 #ececec,
        stop: 0.5 #cdcdcd,
        stop: 1.0 #9c9c9c
    );
    margin: 0px;
    padding: 0.5em 1em;

    font-size: 18px;
}

SinglePostData #date 
{
    margin-left: 15px;
    padding-left: 0px;

    font-size: 18px;
    font-style: italic;
}

SinglePostData #categories, 
SinglePostData #tags
{
    margin-left: 15px;
    padding-left: 0px;

    font-size: 12px;
}

/* AddComment */
AddComment {
    border: none;

    margin-top: 1em;
}

AddComment #commentTitle {
    /* XXX: this should be default label font */
 font-size: 20px;
    color: #737373;
}

AddComment QPushButton#discardButton {
    /* Grey */
    background: qlineargradient(
        x1: 0, y1: 0, 
        x2: 0, y2: 1,
        stop: 0 #b1b1b1,
        stop: 1 #979797
    );
}

/* CommentList */
WPCommentList QLabel#approvedLabel,
WPCommentList QLabel#unapprovedLabel 
{
    /* XXX: this should be default label font */
 font-size: 20px;
    color: #737373;

    padding: 5px;
}

WPCommentListItem {
    /* XXX: Generic ListItem background gradient */
    background: qlineargradient(
        x1: 0, y1: 0, 
        x2: 0, y2: 1,
        stop: 0 #f1f1f1,
        stop: 1 #d6d6d6
    );

    /* Sep */
    border: none;
    border-top: 1px solid #b2b2b2;
}

WPCommentListItem:focus {
    background: #ffffff;
}

WPCommentListItem QLabel
{
    /* XXX: override any generic background color set for QLabel.. */
    background: none;
}

WPCommentListItem #commentText {
 font-size: 18px;
}

WPCommentListItem QLabel#avatar
{
    padding: 5px;
}

WPCommentListItem QLabel#postTitle,
WPCommentListItem QLabel#authorName,
WPCommentListItem QLabel#email,
WPCommentListItem QLabel#timeStamp,
WPCommentListItem QLabel#url 
{
 font-size: 16px;
}

WPCommentListItem #postTitle{
   font-style: italic;
}

/* MediaSelectionList */
CheckableListItem {
    /* Gradient */
    /* XXX: Generic ListItem background gradient */
    background: qlineargradient(
        x1: 0, y1: 0, 
        x2: 0, y2: 1,
        stop: 0 #f1f1f1,
        stop: 1 #d6d6d6
    );
    
    /* Sep */
    border: none;
    border-bottom: 1px solid #b2b2b2;
    
 margin: 0px 8px;
    padding: 5px 8px;

    height: 80px;
}

CheckableListItem:focus {
    background: #ffffff;
}

/* XXX: fix the QFrame/QLabel background: above ^^ */
CheckableListItem QLabel {
    background: none;
}

CheckableListItem QLabel#titleLabel {
 font-size: 20px;
}

CheckableListItem QLabel#sizeLabel, 
CheckableListItem QLabel#modifiedLabel 
{
 font-size: 16px;
}

CheckableListItem QLabel#thumbLabel {
    padding: 0px;

    max-width: 90px;
    max-height: 70px;
}

/* Setup blog */
SetupBlog QLabel {
    padding: 5px;
}

SetupBlog QLabel#resizeLabel {
    font-size: 12px; /* small */
}

SplashScreen {
 background: qlineargradient(
    x1: 0, y1: 0, x2: 0, y2: 1,
    stop: 0 #F0F0F0, stop: 1 #D6D6D6);
}

SplashScreen QLabel {
 font-size: 25px;
 background-color: transparent;
}
