

/**************
 * Tree Views *
 **************/
treeview.view {
  -GtkTreeView-grid-line-width: 0;
  -GtkTreeView-grid-line-pattern: '';
  -GtkTreeView-tree-line-width: 1;
  -GtkTreeView-tree-line-pattern: '';
  -GtkTreeView-expander-size: 16;

  border-left-color: $border_color; // this is actually the tree lines color,
  border-top-color: transparent;                    // while this is the grid lines color, better then nothing

  rubberband { @extend rubberband; } // to avoid borders being overridden by the previously set props

  &:selected { border-radius: 0; } // rest border radius in lists

  &:selected  {
    background-color: s_color(normal);
    border-left-color: s_color(text);
    border-top-color: s_color(text); // doesn't work unfortunatelly
  }
  &:backdrop:selected {
    background-color: backdrop(s_color(backdrop));
    border-left-color: backdrop(s_color(text));
    border-top-color: backdrop(s_color(text));
  }

  &:disabled {
    color: insensitive($border_color);
    &:selected {
      color: insensitive(s_color(text));
      &:backdrop { color: backdrop(insensitive(s_color(text))); }
    }
    &:backdrop { color: backdrop(insensitive($border_color)); }
  }
  &.seperator {
    min-height: 2px;
    color: $border_color;
  }
  &.separator:backdrop {
    color: backdrop($border_color);
  }

  &:backdrop {
    border-left-color: backdrop($border_color);
  }

  &:drop(active) {
    border-style: solid none;
    border-width: 1px;
    border-color: b_color(hover);
  }

  &.expander {
    -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
    color: v_color(text);
    &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); };
    &:hover { color: b_color(hover); }
    &:selected { color: s_color(text); }
    &:checked {
       -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
      &:selected { color: s_color(text); }
      &:backdrop { color: backdrop(v_color(normal)); }
    }
    &:backdrop { color: backdrop(v_color(normal)); }
  }
  header {
    button {
      @extend %column_header_button;
      color: b_color(text);
      background-color: b_color(normal);
      text-shadow: none;
      box-shadow: none;
      &:hover {
        @extend %column_header_button;
        color: b_color(text);
        background-color: transparentize(b_color(hover), 0.5);
        box-shadow: none;
        transition: none; //I shouldn't need this
      }
      &:active {
        @extend %column_header_button;
        color: b_color(text);
        background-color: transparentize(b_color(hover), 0.5);
        transition: none; //I shouldn't need this
      }
    }
    button:last-child { &:backdrop, & { border-right-style: none; }}
    }
    button.dnd,
    header.button.dnd { // for treeview-like derive widgets
      &:active, &:selected, &:hover, & {
        padding: 0 6px;
        color: s_color(text);
        background-image: none;
        background-color: s_color(normal);
        border-style: none;
        border-radius: 0;
        box-shadow: none;
        text-shadow: none;
        transition: none;
      }
    }
}

%column_header_button {
  padding: 6px;
  border-style: none solid solid none;
  border-radius: 0;
  background-image: none;
  border-color: $border_color;
  text-shadow: none;
  &:disabled {
    border-color: insensitive($border_color);
    color: insensitive(b_color(text));
    background-color: insensitive(b_color(normal));
    background-image: none;
  }
  &:backdrop {
    border-color: backdrop($border_color);
    border-style: none solid solid none;
    color: backdrop(b_color(text));
    background-image: none;
    background-color: backdrop(b_color(normal));
    &:disabled {
      border-color: backdrop(insensitive($border_color));
      background-image: none;
      background-color: backdrop(insensitive(b_color(normal)));
      color: backdrop(insensitive(b_color(text)));
    }
  }
}
