// This file adds RC+ icons to various common areas created by the RC+ plugins, like the sidebar, apps, menu, etc.
// Applied to all skins, including elastic and larry.

@import "_icons";

// list of plugins and their icons
// (we can't have the individual plugins add these, because a number of plugins only adds stylesheets to specific pages, like
// settings, or mail, and the apps menu appears on all pages)
$plugins: (
    xbackground: $picture,
    xcalendar: $calendar,
    xquote: $speechBubble,
    xdropbox: $dropbox,
    xgoogle_drive: $google,
    xlast_login: $userCircle,
    xnews_feed: $newspaper,
    xsidebar: $sidebar,
    xsignature: $signature,
    xskin: $skin,
    xvertical_preview: $columns,
    xweather: $sun,
    xtag: $code,
    xemail_schedule: $emailSchedule,
    x2fa: $lock,
    xai: $robot,
    xwebdav: $cloud,
);

// information boxes and popups
.xinfo:before,
.xsave-hint:before{
    @include icon($information);
}

// general use
.xinformation:before { @include icon($information); }
.xexclamation:before { @include icon($exclamation); }
.xhelp:before { @include icon($help); }
.xcheck:before { @include icon($checkSquare); }

// RC+ sidebar
#show-mobile-xsidebar:before { @include icon($sidebar); }
#xsidebar-menu a.hide:before { @include icon($chevronRight); }
#show-xsidebar:before { @include icon($chevronLeft); }
#xsidebar-order-table td.title label:before { @include icon($bars); }
#xsidebar-order-note:before { @include icon($information); }
#xsidebar .sidebar-settings-url:before { @include icon($gear); }
#xsidebar .sidebar-toggle:before { @include icon($chevronUp); }
#xsidebar .collapsed .sidebar-toggle:before { @include icon($chevronDown); }

// RC+ apps menu
#button-apps:before { @include icon($gridSmall); }

@each $plugin, $icon in $plugins {
    #apps-menu a.app-item-#{$plugin} div.icon:before { @include icon($icon); }
}

// RC+ plugins in settings list
#settings-menu,
#settings-tabs {
    a.x2fa:before { @include icon($lock); }
    a.xcpanel-settings:before { @include icon($envelopeClosed); }
}

// RC+ plugins in apps menu and settings / preferences list
@each $plugin, $icon in $plugins {
    #sections-table tr.#{$plugin} > td.section:before { @include icon($icon); }
}

// icons in lists

.listing.iconized.selectable li a:before { content: ""; }
.listing.iconized.selectable li a.selected:before { @include icon($check); }

.listing.iconized li {
    &.preferences > a:before { @include icon($wrench); }
    &.folders > a:before { @include icon($folder); }
    &.responses > a:before { @include icon($bookmark); }
    &.identities > a:before { @include icon($vcard); }
    &.password > a:before { @include icon($key); }
    &.addressbook a:before { @include icon($addressBook); }
    &.contactgroup a:before { @include icon($users); }
    &.contactsearch a:before { @include icon($search); }
    &.filter > a:before { @include icon($filter); }
    &.vacation > a:before { @include icon($clock); }
    &.forward > a:before { @include icon($forward); }
    &.enigma.keys > a:before { @include icon($key); }
    &.userinfo > a:before { @include icon($userCircle); }
    &.twofactorauth > a:before { @include icon($login); }
    &.cd_preferences > a:before { @include icon($users); }
    a.help:before { @include icon($help); }
    a.about:before { @include icon($information); }
    a.license:before { @include icon($shield); }
    & > i:before { @include icon($user); }
    &.group > i:before { @include icon($users); }
}

.listing.iconized tr {
    &.contact.person td.name:before { @include icon($user); }
    &.contact.group td.name:before { @include icon($users); }
    &.general > td.section:before { @include icon($monitor); }
    &.mailbox > td.section:before { @include icon($envelopeClosed); }
    &.mailview > td.section:before { @include icon($inbox); }
    &.compose > td.section:before { @include icon($edit); }
    &.addressbook > td.section:before { @include icon($addressBook); }
    &.folders > td.section:before { @include icon($folder); }
    &.server > td.section:before { @include icon($disk); }
    &.enigma > td.section:before { @include icon($lock); }
    &.encryption > td.section:before { @include icon($lock); }
    &.calendar > td.section:before { @include icon($calendar); }
}

// ****************** third-party plugins ******************

// managesieve
.menu a {
    &.filterlink:before { @include icon($filter); }
    &.status:before { @include icon($lightbulb); }
}

.action-plugin-managesieve-action {
    .propform td.rowbuttons a.advanced:before { @include icon($gear); }
    .propform td.rowbuttons a:before { @include icon($plus); }
    .propform td.rowbuttons a.delete:before { @include icon($trash); }
}

// tasks
.menu a.taskaddlink:before { @include icon($save); }

// thunderbird labels
#sections-table tbody tr#rcmrowthunderbird_labels td.section:before { @include icon($labelDots); }

// carddav
#sections-table tbody tr#rcmrowcd_preferences td.section:before { @include icon($userCircle); }

// twofactor_gauthenticator
#settingstabplugintwofactor_gauthenticator a:before { @include icon($user); }
#twofactor_gauthenticator-form .show-codes:before { @include icon($eye); }

