// based css:
// https://github.com/mate-desktop/mate-themes/blob/master/desktop-themes/Menta/gtk-3.0/mate-applications.css

/**************
 * Mate-Panel *
 **************/
// first make all transparent
.mate-panel-menu-bar menubar,
#PanelApplet-window-menu-applet-button {
  background-color: transparent;
}

// let's start it
#PanelPlug,
PanelToplevel.background {
  background-color: $unity_panel_bg_color;
  color: $titlebar_fg_color;
  font-weight: 500;
}

%mate_panel_button {
  color: $titlebar_secondary_fg_color;

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

  &:disabled { color: $titlebar_disabled_secondary_fg_color; }

  &:checked {
    background-color: $titlebar_track_color;
    color: $titlebar_fg_color;
  }

  &:checked:disabled {
    background-color: $titlebar_divider_color;
    color: $titlebar_disabled_fg_color;
  }
}

// hide buttons
PanelToplevel > grid > button {
  padding: 0 4px;
  border-radius: 0;

  @extend %simple_flat_button;

  @extend %mate_panel_button;
}

// for small arrows
PanelWidget button {
  &, &:hover, &:active { color: $titlebar_secondary_fg_color; }
}

#PanelApplet {
  // border-width: 0;
}

PanelSeparator {
  color: $titlebar_divider_color;
}

// the grid left from na-tray and wncktasklist
MatePanelAppletFrameDBus {
  border-style: solid;
  border-width: 0 1px;
  border-color: $titlebar_divider_color;
}

// main menu
.mate-panel-menu-bar menubar {
  // set normal menubar button
  menuitem { padding: 4px; }

  // set normal menubar menuitem
  menu menuitem {
    padding: 6px;
    // font-weight: initial;
  }
}

// all applets
.mate-panel-menu-bar #PanelApplet button {
  -GtkWidget-window-dragging: true;
  padding: 4px;
  border-radius: 0;

  @extend %flat_button;

  @extend %mate_panel_button;
}

// WnckPager
PanelApplet.wnck-applet .wnck-pager {
  background-color: transparent;
  color: $alt_primary_color;

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

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

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

#clock-applet-button {
  // font-weight: initial;
}

#MatePanelPocilloupWindow {
  border: 1px solid $border_color;
  border-radius: $material_radius + 1px;
  box-shadow: inset 0 1px $highlight_color;

  frame > border { border-style: none; }

  // FIXME, does not work
  ClockMap { border: 1px solid $border_color; }
}

na-tray-applet {
  -NaTrayApplet-icon-padding: 3px;
  -NaTrayApplet-icon-size: 16;
}

// remove right space a bit
na-tray-applet > widget > box {
  // margin-right: 2px;
}

// no background for icon-padding area
na-tray-applet widget box widget {
  // background-color: transparent;
}

// Classic icon style
.mate-panel-menu-bar {
  -PanelMenuBar-icon-visible: true;
}

// volume applet, brightness applet
.mate-panel-applet-slider {
  background-color: transparent;

  frame {
    border: 1px solid $border_color;
    border-radius: $material_radius + 1px;
    box-shadow: inset 0 1px $highlight_color;
    background-color: $bg_color;

    frame { all: unset; }

    > border { border-style: none; }
  }
}


/*********************
 * CAJA File manager *
 *********************/
// pathpar toggle button
.caja-navigation-window button.toggle.image-button {
  border-radius: $material_radius;
}

// pathbar
// pathbar buttons
.caja-pathbar button {
  margin: 0 -1px 0 -2px;
  // padding: 4px;

  @extend %pathbar_button;

  // arrow button
  > widget {
    -gtk-icon-source: -gtk-icontheme("pan-down-symbolic");
    -GtkArrow-arrow-scaling: 1;
  }
}

// places, treeview, history, information, emblems and notes
// .caja-side-pane notebook treeview.view,
// .caja-side-pane notebook textview.view text,
.caja-side-pane notebook viewport.frame,
.caja-side-pane notebook widget .vertical {
  background-color: $base_color;
}

// treeview rows
.caja-side-pane treeview.view {
  // padding: 2px 0;
}

.caja-side-pane notebook,
.caja-notebook {
  border-top: 1px solid $border_color;

  .frame { border-style: none; }
}

// window and desktop mode
.caja-canvas-item {
  // border-radius: $material_radius;
}

// desktop mode
.caja-desktop.caja-canvas-item {
  @extend %nautilus_desktop_nautilus_canvas_item;
}

.caja-desktop EelEditableLabel.entry {
}

// statusbar
.caja-navigation-window statusbar {
  margin: 0 -10px;
  padding: 0 4px;
  border-top: 1px solid $border_color;
}

// infobar
.caja-notebook frame > border {
  border-style: none;
}

#caja-extra-view-widget {
  border-bottom: 1px solid $border_color;
  background-color: $bg_color; // needs overriding

  > box > box > label { font-weight: bold; }
}


/*********
 * Pluma *
 *********/
// Pluma status bar
.pluma-window statusbar {
  margin: 0 -10px;
  padding: 0 4px;
  border-top: 1px solid $border_color;

  frame {
    > border { border-style: none; }

    button.flat {
      padding: 0 4px;
      border-radius: 0;

      widget {
        -gtk-icon-source: -gtk-icontheme("pan-down-symbolic");
        -GtkArrow-arrow-scaling: 1;
      }
    }
  }
}

// Printpreview
.pluma-print-preview {
  toolbar { border-bottom: 1px solid $border_color; }

  // scrolledwindow { background-color: $base_color; }
}

// sidebar file-browser
.pluma-window paned.horizontal box.vertical {
  box.horizontal button.flat {
    margin: 1px;

    @extend %small_button;
  }

  .frame { border-style: none; }

  notebook.frame {
    margin-top: -1px;
    border-top: 1px solid $border_color;

    box.vertical toolbar.horizontal { border-bottom: 1px solid $border_color; }
  }
}


/*********
 * Atril *
 *********/
.atril-window paned.horizontal box.vertical {
  .frame { border-style: none; }

  notebook .frame { border-top: 1px solid $border_color; }
}


/* mate-screensaver lock dialog */
.lock-dialog {
  //border-radius: $material_radius;
  // not sure if box-shadow works here
  box-shadow: $shadow_4, inset 0 1px $dark_fg_color;

  frame > border { border-style: none; }
  
  background-color: $dark_fg_color;
  color: $inverse_fg_color;

  & entry, entry:focus textview text {
        background-color: transparent;
        color: $inverse_fg_color;
        border-style: none;
        border-bottom: 1px solid $dark_fg_color;
        box-shadow: none;
        //border-radius: 1px;
  }

  & notebook {
        color: $inverse_fg_color;
  }

  & button, button:hover, button:active {
        @extend %flat_button;
        color: $inverse_fg_color;
  }
}
