@mixin entry($t, $fc:v_color(active)) {
//
// Entries drawing function
//
// $t: entry type
// $fc: focus color
// $edge: set to none to not draw the bottom edge or specify a color to not
//        use the default one
//
// possible $t values:
// normal, focus, insensitive, backdrop, backdrop-insensitive, osd, osd-focus, osd-backdrop;
//
  @if $t==normal {
    color: v_color(text);
    border-color: $border_color;
    background-color: v_color(normal);
    box-shadow: none;
  }

  @if $t==focus {
    border-color: $fc;
  }

  @if $t==insensitive {
    color: insensitive(v_color(text));
    border-color: insensitive($border_color);
    background-color: insensitive(v_color(normal));
  }

  @if $t==backdrop {
    color: backdrop(v_color(text));
    border-color: backdrop($border_color);
    background-color: backdrop(v_color(normal));
  }

  @if $t==backdrop-insensitive {
    color: backdrop(insensitive(v_color(text)));
    border-color: backdrop(insensitive($border_color));
    background-color: backdrop(insensitive(v_color(normal)));
  }
}

/****************
 * Text Entries *
 ****************/

%entry,
entry {
    %entry_basic, & {
      min-height: 30px;
      padding-left: 8px;
      padding-right: 8px;
      border: 1px solid;
      border-radius: $r;
      transition: all 200ms $ease-out-quad;

      @include entry(normal);

      image { // icons inside the entry
        &.left { padding-left: 0; padding-right: 6px; }
        &.right { padding-left: 6px; padding-right: 0; }
      }
      // FIXME
      // undershoot {
      // &.left { @include undershoot(left); }
      // &.right { @include undershoot(right); }
      // }

      &.flat {
        &:focus, & {
          min-height: 0;
          padding: 2px;
          @include entry(normal);
        }
      }
      &:focus { @include entry(focus); }
      &:disabled { @include entry(insensitive); }
      &:backdrop { @include entry(backdrop); }
      &:backdrop:disabled { @include entry(backdrop-insensitive); }

      selection { &:focus, & { @extend %selected_items; }}

      @each $e_type, $e_color in (error, $error_color),
                                 (warning, $warning_color) {
        &.#{$e_type} {
          color: $e_color;
          border-color: $e_color;
          background-color: transparentize($e_color, 0.5);
          &:focus {
            @include entry(focus, $e_color);
            background-color: transparentize($e_color, 0.5);
          }
          &:selected, &:selected:focus { background-color: $e_color; }
          &:backdrop {
            color: backdrop($e_color);
            border-color: backdrop($e_color);
            background-color: backdrop(transparentize($e_color, 0.5));
          }
        }
      }

      image { // entry icons colors
        color: mix(w_color(text),v_color(text), 80%);
        &:hover { color: b_color(hover); }
        &:active { color: b_color(active); }
        &:backdrop { color: backdrop(mix(w_color(text), v_color(text), 80%)); }
      }
    //   FIXME
    //   &:drop(active) {
    //   &:focus, & {
    //     border-color: $drop_target_color;
    //     box-shadow: inset 0 0 0 1px $drop_target_color;
    //   }
    // }
    }

  progress {
    margin: 1px;
    border-radius: 0;
    border-width: 0 0 2px;
    border-color: s_color(normal);
    border-style: solid;
    background-image: none;
    background-color: transparent;
    box-shadow: none;
    &:backdrop {
      background-color: transparent;
      border-color: backdrop(s_color(backdrop));
    }
  }
}

treeview acceleditor > label {
    background-color: s_color(normal);
}

treeview entry {
  &.flat, & {
    border-radius: 0;
    background-image: none;
    background-color: v_color(normal);

    &:focus { border-color: v_color(active); }
  }
}
