~q-quark/equalx/0.x

« back to all changes in this revision

Viewing changes to src/BookmarksPanel/BookmarksViewItemDelegate.cpp

  • Committer: Mihai Niculescu
  • Date: 2014-09-24 15:22:50 UTC
  • Revision ID: q.quark@gmail.com-20140924152250-2n7mqxjjr4d4bfmi
Added title to the bookmarks equations in the Library
Added a new icon for the button "View Bookmarks"

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
    }
68
68
 
69
69
    if(data.isBookmark()){
70
 
        QImage eq(data.name);
 
70
        QImage eq(data.filePath);
71
71
 
72
72
        int w = eq.width();
73
73
        int h = eq.height();
99
99
        textBB.setHeight(textBB.height()+6);
100
100
        QRect titleArea(drawArea.x(), drawArea.y(), drawArea.width(), textBB.height());
101
101
 
 
102
        QBrush br;
 
103
        QColor c;
 
104
        if (option.state & QStyle::State_Selected){
 
105
            br = option.palette.highlight();
 
106
            c = br.color();
 
107
            c.setAlphaF(0.8);
 
108
            br.setColor(c);
 
109
        }
 
110
        else{
 
111
            br =  option.palette.light();
 
112
            c = br.color();
 
113
            c.setAlphaF(0.8);
 
114
            br.setColor(c);
 
115
        }
 
116
 
 
117
        painter->fillRect(titleArea, br);
102
118
 
103
119
        painter->setFont(option.font);
104
 
        painter->drawText(titleArea, Qt::AlignCenter, titleStr);
 
120
 
 
121
        QBrush p;
 
122
        if (option.state & QStyle::State_Selected){
 
123
            p = option.palette.highlightedText();
 
124
        }
 
125
        else{
 
126
            p =  option.palette.text();
 
127
        }
 
128
        painter->setPen(p.color());
 
129
        painter->setBrush(p);
 
130
 
 
131
        painter->drawText(titleArea, Qt::AlignLeft, titleStr);
 
132
 
105
133
    }
106
134
 
107
135
    if(data.isFolder()){