Ignore:
Timestamp:
Dec 3, 2012, 5:29:00 PM (13 years ago)
Author:
Silvan Scherrer
Message:

SMPlayer: updated vendor to 0.8.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • smplayer/vendor/current/src/images.cpp

    r121 r137  
    139139        return p;
    140140}
     141
     142QIcon Images::multiIcon(QString name, QString fallback_icon) {
     143        QPixmap pix = Images::icon(name);
     144        if (pix.isNull()) return Images::icon(fallback_icon);
     145
     146        QIcon icon;
     147        int w = pix.width();
     148        int h = pix.height();
     149        icon.addPixmap(pix.copy(0, 0, w, h/4 ), QIcon::Normal, QIcon::Off);
     150        //icon.setPixmap(pix.copy(0, h/4, w, h/4 ), MyIcon::MouseOver, MyIcon::Off);
     151        //icon.setPixmap(pix.copy(0, h/2, w, h/4 ), MyIcon::MouseDown, MyIcon::Off);
     152        icon.addPixmap(pix.copy(0, 3*h/4, w, h/4 ), QIcon::Disabled, QIcon::Off);
     153        return icon;
     154}
     155
     156QString Images::styleSheet(){
     157        QString filename;
     158        filename = themesDirectory() + "/main.css";
     159        QFile file(filename);
     160        if (file.exists()) {
     161                file.open(QFile::ReadOnly | QFile::Text);
     162                QString css = QString::fromUtf8(file.readAll().constData());
     163                return css;
     164        }
     165        else
     166                return "";
     167}
     168
     169QString Images::themesDirectory(){
     170        QString skin = pref->iconset;
     171        QString dirname;
     172        if (!skin.isEmpty()) {
     173                dirname = Paths::configPath() + "/themes/" + skin;
     174                if (!QFile::exists(dirname)) {
     175                        dirname = Paths::themesPath() + "/" + skin ;
     176                }
     177        }
     178        return dirname;
     179}
     180
Note: See TracChangeset for help on using the changeset viewer.