/*
 * Custom styling for GPS.
 */

/* You can override the default theme colors. Most gtk+ themes are
 * carefully setup so that they do not hard-code colors, but use a number
 * of predefined named colors and shades of them. For instance:
 */
/*
   @define-color base_color black;
   @define-color bg_color #fff;
   @define-color theme_bg_color green;
*/

@define-color middle-gray #888;
@define-color border-gray #666;

@define-color mdi_border_color #ddd;
@define-color local_toolbar_color #f8f8f8;
@define-color notebook_background #ededed;
@define-color toolbar_button_color #555;
@define-color toolbar_button_insensitive_color #aaa;
@define-color inactive_tab_color #666;
@define-color active_tab_color black;
@define-color scrollbar_slider_color #c3c5c6;
@define-color gutter_color grey;
@define-color gutter_background #f8f8f8;

@define-color browser_decoration_color grey;
@define-color browser_decoration_background #f8f8f8;

@define-color completion-border-color shade (@theme_base_color, 0.7);
@define-color completion-selected-color mix(@theme_base_color, @middle-gray, 0.5);
@define-color completion-background-color shade(@theme_base_color, 1.10);
@define-color completion-notes-color mix(shade(@theme_base_color, 1.40), @middle-gray, 0.2);
@define-color completion-notes-text-color mix(@theme_fg_color, @middle-gray, 0.2);

@define-color tooltip-border-color shade (@theme_base_color, 0.7);
@define-color tooltip-background-color mix(shade(@theme_base_color, 1.40), @middle-gray, 0.2);
@define-color tooltip-text-color mix(@theme_fg_color, @middle-gray, 0.2);

@define-color error-color mix(@theme_base_color, red, 0.5);

/* The colors used to highlight the notebook tabs that are raised. Only one
 * of them (at most) has the keyboard focus and is highlighted with
 * gps_active_tab. The others are highlighting with gps_inactive_tab.
 */
@define-color gps_active_tab   @theme_selected_bg_color;
@define-color gps_inactive_tab @inactive_tab_color;

* {
   /* Reduce the size of the scroll arrows in notebooks */
   -GtkWidget-scroll-arrow-hlength: 8;
   -GtkWidget-scroll-arrow-vlength: 8;
   -GtkNotebook-arrow-spacing: 0;
}

.gps-task-manager GtkProgressBar {
   -GtkProgressBar-min-horizontal-bar-height: 1;
}

.gps-local-toolbar {  /* local toolbar in the panes/views */
}

*:selected,
*:selected:focused {
    background-color: #B4D5FF;
    color: @theme_fg_color;
}

/********************
 * GPS dialog views *
 ********************/

.dialog-views {
   background-color: @theme_base_color;
}

/**************************
 * GPS dialog view groups *
 **************************/

.dialog-views-groups {
   box-shadow: none;
   border-width: 0;
}

.dialog-views-groups > GtkLabel {
   /* Set bold font for group titles */
   font-weight: bold;
   padding-top: 12px;
   padding-bottom: 5px;
}

.dialog-views-groups-rows {
   padding-left: 12px;
}

.dialog-views-groups-rows.display_error {
   background-color: @error-color;
}

.dialog-views-groups-rows GtkRadioButton > GtkLabel {
   padding-right: 12px;
}

.dialog-views-doc-labels {
   /* Reduce the font size for the inlined preferences documentation */
   font-size: x-small;
   color: @inactive_tab_color;
}

.dialog-views-button-boxes {
   -GtkButtonBox-child-min-width: 0;
   -GtkButtonBox-child-min-height: 0;
   -GtkButtonBox-child-internal-pad-y: 0;
   -GtkButtonBox-child-internal-pad-x: 0;
}

/**************************
 * GPS Assistant Pages    *
 **************************/

.assistant-page-views > GtkViewport > GtkBox > .dialog-views-groups > GtkLabel {
   /* Set extra large font for assistant pages titles */
   font-weight: normal;
   font-size: x-large;
   padding-bottom: 5px;
}

.assistant-page-views .dialog-views-groups  {
   padding-top: 5px;
}

/**************************
 * GPS Welcome Dialog     *
 **************************/

.gps-welcome-dialog GtkFrame {
   box-shadow: none;
   border-width: 0;
   padding-top: 20px;
   padding-bottom: 60px;
}

.gps-welcome-dialog GtkListBoxRow {
   padding-left: 12px;
}

.gps-welcome-dialog-title {
   font-size: xx-large;
}

.gps-welcome-dialog-subtitle {
   font-size: x-large;
   color: @inactive_tab_color;
}

.gps-welcome-dialog-version {
   font-weight: 100;
   font-style: italic;
   font-size: large;
   color: @tooltip-background-color;;
}

/*********************
 * Menus
 *********************/

.window-frame {
   /* gtk+ displays a 4px semi-transparent around menus the first time they
    * are displayed. Perhaps this is a resize handle ? */
   box-shadow: none;
}

GtkMenu {
  border: 2px solid mix(@theme_base_color, @mdi_border_color, 0.5);
}

/*********************
 * Panes
 *********************/

.pane-separator {
   background-color: @notebook_background;
   background-image: none;
}

/*********************
 * Notebooks
 *********************/

GtkNotebook.noTabs {
  /* notebooks with no tabs need borders all around */
  border: 1px solid @mdi_border_color;
}

/* Shenanigans to support tabs-not-on-top */

.notebook.leftTabs, .notebook.rightTabs {
   /* When the MDI tabs are displayed on the left or on the right, we do not
    * want an extra space at the top, before the first tab */
   -GtkNotebook-initial-gap: 0;
}

/*********************
 * MDI Notebooks
 *********************/

.notebook.mdi {
  -GtkNotebook-initial-gap: 5;

  background-color: @notebook_background;
  background-image: none;
  border: 1px solid @mdi_border_color;
  border-top-width: 0px;

   /* No space between tabs */
   -GtkNotebook-tab-overlap: 0;
}

/***********************
 * MDI Notebook headers
 ***********************/

.notebook.mdi.header {
  border: none;
  box-shadow: none;
}

.notebook.mdi.header.top {
  border-bottom: 1px solid @mdi_border_color;
}

.notebook.mdi.header.left {
  border-right: 1px solid @mdi_border_color;
}

.notebook.mdi.header.right {
  border-left: 1px solid @mdi_border_color;
}

.notebook.mdi.header.bottom {
  border-top: 1px solid @mdi_border_color;
}

/*********************
 * MDI Notebook tabs
 *********************/

.notebook.mdi.leftTabs {
  border-top-width: 1px;
  border-left-width: 0px;
}

.notebook.mdi.rightTabs {
  border-top-width: 1px;
  border-right-width: 0px;
}

.notebook.mdi.bottomTabs {
  border-top-width: 1px;
  border-bottom-width: 0px;
}

.notebook.mdi tab {
   border-width: 0;
}

.notebook.mdi tab GtkLabel {
   font-weight: normal;
   color: @inactive_tab_color;
}

.notebook.mdi tab.top,
.notebook.mdi tab.bottom {
   padding: 5px 2px 5px 6px;
}

.notebook.mdi tab.left {
   padding: 2px 5px 6px 5px;
   border-top-width: 0px;
   border-right-width: 1px;
}
.notebook.mdi tab.right {
   padding: 6px 5px 2px 5px;
   border-top-width: 0px;
   border-right-width: 1px;
}

.notebook.mdi tab.bottom {
   border-top-width: 1px;
}

.notebook.mdi tab:hover {
   background-color: @local_toolbar_color;
}

.notebook.mdi tab:active GtkLabel {
   font-weight: normal;
   color: blue;
}

.notebook.mdi .active-page GtkLabel {
   color: @active_tab_color;
   background-image: none;
}

.notebook.mdi tab:active {
   background-color: @local_toolbar_color;
}

.notebook.mdi .mdi-highlighted-tab {
   color: @gps_active_tab;
}

.notebook.mdi tab:active.top {
   border: 1px solid @mdi_border_color;
   border-top-color: @gps_inactive_tab;
   border-top-width: 3px;
   border-bottom-width: 0;
}

.notebook.mdi tab:active.left {
   border: 1px solid @mdi_border_color;
   border-left-color: @gps_inactive_tab;
   border-left-width: 3px;
   border-right-width: 0;
}

.notebook.mdi tab:active.right {
   border: 1px solid @mdi_border_color;
   border-right-color: @gps_inactive_tab;
   border-right-width: 3px;
   border-left-width: 0;
}

.notebook.mdi tab:active.bottom {
   border: 1px solid @mdi_border_color;
   border-bottom-color: @gps_inactive_tab;
   border-bottom-width: 3px;
   border-top-width: 0;
}

.notebook.mdifocused tab:active.top {
   border-top-color: @gps_active_tab;
}

.notebook.mdifocused tab:active.left {
   border-left-color: @gps_active_tab;
}

/**********************
 * Scrollbars
 **********************/

.scrollbar {
/*   background-color: @local_toolbar_color; */

/* Uncomment this to activate scrollbar steppers
  -GtkScrollbar-has-backward-stepper: true;
  -GtkScrollbar-has-forward-stepper: true;
*/

}
.scrollbar.slider {
   background-color: @scrollbar_slider_color;
}

/**********************
 * Toolbars
 **********************/

.toolbar GtkButton {
  padding: 4px;
}

/* Let's condense things in the local toolbars of the views */
.gps-local-toolbar {
   background: @local_toolbar_color;
   border-bottom-width: 1px;
   border-bottom-color: @mdi_border_color;
   margin-bottom: 10px;
   padding: 0px;
}

.gps-editor-status-bar {
   background: @local_toolbar_color;
}
.gps-editor-status-bar GtkToolbar {
   background: @local_toolbar_color;
}
.gps-editor-status-bar GtkButton {
   padding: 0px 2px;
}
.gps-editor-status-bar > * {
   margin: 0px;
   padding: 0px;
}

.gps-switches-editor GtkScrolledWindow {
   background: @theme_base_color;
}

.gps-local-toolbar * {
   margin: 0px;
   padding: 2px;
}

.toolbar GtkImage,
.toolbar {
  color: @toolbar_button_color;
}

.toolbar GtkImage:insensitive {
  color: @toolbar_button_insensitive_color;
}

/***************************
 * Search fields
 ***************************/

/* Search and filter fields */
GtkEntry.search {
  border-radius: 3px;
  border-color: transparent;
  border-width: 1px;
  box-shadow: none;
  padding-left: 2px;
}

.completion-list {
   /* The list of possible completions, in a completion entry */
}

#completion-frame {
    border-style:solid;
    border-width:1px;
    border-color: @completion-border-color;
    background-color: @completion-background-color;
    margin: 5px;
    padding: 5px;
}

.window-rounded {
    border-radius: 4px;
}

#completion-scroll {
    margin: 5px;
    padding: 5px;
}

#completion-view {
    background-color: @completion-background-color;
}

#completion-view:selected {
    background-color: @completion-selected-color;
    border-radius: 5px;
    color:@theme_fg_color;
}

#notes-frame * {
    background-color: @completion-notes-color;
    padding: 3px;
}

#notes-frame GtkViewport {
    border-width: 0;
}

.notes-doc-frames {
    box-shadow: none;
    border-width: 0;
}

/**********************************
 * Editors
 **********************************/

.gps_gutter {
  background-color: @gutter_background;
  color: @gutter_color;
}

/**********************************
 * Browsers
 **********************************/

.gps_browser_decoration {
  background-color: @browser_decoration_background;
  color: @browser_decoration_color;
}

/**********************************
 * Tooltips
 **********************************/

.tooltip {
   color: @tooltip-text-color;
   text-shadow: none;
   margin: 0;
   border-radius: 0;
   border: 1px solid @tooltip-border-color;
}
.tooltip.background {
   background-color: @tooltip-background-color;
}

.tooltip * {
   padding: 12px;
}

/*
 * Editors
 * Control the color of links displayed in the status bar of editors
 */
/*
-GtkWidget-link-color: @link_color;
-GtkWidget-visited-link-color: @link_color;
*/

/**
 * An example on how to redefine left and right keys so that they navigate
 * up and down in the tree views (instead of just left and right between
 * columns). The best here is to use the default up and down keys though.
 * See also the treemove.py plug-in.
 */

/*
@binding-set gtk-gps-tree-view {
   bind "Right" { "move-cursor" (display-lines, 1) };
   bind "Left" { "move-cursor" (display-lines, -1) };
}
GtkTreeView { gtk-key-bindings: gtk-gps-tree-view; }
*/
