// based css:
// https://github.com/shimmerproject/Greybird/blob/master/gtk-3.0/_xfce.scss

/**************
 * Xfce4 Apps *
 **************/
.XfceHeading {
  background-color: $base;
}


/***************
 * xfce4-panel *
 ***************/
.xfce4-panel.background {
  border: none; // Sadly the border is hard-coded
  background-color: $panel;
  color: $panel-text-secondary;
  font-weight: 500;

  button {
    @extend %button-flat;
    min-height: 16px;
    min-width: 16px;
    padding: 0 $space-size;
    border-radius: 0;
    color: $panel-text-secondary;

    &:hover, &:active, &:checked {
      color: $panel-text;
    }

    &:disabled {
      color: $panel-text-secondary-disabled;
    }

    &.flat.toggle {
      padding: 0 $space-size;
    }
  }

  .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; }
  }
}

// Workspace switcher provided by libwnck
wnck-pager {
  &:hover { background-color: $overlay-hover; }

  &:active { background-color: $overlay-active; }

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

#xfce4-mpc-plugin-26 {
  > frame > border {
    border: none;
  }
}

#xfce-panel-button {
  -gtk-icon-style: symbolic;
}

XfdesktopIconView.view {
  border-radius: $corner-radius;
  background-color: transparent;
  color: on(dark);

  // XfdesktopIconView uses :active instead of :selected for selection
  &:active {
    @extend %selected_items;

    box-shadow: none;
  }

  .rubberband {
    @extend rubberband;

    border-radius: 0;
  }
}

window#whiskermenu-window {
  border-radius: $window-radius;
  background-color: transparent;
  border: none;

  entry.search:focus { background-color: $base; }

  // Need to set Whisker menu background opacity less than 100
  > frame > border {
    border-radius: $window-radius;
    padding: $space-size $space-size + 2px $space-size $space-size * 1.5;
    margin: $space-size;
    border: none;
    background-color: $popover;

    @if $rimless == 'true' {
      box-shadow: $shadow-z4, inset 0 1px highlight($popover);
    } @else {
      box-shadow: $shadow-z4, 0 0 0 1px $window-border, inset 0 0 0 1px highlight($popover);
    }
  }

  box.categories > button.radio { // sidebar categories button
    padding: $space-size / 2 $space-size;
    margin: 1px 0;

    &:hover { background-color: $divider; }

    &:checked, &:active {
      background-color: $track;
      color: $text;

      &:hover { background-image: none; }
    }
  }

  scrolledwindow.frame { // App list (tree)
    padding: $space-size / 2;
    background-color: $base;
    border-radius: $corner-radius;

    treeview.view {
      border-radius: $corner-radius;

      &:not(:hover):not(:selected) { background: none; }

      &:selected:hover {
        background-color: $divider;
        color: $text;
      }
    }
  }

  .title-area > .commands-area > button.flat.command-button { // Bottom command buttons
    &:checked, &:active {
      background-color: $track;
      color: $text;
    }
  }
}

#XfceNotifyWindow {
  background-color: $base;
  border-radius: $window-radius;

  @if $rimless == 'true' {
    border: none;
    box-shadow: none;
  } @else {
    border: 1px solid $window-border;
    box-shadow: inset 0 0 0 1px highlight($base);
  }

  buttonbox { padding: 0; }

  label#summary { font-weight: bold; }
}

dialog.xfsm-logout-dialog {
  border-radius: $window-radius;
  background-color: if($opacity == 'solid', $popover, rgba($popover, 0.97));

  @if $rimless == 'true' {
    border: none;
    box-shadow: none;
  } @else {
    border: 1px solid $window-border;
    box-shadow: inset 0 0 0 1px highlight($base);
  }
}

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

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


/**********
 * Thunar *
 **********/
.thunar {
  toolbar { box-shadow: inset 0 -1px $border; }

  .standard-view.frame {
    border: none;

    widget.view {
      // padding: $space-size; // Not work ?

      &:selected {
        @extend %selected_items;
      }
    }
  }

  scrolledwindow.frame.sidebar {
    border-top: none;
  }

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

  .path-bar.linked:not(.vertical) > button.path-bar-button {
    margin-left: 2px;
    margin-right: 2px;
  }

  statusbar {
    margin: 0 -10px;
    padding: 0 4px;
    border-top: 1px solid $divider;
  }

  > grid.horizontal > paned.horizontal > scrolledwindow.frame.sidebar.shortcuts-pane {
    border-top: none;
  }
}

window.background.csd.thunar {
  > grid.horizontal > paned.horizontal > scrolledwindow.frame.sidebar.shortcuts-pane {
    border-bottom-left-radius: $window-radius;

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

// vala-panel-appmenu
menubar.-vala-panel-appmenu-private, // xfce4 appmenu plugin
menubar.-vala-panel-background {
  background: none;
  border: none;
  box-shadow: none;
  animation: none;

  > menuitem {
    color: $panel-text-secondary;
    font-weight: normal;

    &:hover {
      color: $panel-text;
      border-radius: 0;
    }

    &:disabled {
      color: $panel-text-secondary-disabled;
    }
  }
}
