diff --git a/icons/star_blue_other.svg b/icons/star_blue_other.svg
new file mode 100644
index 000000000..09f44d7c0
--- /dev/null
+++ b/icons/star_blue_other.svg
@@ -0,0 +1,140 @@
+
+
diff --git a/icons/star_other.svg b/icons/star_other.svg
new file mode 100644
index 000000000..1dc67cb7c
--- /dev/null
+++ b/icons/star_other.svg
@@ -0,0 +1,181 @@
+
+
diff --git a/resources.qrc b/resources.qrc
index 3120262bc..b31b35f50 100644
--- a/resources.qrc
+++ b/resources.qrc
@@ -75,6 +75,8 @@
icons/sources.png
icons/star.svg
icons/star_blue.svg
+ icons/star_other.svg
+ icons/star_blue_other.svg
icons/system-search.svg
icons/windows-list.svg
icons/wizard.svg
diff --git a/src/ui/favoritemanager.hh b/src/ui/favoritemanager.hh
index 1b4f13d42..bd0c0202c 100644
--- a/src/ui/favoritemanager.hh
+++ b/src/ui/favoritemanager.hh
@@ -19,7 +19,7 @@ class FavoriteManager
public:
static FavoriteType determineFavoriteType( QString const & word, unsigned group );
- static FavoriteType determineFavoriteType( const QString & word, const QString & folder )
+ static FavoriteType determineFavoriteType( const QString & word, const QString & folder );
};
diff --git a/src/ui/scanpopup.cc b/src/ui/scanpopup.cc
index 272df5264..f1d2be90e 100644
--- a/src/ui/scanpopup.cc
+++ b/src/ui/scanpopup.cc
@@ -15,6 +15,7 @@
#define MouseOver MacMouseOver
#endif
#include "base_type.hh"
+#include "favoritemanager.hh"
static const Qt::WindowFlags defaultUnpinnedWindowFlags =
@@ -1118,9 +1119,24 @@ void ScanPopup::on_sendWordToFavoritesButton_clicked()
return;
}
unsigned groupId = ui.groupList->getCurrentGroup();
- auto current_exist = isWordPresentedInFavorites( definition->getTitle(), groupId );
- //if current_exist=false( not exist ), after click ,the word should be in the favorite which is blueStar
- ui.sendWordToFavoritesButton->setIcon( !current_exist ? blueStarIcon : starIcon );
+ auto favoriteType = FavoriteManager::determineFavoriteType( definition->getTitle(), groupId );
+ bool current_exist =false;
+ switch (favoriteType) {
+ case FavoriteType::EMPTY:
+ ui.sendWordToFavoritesButton->setIcon( fullIcon );
+ break;
+ case FavoriteType::EMPTY_OTHER:
+ ui.sendWordToFavoritesButton->setIcon( fullFullIcon );
+ break;
+ case FavoriteType::FULL:
+ current_exist=true;
+ ui.sendWordToFavoritesButton->setIcon( emptyIcon );
+ break;
+ case FavoriteType::FULL_OTHER:
+ current_exist=true;
+ ui.sendWordToFavoritesButton->setIcon( emptyFullIcon );
+ break;
+ }
emit sendWordToFavorites( definition->getTitle(), cfg.lastPopupGroupId, current_exist );
}
@@ -1202,7 +1218,23 @@ void ScanPopup::titleChanged( ArticleView *, QString const & title ) const
unsigned groupId = ui.groupList->getCurrentGroup();
// Set icon for "Add to Favorites" button
- ui.sendWordToFavoritesButton->setIcon( isWordPresentedInFavorites( title, groupId ) ? blueStarIcon : starIcon );
+
+ auto favoriteType = FavoriteManager::determineFavoriteType( title, groupId );
+ switch (favoriteType) {
+ case FavoriteType::EMPTY:
+ ui.sendWordToFavoritesButton->setIcon( emptyIcon );
+
+ break;
+ case FavoriteType::EMPTY_OTHER:
+ ui.sendWordToFavoritesButton->setIcon( emptyFullIcon );
+ break;
+ case FavoriteType::FULL:
+ ui.sendWordToFavoritesButton->setIcon( fullIcon );
+ break;
+ case FavoriteType::FULL_OTHER:
+ ui.sendWordToFavoritesButton->setIcon( fullFullIcon );
+ break;
+ }
}
bool ScanPopup::isWordPresentedInFavorites( QString const & word, unsigned groupId ) const
diff --git a/src/ui/scanpopup.hh b/src/ui/scanpopup.hh
index b5df0ab8c..9d8111254 100644
--- a/src/ui/scanpopup.hh
+++ b/src/ui/scanpopup.hh
@@ -160,8 +160,10 @@ private:
QTimer mouseGrabPollTimer;
- QIcon starIcon = QIcon( ":/icons/star.svg" );
- QIcon blueStarIcon = QIcon( ":/icons/star_blue.svg" );
+ QIcon emptyIcon = QIcon( ":/icons/star.svg" );
+ QIcon fullIcon = QIcon( ":/icons/star_blue.svg" );
+ QIcon emptyFullIcon = QIcon( ":/icons/star_other.svg" );
+ QIcon fullFullIcon = QIcon( ":/icons/star_blue_other.svg" );
void handleInputWord( QString const &, bool forcePopup = false );
void engagePopup( bool forcePopup, bool giveFocus = false );