%widgets {

    * {
        outline-radius: 2px;
    }

    .label:insensitive { color: transparentize($fg_color, 0.65); }
    .separator { color: rgba(0,0,0,0.25); }
    .cell { color: $fg_color; }
    GtkLabel, GtkImage { color: inherit; }

    // Entries
    .entry {
        @include entry('&:selected',insensitive);
    }

    // Buttons
    .button {
        @include widget_button(insensitive,'.label');
    }

    // Linked Widgets
    @include widget_linked('.entry','.button');

    // ComboBoxes
    GtkComboBox.combobox-entry {
        .entry {
            &:dir(ltr) {
                border-top-right-radius: 0;
                border-bottom-right-radius: 0;
            }
            &:dir(rtl) {
                border-top-left-radius: 0;
                border-bottom-left-radius: 0;
            }
        }
        .button {
            &:dir(ltr) {
                border-top-left-radius: 0;
                border-bottom-left-radius: 0;
                border-left-style: none;
            }
            &:dir(rtl) {
                border-top-right-radius: 0;
                border-bottom-right-radius: 0;
                border-right-style: none;
            }
        }
    }

    // Spinbuttons
    .spinbutton {
        border-radius: $roundness;

        .button {
            border-color: transparentize($button_border, 0.3);
            border-style: none none none solid;
            border-radius: 0;

            &:dir(rtl) { border-style: none solid none none; }
        }
    }

    // Progressbars
    @include widget_progressbar(GtkProgressBar,'&.progressbar','&.trough');

    // Scale
    .scale {
        -GtkScale-slider-length: 16;
        -GtkRange-slider-width: 16;
        -GtkRange-trough-border: 0;
        outline-offset: -1px;
        outline-radius: 2px;
        outline-color: transparentize($fg_color, 0.7);

        color: gtkalpha(currentColor, 0.7);

        &:insensitive { opacity: 0.4; }

        &.slider {
            border-radius: 50%;

            @if $variant == 'default' {
                background-image: -gtk-scaled(url("assets/scale-slider.png"),url("assets/scale-slider@2.png"));
            }
            @else {
                background-color: $selected_bg_color;
            }

            &:hover { background: $selected_bg_color; }
        }
        &.trough {
            margin: 5px;
            background-color: $trough_bg;
            border-radius: 2.5px;

            &.highlight { background-color: $selected_bg_color; }
        }
    }

    // Check and Radio Items
    @include check-radio('.',insensitive,inconsistent);

    // Switches
    GtkSwitch {
        font: 1;
        -GtkSwitch-slider-width: 45;
        -GtkSwitch-slider-height: 19;
        outline-color: transparent;

        &:insensitive { opacity: 0.4; }

        &.trough, &.slider {
            color: transparent;
            background-size: 45px 19px;
            background-repeat: no-repeat;
            background-position: right center;

            &:dir(rtl) { background-position: left center; }
        }
        &.trough {
            background-image: -gtk-scaled(url("assets/switch#{$asset_suffix}.png"),url("assets/switch#{$asset_suffix}@2.png"));

            &:active { background-image: -gtk-scaled(url("assets/switch-active#{$asset_suffix}.png"),url("assets/switch-active#{$asset_suffix}@2.png")); }
        }
    }

    // Scrollbars
    .scrollbar {
        @include widget_scrollbar('.button', '.slider', '.trough', 'prelight', 'insensitive');

        $_slider_margin: 3px;
        $_slider_fine_tune_margin: 4px;

        -GtkRange-slider-width: 13;
        -GtkRange-trough-border: 0;
        -GtkScrollbar-min-slider-length: 42;
        -GtkRange-stepper-spacing: 0;
        -GtkRange-trough-under-steppers: 1;

        &.overlay-indicator {
            &:not(.dragging):not(.hovering) {
                -GtkRange-slider-width: 6px;

                .slider {
                    margin: $_slider_margin - 1px 0;
                }
            }
        }
        &.fine-tune .slider { margin: $_slider_fine_tune_margin; }
    }

    // Lists
    @include lists('.list','.list-row','.label',insensitive);

    @at-root %menu {
        .menu {
            @include widget_menu('.menuitem', insensitive, '.separator', color, '.button');

            .cell { color: inherit; }
        }
        .window-frame.csd.popup {
            @extend %widget_menu_popup
        }
    }

    // Calendar
    @include widget_calendar(GtkCalendar,inconsistent);
}
