#======================================#
# OneStepBack theme: gtk2 part         #
# jpsb: July 2015 - janv 2024           #
#======================================#

#======================================#
# Color definitions
#======================================#

gtk-color-scheme = "white_color:#ffffff
lighter_color:#eeeeee
base_color:#aaaaaa
darker_color:#888888
black_color:#000000
scale_color: #4b6983
"

#======================================#
# Derived colors
#======================================#

gtk-color-scheme = "button_selected_bg_color:#707070
text_selected_bg_color:#888888
text_selected_fg_color:#ffffff
menuitem_selected_bg_color:#eeeeee
menuitem_selected_fg_color:#000000
listitem_selected_bg_color:#888888
listitem_selected_fg_color:#ffffff
"

#======================================#
# Derived colors
#======================================#

gtk-color-scheme = "button_selected_bg_color:#707070
text_selected_bg_color:#888888
text_selected_fg_color:#ffffff
menuitem_selected_bg_color:#ffffff
menuitem_selected_fg_color:#000000
listitem_selected_bg_color:#888888
listitem_selected_fg_color:#ffffff
"

#======================================#
# Styles
#======================================#

style "default" {

    base[NORMAL]        = @lighter_color
    text[NORMAL]        = @black_color
    bg[NORMAL]          = @base_color
    fg[NORMAL]          = @black_color

    base[PRELIGHT]      = @lighter_color
    text[PRELIGHT]      = @black_color
    bg[PRELIGHT]        = @base_color
    fg[PRELIGHT]        = @black_color

    base[SELECTED]      = @listitem_selected_bg_color
    text[SELECTED]      = @listitem_selected_fg_color
    bg[SELECTED]        = @darker_color
    fg[SELECTED]        = @lighter_color

    base[ACTIVE]        = @listitem_selected_bg_color
    text[ACTIVE]        = @listitem_selected_fg_color
    bg[ACTIVE]          = @button_selected_bg_color
    fg[ACTIVE]          = @black_color

    base[INSENSITIVE]   = @darker_color
    text[INSENSITIVE]   = @black_color
    bg[INSENSITIVE]     = @base_color
    fg[INSENSITIVE]     = @darker_color

    GtkWidget::focus-line-width = 0
    GtkWidget::link-color = @black_color
    GtkWidget::visited-link-color = @darker_color
    GtkScrollbar::min-slider-length = 30

    GtkScrollbar::has_backward_stepper = 0
    GtkScrollbar::has_forward_stepper = 1
    GtkScrollbar::has_secondary_forward_stepper = 0
    GtkScrollbar::has_secondary_backward_stepper = 1

}

style "scalebar-scrollbar" {

    bg[NORMAL]          = @base_color
    fg[NORMAL]          = @black_color

    bg[PRELIGHT]        = @lighter_color

    bg[ACTIVE]          = @darker_color

    engine "pixmap" {

        image {
            function        = SLIDER
            state           = NORMAL
            file            = "../img/scrollbar_horizontal.png"
            border          = { 2, 2, 2, 2 }
            stretch         = TRUE
            overlay_file    = "../img/scrollbar_thumb.png"
            overlay_stretch = FALSE
            orientation     = HORIZONTAL
        }
        image {
            function        = SLIDER
            state           = INSENSITIVE
            file            = "../img/scrollbar_horizontal.png"
            border          = { 2, 2, 2, 2 }
            stretch         = TRUE
            overlay_file    = "../img/scrollbar_thumb.png"
            overlay_stretch = FALSE
            orientation     = HORIZONTAL
        }
        image {
            function        = SLIDER
            state           = PRELIGHT
            file            = "../img/scrollbar_horizontal.png"
            border          = { 2, 2, 2, 2 }
            stretch         = TRUE
            overlay_file    = "../img/scrollbar_thumb.png"
            overlay_stretch = FALSE
            orientation     = HORIZONTAL
        }
        image {
            function        = SLIDER
            state           = ACTIVE
            file            = "../img/scrollbar_horizontal.png"
            border          = { 2, 2, 2, 2 }
            stretch         = TRUE
            overlay_file    = "../img/scrollbar_thumb.png"
            overlay_stretch = FALSE
            orientation     = HORIZONTAL
        }
        image {
            function        = SLIDER
            state           = NORMAL
            file            = "../img/scrollbar_vertical.png"
            border          = { 2, 2, 2, 2 }
            stretch         = TRUE
            overlay_file    = "../img/scrollbar_thumb.png"
            overlay_stretch = FALSE
            orientation     = VERTICAL
        }
        image {
            function        = SLIDER
            state           = INSENSITIVE
            file            = "../img/scrollbar_vertical.png"
            border          = { 2, 2, 2, 2 }
            stretch         = TRUE
            overlay_file    = "../img/scrollbar_thumb.png"
            overlay_stretch = FALSE
            orientation     = VERTICAL
        }
        image {
            function        = SLIDER
            state           = PRELIGHT
            file            = "../img/scrollbar_vertical.png"
            border          = { 2, 2, 2, 2 }
            stretch         = TRUE
            overlay_file    = "../img/scrollbar_thumb.png"
            overlay_stretch = FALSE
            orientation     = VERTICAL
        }
        image {
            function        = SLIDER
            state           = ACTIVE
            file            = "../img/scrollbar_vertical.png"
            border          = { 2, 2, 2, 2 }
            stretch         = TRUE
            overlay_file    = "../img/scrollbar_thumb.png"
            overlay_stretch = FALSE
            orientation     = VERTICAL
        }
    }
}

style "progressbar" {

    bg[NORMAL]          = @darker_color
    fg[NORMAL]          = @black_color # XXX

    bg[PRELIGHT]        = @scale_color # XXX
    fg[PRELIGHT]        = @lighter_color

}

style "menuitem" {

    text[NORMAL]        = @black_color
    bg[NORMAL]          = @darker_color
    fg[NORMAL]          = @black_color

    text[PRELIGHT]      = @menuitem_selected_fg_color
    bg[PRELIGHT]        = @menuitem_selected_bg_color
    fg[PRELIGHT]        = @menuitem_selected_fg_color

    fg[SELECTED]        = @menuitem_selected_fg_color # fg menu sélectionné libre office
}

style "check-radio" {

    bg[PRELIGHT]        = @base_color

    base[INSENSITIVE]   = @lighter_color
    text[INSENSITIVE]   = @darker_color
    fg[INSENSITIVE]     = @base_color
}

style "menubar" {

    fg[PRELIGHT]        = @menuitem_selected_fg_color  # menu sélectionné geogebra

    fg[SELECTED]        = @menuitem_selected_fg_color # menu sélectionné thunderbird
}

style "paned" {

    bg[PRELIGHT]        = @base_color   # séparateurs mobiles hover

}

style "gimp-loadingbar" {

    bg[PRELIGHT]        = @scale_color   # loadingbar de gimp !

}

style "notebook" {

    bg[ACTIVE]          = @darker_color   # pour variantes de couleur

}

style "entry" {

    base[PRELIGHT]      = @text_selected_bg_color
    text[PRELIGHT]      = @text_selected_fg_color

    base[SELECTED]      = @text_selected_bg_color
    text[SELECTED]      = @text_selected_fg_color

    base[ACTIVE]        = @text_selected_bg_color
    text[ACTIVE]        = @text_selected_fg_color
}

style "combobox" {

    text[PRELIGHT]      = @black_color

}

#======================================#
# Styles for testing
#======================================#

style "red" {

    base[NORMAL]        = "red"
    text[NORMAL]        = "red"
    fg[NORMAL]          = "red"
    bg[NORMAL]          = "red"

    base[PRELIGHT]      = "red"
    text[PRELIGHT]      = "red"
    bg[PRELIGHT]        = "red"
    fg[PRELIGHT]        = "red"

    base[SELECTED]      = "red"
    text[SELECTED]      = "red"
    bg[SELECTED]        = "red"
    fg[SELECTED]        = "red"

    base[ACTIVE]        = "red"
    text[ACTIVE]        = "red"
    bg[ACTIVE]          = "red"
    fg[ACTIVE]          = "red"

    base[INSENSITIVE]   = "red"
    text[INSENSITIVE]   = "red"
    bg[INSENSITIVE]     = "red"
    fg[INSENSITIVE]     = "red"

}

style "test" {

    base[NORMAL]        = "aqua"
    text[NORMAL]        = "green"
    bg[NORMAL]          = "magenta"
    fg[NORMAL]          = "blue"

    base[PRELIGHT]      = "green"
    text[PRELIGHT]      = "red"
    bg[PRELIGHT]        = "lime"
    fg[PRELIGHT]        = "maroon"

    base[SELECTED]      = "navy"
    text[SELECTED]      = "red"
    bg[SELECTED]        = "olive"
    fg[SELECTED]        = "purple"

    base[ACTIVE]        = "red"
    text[ACTIVE]        = "green"
    bg[ACTIVE]          = "teal"
    fg[ACTIVE]          = "yellow"

    base[INSENSITIVE]   = "purple"
    text[INSENSITIVE]   = "green"
    bg[INSENSITIVE]     = "yellow"
    fg[INSENSITIVE]     = "white"

}

#======================================#
# Widgets
#======================================#

class "*" style "default"
widget_class "*Scale*" style "scalebar-scrollbar"
widget_class "*Scrollbar*" style "scalebar-scrollbar"
widget_class "*ProgressBar*" style "progressbar"
widget_class "*MenuItem*" style "menuitem"
widget_class "*MenuBar*" style "menubar"
widget_class "*Paned*" style "paned"
class "GtkCheck*" style "check-radio"
class "GtkRadio*" style "check-radio"
widget_class "*Gimp*Paned*Bar*" style "gimp-loadingbar"
widget_class "*Notebook*" style "notebook"
widget_class "*Entry*" style "entry"
widget_class "*ComboBox*" style "combobox"

#widget_class "*Link*" style "red"
#widget_class "*Button*" style "red"
#widget_class "*Separator*" style "red"
#widget_class "*ToolButton*" style "red"
#widget_class "*Option*" style "red"
#widget_class "*ScaleButton*" style "red"
#widget_class "*List*" style "red"
#widget_class "*Notebook*" style "test"
#widget_class "*Frame*" style "red"
#widget_class "*Label*" style "red"
#widget_class "*Window" style "red"

# jpsb le 12 sept 2015: bug curieux: la barre d'avancement de xsane ne respecte la couleur demandée qu'après un redémarrage du thème, sinon la couleur est lime !

# qt4 et flèches d'ascenseurs incompatible avec engine "pixmap"
# barre de prog qt4

#======================================#
# tweaks
#======================================#
# avoid wrong background color in rox when switching theme
style "rox"
{
    base[NORMAL]        = @lighter_color
    bg[NORMAL]          = @lighter_color

    base[SELECTED]      = @darker_color
    text[SELECTED]      = @white_color
    bg[SELECTED]        = @darker_color
    fg[SELECTED]        = @white_color
}

widget_class "*ViewCollection*" style "rox"
