// Based on:
// https://github.com/shimmerproject/Greybird/blob/master/gtk-3.0/_xfce.scss

@use "../../../theme";
@use "../../../theme-color";
@use "../../../shadow";
@use "../common";
@use "../drawing";

/**
 * Xfce4 Apps
 */

.XfceHeading {
  // background-color: $surface-z1;
}

/**
 * xfce4-panel
 */

.xfce4-panel.background {
  border: none; // Sadly the border is hard-coded
  background-color: theme-color.$panel;
  color: theme-color.hint(theme-color.$on-panel);
  font-weight: 500;

  button {
    min-height: 16px;
    min-width: 16px;
    padding: 0;
    border-radius: 0;
    color: theme-color.hint(theme-color.$on-panel);
    @include drawing.ink-color(theme-color.$on-panel, $button-style: "flat");

    &:disabled {
      background-color: transparent;
      color: theme-color.disabled-hint(theme-color.$on-panel);
    }

    &:checked {
      $background-color: theme-color.activated-overlay(theme-color.$on-panel);
      color: theme-color.$on-panel;
      @include drawing.ink-color(theme-color.$on-panel, $button-style: "flat", $on: $background-color);

      &:disabled {
        background-color: theme-color.activated-overlay(theme-color.$on-panel);
        color: theme-color.disabled(theme-color.$on-panel);
      }
    }
  }

  .tasklist button {
    border-image: image(transparent) 0 0 2 / 0 0 2px;

    &:checked {
      border-image: image(currentcolor) 0 0 2 / 0 0 2px;
    }

    image {
      padding: 4px;
    }
  }

  &.horizontal .tasklist button {
    // margin: 0 1px;
  }

  &.vertical .tasklist button {
    // margin: 1px 0;
  }

  frame > border {
    border-style: none;
    background-color: transparent;
  }

  progressbar {
    progress {
      background-color: theme-color.primary(theme-color.$on-panel);
    }

    trough {
      background-color: theme-color.disabled-stroke(theme-color.$on-panel);
    }
  }
}

// Workspace switcher provided by libwnck
wnck-pager {
  &:hover {
    background-color: theme-color.hover-overlay(theme-color.$on-panel);
  }

  &:active {
    background-color: theme-color.pressed-overlay(theme-color.$on-panel);
  }

  &:selected {
    background-color: theme-color.$primary;
  }
}

XfdesktopIconView.view {
  border-radius: theme.$corner-radius;
  // background-color: transparent;
  color: theme-color.$on-dark;
  text-shadow: shadow.$text-shadow;

  // XfdesktopIconView uses :active instead of :selected for selection
  &:active {
    box-shadow: none;
    background-color: theme-color.$selected-overlay;
  }

  .label {
    // text-shadow: $text-shadow;
  }

  .rubberband {
    @extend %rubberband;

    border-radius: 0;
  }
}

#XfceNotifyWindow {
  border-radius: theme.$corner-radius;
  box-shadow: shadow.$z4, inset 0 1px theme-color.highlight(theme-color.$surface-z8);
  background-color: theme-color.$surface-z8;
  color: theme-color.$on-surface;

  buttonbox button:not(:disabled) {
    color: theme-color.$primary;
    @include drawing.ink-color(theme-color.$primary, $button-style: "flat");
  }

  label#summary {
    font-weight: bold;

    + label {
      color: theme-color.hint(theme-color.$on-surface);
    }
  }

  progressbar {
    progress {
    }

    trough {
    }
  }
}

// Xfwm4's alt-tab dialog, aka "tabwin"
#xfwm-tabwin {
  padding: 12px;
  border-radius: theme.$corner-radius;

  // Set the application icon- and preview-size to 64px
  -XfwmTabwinWidget-icon-size: 64px;
  -XfwmTabwinWidget-preview-size: 64px;

  button {
  }
}

/**
 * Thunar
 */

.thunar {
  #location-toolbar {
    border-bottom: 1px solid theme-color.divider(theme-color.$on-surface);

    // FIXME: This has no .image-button style class :(
    > toolitem > button {
      min-width: 24px;
      padding: (theme.$medium-size - 24px) / 2;
      border-radius: theme.$circular-radius;
    }
  }

  .shortcuts-pane.frame,
  .standard-view.frame {
    border-width: 0;
    background-color: transparent;
  }

  .sidebar .view:not(:selected) {
    // background-color: transparent;
  }

  statusbar {
    margin: 0 -10px;
    padding: 0 4px;
    border-top: 1px solid theme-color.divider(theme-color.$on-surface);
  }
}
