Skip to content

Instantly share code, notes, and snippets.

@ayoy
Created March 19, 2009 00:05
Show Gist options
  • Save ayoy/81492 to your computer and use it in GitHub Desktop.
Save ayoy/81492 to your computer and use it in GitHub Desktop.
diff --git a/inc/tweet.h b/inc/tweet.h
index dc1afe5..5b8cfa5 100644
--- a/inc/tweet.h
+++ b/inc/tweet.h
@@ -126,6 +126,11 @@ public:
void setState( Tweet::State state );
/*!
+ Clears a star icon (if one is shown) from the Tweet.
+ */
+ void clearStar();
+
+ /*!
Provides information about the theme that is currently set to all the Tweets.
\returns Current Tweets' theme.
\sa setTheme()
diff --git a/src/tweet.cpp b/src/tweet.cpp
index 707c1fd..434945b 100644
--- a/src/tweet.cpp
+++ b/src/tweet.cpp
@@ -197,13 +197,18 @@ void Tweet::setState( Tweet::State state )
{
tweetState = state;
applyTheme();
- if( state == Active){
+ if ( state == Active ) {
m_ui->menuButton->setIcon( QIcon( ":/icons/star_48.png" ) );
- }else{
+ } else {
m_ui->menuButton->setIcon( QIcon() );
}
}
+void Tweet::clearStar()
+{
+ m_ui->menuButton->setIcon( QIcon() );
+}
+
ThemeData Tweet::getTheme()
{
return currentTheme;
@@ -230,7 +235,7 @@ void Tweet::adjustSize()
void Tweet::menuRequested()
{
- //emit focusRequest();
+ emit focusRequest();
menu->exec( QCursor::pos() );
}
@@ -261,14 +266,14 @@ void Tweet::changeEvent( QEvent *e )
void Tweet::enterEvent( QEvent *e )
{
- // m_ui->menuButton->setIcon( QIcon( ":/icons/star_48.png" ) );
- // QWidget::enterEvent( e );
+ m_ui->menuButton->setIcon( QIcon( ":/icons/star_48.png" ) );
+ QWidget::enterEvent( e );
}
void Tweet::leaveEvent( QEvent *e )
{
- // m_ui->menuButton->setIcon( QIcon() );
- // QWidget::leaveEvent( e );
+ m_ui->menuButton->setIcon( QIcon() );
+ QWidget::leaveEvent( e );
}
void Tweet::focusRequest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment