/**************
 * Tree Views *
 **************/
treeview.view {
  @at-root * {
    -GtkTreeView-horizontal-separator: 4;
    -GtkTreeView-grid-line-width: 1;
    -GtkTreeView-grid-line-pattern: '';
    -GtkTreeView-tree-line-width: 1;
    -GtkTreeView-tree-line-pattern: '';
    -GtkTreeView-expander-size: 16;
  }

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

  &:selected { border-left-color: $inverse_track_color; }

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

  &:hover, &:active, &:selected { border-radius: 0; }

  &.separator {
    min-height: $mini_size;
    color: $border_color;
  }

  &:drop(active) {
    border-style: solid none;
    border-width: $border_size;
    border-color: $accent_color;

    &.after { border-top-style: none; }

    &.before { border-bottom-style: none; }
  }

  &.expander {
    -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
    -gtk-icon-transform: rotate(-90deg);

    &:dir(rtl) { -gtk-icon-transform: rotate(90deg); }

    &:checked { -gtk-icon-transform: unset; }

    color: $secondary_fg_color;

    &:hover, &:active { color: $fg_color; }

    &:disabled { color: $disabled_secondary_fg_color; }

    &:selected {
      color: $inverse_secondary_fg_color;

      &:hover, &:active { color: $inverse_fg_color; }

      &:disabled { color: $inverse_disabled_secondary_fg_color; }
    }
  }

  &.progressbar { // progress bar in treeviews
    border-bottom: $bar_size solid $primary_color;
    box-shadow: none;
    background-color: transparent;

    &:selected { border-bottom-color: $inverse_fg_color; }
  }

  &.trough { // progress bar trough in treeviews
    border-bottom: $bar_size solid rgba($primary_color, $lower_opacity);
    box-shadow: none;
    background-color: transparent;

    &:selected { border-bottom-color: $inverse_track_color; }
  }

  header {
    button {
      @extend %row_activatable;

      padding: $mini_padding $tiny_padding;
      border-style: none solid solid none;
      border-width: $border_size;
      border-color: $border_color;
      border-radius: 0;
      background-clip: border-box;

      &, &:hover, &:active { box-shadow: none; }

      &, &:disabled { background-color: $base_color; }

      &:last-child { border-right-style: none; }
    }
  }

  button.dnd,
  header.button.dnd { // for treeview-like derive widgets
    padding: $mini_padding $tiny_padding;
    border-style: none solid solid;
    border-width: $border_size;
    border-color: $border_color;
    border-radius: 0;
    box-shadow: none;
    background-color: $base_color;
    background-clip: border-box;
    color: $accent_color;
  }

  acceleditor > label { background-color: $primary_color; } // see tests/testaccel to test
}
