"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "rtgui/filethumbnailbuttonset.cc" between
rawtherapee-5.6.tar.xz and rawtherapee-5.7.tar.xz

About: RawTherapee is a powerful cross-platform raw image processing program.

filethumbnailbuttonset.cc  (rawtherapee-5.6.tar.xz):filethumbnailbuttonset.cc  (rawtherapee-5.7.tar.xz)
skipping to change at line 17 skipping to change at line 17
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* RawTherapee is distributed in the hope that it will be useful, * RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/ */
#include "filethumbnailbuttonset.h" #include "filethumbnailbuttonset.h"
#include "rtimage.h" #include "rtimage.h"
#include "multilangmgr.h" #include "multilangmgr.h"
bool FileThumbnailButtonSet::iconsLoaded = false; bool FileThumbnailButtonSet::iconsLoaded = false;
Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::rankIcon; Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::rankIcon;
Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::gRankIcon; Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::gRankIcon;
Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::unRankIcon; Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::unRankIcon;
Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::trashIcon; Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::trashIcon;
Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::unTrashIcon; Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::unTrashIcon;
Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::processIcon; Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::processIcon;
Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::colorLabelIcon_0; std::array<Cairo::RefPtr<RTSurface>, 6> FileThumbnailButtonSet::colorLabelIcon;
Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::colorLabelIcon_1;
Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::colorLabelIcon_2; Glib::ustring FileThumbnailButtonSet::processToolTip;
Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::colorLabelIcon_3; Glib::ustring FileThumbnailButtonSet::unrankToolTip;
Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::colorLabelIcon_4; Glib::ustring FileThumbnailButtonSet::trashToolTip;
Cairo::RefPtr<RTSurface> FileThumbnailButtonSet::colorLabelIcon_5; Glib::ustring FileThumbnailButtonSet::untrashToolTip;
Glib::ustring FileThumbnailButtonSet::colorLabelToolTip;
std::array<Glib::ustring, 5> FileThumbnailButtonSet::rankToolTip;
FileThumbnailButtonSet::FileThumbnailButtonSet (FileBrowserEntry* myEntry) FileThumbnailButtonSet::FileThumbnailButtonSet (FileBrowserEntry* myEntry)
{ {
if (!iconsLoaded) { if (!iconsLoaded) {
unRankIcon = Cairo::RefPtr<RTSurface>(new RTSurface("star-hollow-narrow .png")); unRankIcon = Cairo::RefPtr<RTSurface>(new RTSurface("star-hollow-narrow .png"));
rankIcon = Cairo::RefPtr<RTSurface>(new RTSurface("star-gold-narrow.p ng")); rankIcon = Cairo::RefPtr<RTSurface>(new RTSurface("star-gold-narrow.p ng"));
gRankIcon = Cairo::RefPtr<RTSurface>(new RTSurface("star-narrow.png")) ; gRankIcon = Cairo::RefPtr<RTSurface>(new RTSurface("star-narrow.png")) ;
trashIcon = Cairo::RefPtr<RTSurface>(new RTSurface("trash-small.png")) ; trashIcon = Cairo::RefPtr<RTSurface>(new RTSurface("trash-small.png")) ;
unTrashIcon = Cairo::RefPtr<RTSurface>(new RTSurface("trash-remove-small .png")); unTrashIcon = Cairo::RefPtr<RTSurface>(new RTSurface("trash-remove-small .png"));
processIcon = Cairo::RefPtr<RTSurface>(new RTSurface("gears-small.png")) ; processIcon = Cairo::RefPtr<RTSurface>(new RTSurface("gears-small.png")) ;
colorLabelIcon[0] = Cairo::RefPtr<RTSurface>(new RTSurface("circle-empty
-gray-small.png"));
colorLabelIcon[1] = Cairo::RefPtr<RTSurface>(new RTSurface("circle-red-s
mall.png"));
colorLabelIcon[2] = Cairo::RefPtr<RTSurface>(new RTSurface("circle-yello
w-small.png"));
colorLabelIcon[3] = Cairo::RefPtr<RTSurface>(new RTSurface("circle-green
-small.png"));
colorLabelIcon[4] = Cairo::RefPtr<RTSurface>(new RTSurface("circle-blue-
small.png"));
colorLabelIcon[5] = Cairo::RefPtr<RTSurface>(new RTSurface("circle-purpl
e-small.png"));
processToolTip = M("FILEBROWSER_POPUPPROCESS");
unrankToolTip = M("FILEBROWSER_UNRANK_TOOLTIP");
trashToolTip = M("FILEBROWSER_POPUPTRASH");
untrashToolTip = M("FILEBROWSER_POPUPUNTRASH");
colorLabelToolTip = M("FILEBROWSER_COLORLABEL_TOOLTIP");
rankToolTip[0] = M("FILEBROWSER_RANK1_TOOLTIP");
rankToolTip[1] = M("FILEBROWSER_RANK2_TOOLTIP");
rankToolTip[2] = M("FILEBROWSER_RANK3_TOOLTIP");
rankToolTip[3] = M("FILEBROWSER_RANK4_TOOLTIP");
rankToolTip[4] = M("FILEBROWSER_RANK5_TOOLTIP");
colorLabelIcon_0 = Cairo::RefPtr<RTSurface>(new RTSurface("circle-empty-
gray-small.png"));
colorLabelIcon_1 = Cairo::RefPtr<RTSurface>(new RTSurface("circle-red-sm
all.png"));
colorLabelIcon_2 = Cairo::RefPtr<RTSurface>(new RTSurface("circle-yellow
-small.png"));
colorLabelIcon_3 = Cairo::RefPtr<RTSurface>(new RTSurface("circle-green-
small.png"));
colorLabelIcon_4 = Cairo::RefPtr<RTSurface>(new RTSurface("circle-blue-s
mall.png"));
colorLabelIcon_5 = Cairo::RefPtr<RTSurface>(new RTSurface("circle-purple
-small.png"));;
iconsLoaded = true; iconsLoaded = true;
} }
add (new LWButton (processIcon, 6, myEntry, LWButton::Left, LWButton::Center add(new LWButton(processIcon, 6, myEntry, LWButton::Left, LWButton::Center,
, M("FILEBROWSER_POPUPPROCESS"))); &processToolTip));
add (new LWButton (unRankIcon, 0, myEntry, LWButton::Left, LWButton::Center, add(new LWButton(unRankIcon, 0, myEntry, LWButton::Left, LWButton::Center, &
M("FILEBROWSER_UNRANK_TOOLTIP"))); unrankToolTip));
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
add (new LWButton (rankIcon, i + 1, myEntry, LWButton::Left)); add(new LWButton(rankIcon, i + 1, myEntry, LWButton::Left, LWButton::Cen ter, &rankToolTip[i]));
} }
add (new LWButton (trashIcon, 7, myEntry, LWButton::Right, LWButton::Center, add(new LWButton(trashIcon, 7, myEntry, LWButton::Right, LWButton::Center, &
M("FILEBROWSER_POPUPTRASH"))); trashToolTip));
add(new LWButton(colorLabelIcon[0], 8, myEntry, LWButton::Right, LWButton::C
add (new LWButton (colorLabelIcon_0, 8, myEntry, LWButton::Right, LWButton:: enter, &colorLabelToolTip));
Center, M("FILEBROWSER_COLORLABEL_TOOLTIP")));
buttons[2]->setToolTip (M("FILEBROWSER_RANK1_TOOLTIP"));
buttons[3]->setToolTip (M("FILEBROWSER_RANK2_TOOLTIP"));
buttons[4]->setToolTip (M("FILEBROWSER_RANK3_TOOLTIP"));
buttons[5]->setToolTip (M("FILEBROWSER_RANK4_TOOLTIP"));
buttons[6]->setToolTip (M("FILEBROWSER_RANK5_TOOLTIP"));
} }
void FileThumbnailButtonSet::setRank (int stars) void FileThumbnailButtonSet::setRank (int stars)
{ {
for (int i = 1; i <= 5; i++) { for (int i = 1; i <= 5; i++) {
buttons[i + 1]->setIcon (i <= stars ? rankIcon : gRankIcon); buttons[i + 1]->setIcon(i <= stars ? rankIcon : gRankIcon);
} }
} }
void FileThumbnailButtonSet::setColorLabel (int colorLabel) void FileThumbnailButtonSet::setColorLabel (int colorLabel)
{ {
if (colorLabel == 0) { if (colorLabel >= 0 && colorLabel <= 5) {
buttons[8]->setIcon (colorLabelIcon_0); //transparent label buttons[8]->setIcon(colorLabelIcon[colorLabel]);
}
if (colorLabel == 1) {
buttons[8]->setIcon (colorLabelIcon_1);
}
if (colorLabel == 2) {
buttons[8]->setIcon (colorLabelIcon_2);
}
if (colorLabel == 3) {
buttons[8]->setIcon (colorLabelIcon_3);
}
if (colorLabel == 4) {
buttons[8]->setIcon (colorLabelIcon_4);
}
if (colorLabel == 5) {
buttons[8]->setIcon (colorLabelIcon_5);
} }
} }
void FileThumbnailButtonSet::setInTrash (bool inTrash) void FileThumbnailButtonSet::setInTrash (bool inTrash)
{ {
buttons[7]->setIcon (inTrash ? unTrashIcon : trashIcon); buttons[7]->setIcon(inTrash ? unTrashIcon : trashIcon);
buttons[7]->setToolTip (inTrash ? M("FILEBROWSER_POPUPUNTRASH") : M("FILEBRO buttons[7]->setToolTip(inTrash ? &untrashToolTip : &trashToolTip);
WSER_POPUPTRASH"));
} }
 End of changes. 10 change blocks. 
61 lines changed or deleted 46 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)