mirror of
https://github.com/Ximi1970/systray-x.git
synced 2026-05-06 19:15:30 +02:00
Add new indicator and new shade
This commit is contained in:
@@ -20,5 +20,8 @@
|
||||
<file>languages/SysTray-X.pt-BR.qm</file>
|
||||
<file>files/icons/blank-icon-dark.png</file>
|
||||
<file>files/icons/Thunderbird115.png</file>
|
||||
<file>files/icons/new-indicator-round.png</file>
|
||||
<file>files/icons/new-indicator-star-close.png</file>
|
||||
<file>files/icons/new-indicator-star-open.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
BIN
app/SysTray-X/SysTray-X-app/files/icons/new-indicator-round.png
Normal file
BIN
app/SysTray-X/SysTray-X-app/files/icons/new-indicator-round.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -46,6 +46,13 @@ Preferences::Preferences( QObject *parent ) : QObject( parent )
|
||||
*/
|
||||
m_app_pref_changed = false;
|
||||
|
||||
m_minimize_type = PREF_MINIMIZE_METHOD_1;
|
||||
m_close_type = PREF_MINIMIZE_MAIN_CLOSE_CHILDREN_WINDOWS;
|
||||
m_minimize_icon_type = PREF_MINIMIZE_TRAY_ICON;
|
||||
|
||||
m_start_minimized = false;
|
||||
m_restore_window_positions = false;
|
||||
|
||||
m_default_icon_type = PREF_DEFAULT_ICON_DEFAULT;
|
||||
m_default_icon_mime = "image/png";
|
||||
m_default_icon_data = QByteArray();
|
||||
@@ -55,6 +62,8 @@ Preferences::Preferences( QObject *parent ) : QObject( parent )
|
||||
m_icon_mime = "image/png";
|
||||
m_icon_data = QByteArray();
|
||||
|
||||
m_theme = PREF_THEME_LIGHT;
|
||||
|
||||
m_show_number = true;
|
||||
m_number_color = "#000000";
|
||||
m_number_size = 10;
|
||||
@@ -62,12 +71,8 @@ Preferences::Preferences( QObject *parent ) : QObject( parent )
|
||||
m_startup_delay = 5;
|
||||
m_number_alignment = 4;
|
||||
m_number_margins = QMargins();
|
||||
|
||||
m_minimize_type = PREF_MINIMIZE_METHOD_1;
|
||||
m_start_minimized = false;
|
||||
m_close_type = PREF_MINIMIZE_MAIN_CLOSE_CHILDREN_WINDOWS;
|
||||
|
||||
m_restore_window_positions = false;
|
||||
m_new_indicator_type = PREF_NEW_INDICATOR_SHADE;
|
||||
m_new_shade_color = "#80ff8000";
|
||||
|
||||
m_debug = false;
|
||||
|
||||
@@ -79,8 +84,6 @@ Preferences::Preferences( QObject *parent ) : QObject( parent )
|
||||
m_version_hash = QLatin1String( APP_GITHASH );
|
||||
m_version_branch = QLatin1String( APP_GITBRANCH );
|
||||
|
||||
m_theme = PREF_THEME_LIGHT;
|
||||
|
||||
m_start_app = "";
|
||||
m_start_app_args = "";
|
||||
m_close_app = "";
|
||||
@@ -186,6 +189,172 @@ void Preferences::setBrowserBuildID( const QString buildID )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the software version.
|
||||
*/
|
||||
QString Preferences::getVersion() const
|
||||
{
|
||||
return m_version_major + "." + m_version_minor + "." + m_version_patch;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the number of commits.
|
||||
*/
|
||||
QString Preferences::getBuild() const
|
||||
{
|
||||
return m_version_build;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the git hash.
|
||||
*/
|
||||
QString Preferences::getHash() const
|
||||
{
|
||||
return m_version_hash;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the software version.
|
||||
*/
|
||||
QString Preferences::getBranch() const
|
||||
{
|
||||
return m_version_branch;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the minimize type
|
||||
*/
|
||||
Preferences::MinimizeType Preferences::getMinimizeType() const
|
||||
{
|
||||
return m_minimize_type;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the minimize type.
|
||||
*/
|
||||
void Preferences::setMinimizeType( MinimizeType minimize_type )
|
||||
{
|
||||
if( m_minimize_type != minimize_type)
|
||||
{
|
||||
m_minimize_type = minimize_type;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalMinimizeTypeChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the close type pref.
|
||||
*/
|
||||
Preferences::CloseType Preferences::getCloseType() const
|
||||
{
|
||||
return m_close_type;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the close type pref.
|
||||
*/
|
||||
void Preferences::setCloseType( CloseType close_type )
|
||||
{
|
||||
if( m_close_type != close_type )
|
||||
{
|
||||
m_close_type = close_type;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalCloseTypeChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the minimize type
|
||||
*/
|
||||
Preferences::MinimizeIconType Preferences::getMinimizeIconType() const
|
||||
{
|
||||
return m_minimize_icon_type;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the minimize type.
|
||||
*/
|
||||
void Preferences::setMinimizeIconType( MinimizeIconType minimize_icon_type )
|
||||
{
|
||||
if( m_minimize_icon_type != minimize_icon_type)
|
||||
{
|
||||
m_minimize_icon_type = minimize_icon_type;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalMinimizeIconTypeChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the start minmized pref.
|
||||
*/
|
||||
bool Preferences::getStartMinimized() const
|
||||
{
|
||||
return m_start_minimized;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the start minimized pref.
|
||||
*/
|
||||
void Preferences::setStartMinimized( bool state )
|
||||
{
|
||||
if( m_start_minimized != state )
|
||||
{
|
||||
m_start_minimized = state;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalStartMinimizedChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the start minmized pref.
|
||||
*/
|
||||
bool Preferences::getRestoreWindowPositions() const
|
||||
{
|
||||
return m_restore_window_positions;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the start minimized pref.
|
||||
*/
|
||||
void Preferences::setRestoreWindowPositions( bool state )
|
||||
{
|
||||
if( m_restore_window_positions != state )
|
||||
{
|
||||
m_restore_window_positions = state;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalRestoreWindowPositionsChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the default icon type.
|
||||
*/
|
||||
@@ -354,6 +523,32 @@ void Preferences::setIconData( const QByteArray& icon_data )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the theme pref.
|
||||
*/
|
||||
Preferences::Theme Preferences::getTheme() const
|
||||
{
|
||||
return m_theme;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the theme pref.
|
||||
*/
|
||||
void Preferences::setTheme( Theme theme )
|
||||
{
|
||||
if( m_theme != theme )
|
||||
{
|
||||
m_theme = theme;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalThemeChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the enable number state.
|
||||
*/
|
||||
@@ -380,6 +575,84 @@ void Preferences::setShowNumber( bool state )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the show new indicator state.
|
||||
*/
|
||||
bool Preferences::getShowNewIndicator() const
|
||||
{
|
||||
return m_show_new_indicator;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the show new indicator state.
|
||||
*/
|
||||
void Preferences::setShowNewIndicator( bool state )
|
||||
{
|
||||
if( m_show_new_indicator != state )
|
||||
{
|
||||
m_show_new_indicator = state;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalShowNewIndicatorChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the count type.
|
||||
*/
|
||||
Preferences::CountType Preferences::getCountType() const
|
||||
{
|
||||
return m_count_type;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the count type.
|
||||
*/
|
||||
void Preferences::setCountType( CountType count_type )
|
||||
{
|
||||
if( m_count_type != count_type)
|
||||
{
|
||||
m_count_type = count_type;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalCountTypeChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the startup delay.
|
||||
*/
|
||||
int Preferences::getStartupDelay() const
|
||||
{
|
||||
return m_startup_delay;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the startup delay.
|
||||
*/
|
||||
void Preferences::setStartupDelay( int delay )
|
||||
{
|
||||
if( m_startup_delay != delay )
|
||||
{
|
||||
m_startup_delay = delay;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalStartupDelayChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the number color.
|
||||
*/
|
||||
@@ -390,7 +663,7 @@ QString Preferences::getNumberColor() const
|
||||
|
||||
|
||||
/*
|
||||
* Set the enable number state.
|
||||
* Set the number color.
|
||||
*/
|
||||
void Preferences::setNumberColor( QString color )
|
||||
{
|
||||
@@ -416,7 +689,7 @@ int Preferences::getNumberSize() const
|
||||
|
||||
|
||||
/*
|
||||
* Set the enable number state.
|
||||
* Set the number size.
|
||||
*/
|
||||
void Preferences::setNumberSize( int size )
|
||||
{
|
||||
@@ -485,209 +758,53 @@ void Preferences::setNumberMargins( QMargins margins )
|
||||
|
||||
|
||||
/*
|
||||
* Get the count type.
|
||||
* Get the new indicator type.
|
||||
*/
|
||||
Preferences::CountType Preferences::getCountType() const
|
||||
Preferences::NewIndicatorType Preferences::getNewIndicatorType() const
|
||||
{
|
||||
return m_count_type;
|
||||
return m_new_indicator_type;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the count type.
|
||||
* Set the new indicator type.
|
||||
*/
|
||||
void Preferences::setCountType( CountType count_type )
|
||||
void Preferences::setNewIndicatorType( NewIndicatorType new_indicator_type )
|
||||
{
|
||||
if( m_count_type != count_type)
|
||||
if( m_new_indicator_type != new_indicator_type)
|
||||
{
|
||||
m_count_type = count_type;
|
||||
m_new_indicator_type = new_indicator_type;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalCountTypeChange();
|
||||
emit signalNewIndicatorTypeChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the startup delay.
|
||||
* Get the new shade color.
|
||||
*/
|
||||
int Preferences::getStartupDelay() const
|
||||
QString Preferences::getNewShadeColor() const
|
||||
{
|
||||
return m_startup_delay;
|
||||
return m_new_shade_color;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the startup delay.
|
||||
* Set the new shade color.
|
||||
*/
|
||||
void Preferences::setStartupDelay( int delay )
|
||||
void Preferences::setNewShadeColor( QString color )
|
||||
{
|
||||
if( m_startup_delay != delay )
|
||||
if( m_new_shade_color != color )
|
||||
{
|
||||
m_startup_delay = delay;
|
||||
m_new_shade_color = color;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalStartupDelayChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the minimize type
|
||||
*/
|
||||
Preferences::MinimizeType Preferences::getMinimizeType() const
|
||||
{
|
||||
return m_minimize_type;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the minimize type.
|
||||
*/
|
||||
void Preferences::setMinimizeType( MinimizeType minimize_type )
|
||||
{
|
||||
if( m_minimize_type != minimize_type)
|
||||
{
|
||||
m_minimize_type = minimize_type;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalMinimizeTypeChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the minimize type
|
||||
*/
|
||||
Preferences::MinimizeIconType Preferences::getMinimizeIconType() const
|
||||
{
|
||||
return m_minimize_icon_type;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the minimize type.
|
||||
*/
|
||||
void Preferences::setMinimizeIconType( MinimizeIconType minimize_icon_type )
|
||||
{
|
||||
if( m_minimize_icon_type != minimize_icon_type)
|
||||
{
|
||||
m_minimize_icon_type = minimize_icon_type;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalMinimizeIconTypeChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the start minmized pref.
|
||||
*/
|
||||
bool Preferences::getStartMinimized() const
|
||||
{
|
||||
return m_start_minimized;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the start minimized pref.
|
||||
*/
|
||||
void Preferences::setStartMinimized( bool state )
|
||||
{
|
||||
if( m_start_minimized != state )
|
||||
{
|
||||
m_start_minimized = state;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalStartMinimizedChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the start minmized pref.
|
||||
*/
|
||||
bool Preferences::getRestoreWindowPositions() const
|
||||
{
|
||||
return m_restore_window_positions;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the start minimized pref.
|
||||
*/
|
||||
void Preferences::setRestoreWindowPositions( bool state )
|
||||
{
|
||||
if( m_restore_window_positions != state )
|
||||
{
|
||||
m_restore_window_positions = state;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalRestoreWindowPositionsChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the close type pref.
|
||||
*/
|
||||
Preferences::CloseType Preferences::getCloseType() const
|
||||
{
|
||||
return m_close_type;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the close type pref.
|
||||
*/
|
||||
void Preferences::setCloseType( CloseType close_type )
|
||||
{
|
||||
if( m_close_type != close_type )
|
||||
{
|
||||
m_close_type = close_type;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalCloseTypeChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the theme pref.
|
||||
*/
|
||||
Preferences::Theme Preferences::getTheme() const
|
||||
{
|
||||
return m_theme;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the theme pref.
|
||||
*/
|
||||
void Preferences::setTheme( Theme theme )
|
||||
{
|
||||
if( m_theme != theme )
|
||||
{
|
||||
m_theme = theme;
|
||||
|
||||
/*
|
||||
* Tell the world the new preference
|
||||
*/
|
||||
emit signalThemeChange();
|
||||
emit signalNewShadeColorChange();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -824,39 +941,3 @@ void Preferences::setDebug( bool state )
|
||||
emit signalDebugChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the software version.
|
||||
*/
|
||||
QString Preferences::getVersion() const
|
||||
{
|
||||
return m_version_major + "." + m_version_minor + "." + m_version_patch;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the number of commits.
|
||||
*/
|
||||
QString Preferences::getBuild() const
|
||||
{
|
||||
return m_version_build;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the git hash.
|
||||
*/
|
||||
QString Preferences::getHash() const
|
||||
{
|
||||
return m_version_hash;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the software version.
|
||||
*/
|
||||
QString Preferences::getBranch() const
|
||||
{
|
||||
return m_version_branch;
|
||||
}
|
||||
|
||||
@@ -68,6 +68,11 @@ class Preferences : public QObject
|
||||
PREF_TB_ICON
|
||||
};
|
||||
|
||||
enum Theme {
|
||||
PREF_THEME_LIGHT = 0,
|
||||
PREF_THEME_DARK
|
||||
};
|
||||
|
||||
/*
|
||||
* Count types
|
||||
*/
|
||||
@@ -76,9 +81,13 @@ class Preferences : public QObject
|
||||
PREF_COUNT_NEW
|
||||
};
|
||||
|
||||
enum Theme {
|
||||
PREF_THEME_LIGHT = 0,
|
||||
PREF_THEME_DARK
|
||||
/*
|
||||
* Indicator types
|
||||
*/
|
||||
enum NewIndicatorType {
|
||||
PREF_NEW_INDICATOR_ROUND = 0,
|
||||
PREF_NEW_INDICATOR_STAR,
|
||||
PREF_NEW_INDICATOR_SHADE
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -182,6 +191,76 @@ class Preferences : public QObject
|
||||
*/
|
||||
void setBrowserBuildID( const QString buildID );
|
||||
|
||||
/**
|
||||
* @brief getStartMinimized. Get the start minimized state.
|
||||
*
|
||||
* @return The state.
|
||||
*/
|
||||
bool getStartMinimized() const;
|
||||
|
||||
/**
|
||||
* @brief setStartMinimized. Set the start minimized state.
|
||||
*
|
||||
* @param state The state.
|
||||
*/
|
||||
void setStartMinimized( bool state );
|
||||
|
||||
/**
|
||||
* @brief getRestoreWindowPositions. Get the restore window positions state.
|
||||
*
|
||||
* @return The state.
|
||||
*/
|
||||
bool getRestoreWindowPositions() const;
|
||||
|
||||
/**
|
||||
* @brief setRestoreWindowPositions. Set the restore window positions state.
|
||||
*
|
||||
* @param state The state.
|
||||
*/
|
||||
void setRestoreWindowPositions( bool state );
|
||||
|
||||
/**
|
||||
* @brief getMinimizeType. Get the minimize type.
|
||||
*
|
||||
* @return The minimize type.
|
||||
*/
|
||||
MinimizeType getMinimizeType() const;
|
||||
|
||||
/**
|
||||
* @brief setMinimizeType. Set the minimize type.
|
||||
*
|
||||
* @param minimize_type The minimize type.
|
||||
*/
|
||||
void setMinimizeType( MinimizeType minimize_type );
|
||||
|
||||
/**
|
||||
* @brief getCloseType. Get the close type.
|
||||
*
|
||||
* @return The state.
|
||||
*/
|
||||
CloseType getCloseType() const;
|
||||
|
||||
/**
|
||||
* @brief setCloseType. Set the close type.
|
||||
*
|
||||
* @param close_type The close type.
|
||||
*/
|
||||
void setCloseType( CloseType close_type );
|
||||
|
||||
/**
|
||||
* @brief getMinimizeIconType. Get the minimize icon type.
|
||||
*
|
||||
* @return The minimize icon type.
|
||||
*/
|
||||
MinimizeIconType getMinimizeIconType() const;
|
||||
|
||||
/**
|
||||
* @brief setMinimizeType. Set the minimize icon type.
|
||||
*
|
||||
* @param minimize_icon_type The minimize icon type.
|
||||
*/
|
||||
void setMinimizeIconType( MinimizeIconType minimize_icon_type );
|
||||
|
||||
/**
|
||||
* @brief getDefaultIconType. Get the default icon type.
|
||||
*
|
||||
@@ -280,6 +359,20 @@ class Preferences : public QObject
|
||||
*/
|
||||
void setIconData( const QByteArray& icon_data );
|
||||
|
||||
/**
|
||||
* @brief getTheme. Get the theme state.
|
||||
*
|
||||
* @return The state.
|
||||
*/
|
||||
Theme getTheme() const;
|
||||
|
||||
/**
|
||||
* @brief setTheme. Set the theme state.
|
||||
*
|
||||
* @param theme The state.
|
||||
*/
|
||||
void setTheme( Theme theme );
|
||||
|
||||
/**
|
||||
* @brief getShowNumber. Get the show number state.
|
||||
*
|
||||
@@ -294,6 +387,48 @@ class Preferences : public QObject
|
||||
*/
|
||||
void setShowNumber( bool state );
|
||||
|
||||
/**
|
||||
* @brief getShowNewIndicator. Get the show new indicator state.
|
||||
*
|
||||
* @return The state.
|
||||
*/
|
||||
bool getShowNewIndicator() const;
|
||||
|
||||
/**
|
||||
* @brief setShowNewIndicator. Set the show new indicator state.
|
||||
*
|
||||
* @param state The state.
|
||||
*/
|
||||
void setShowNewIndicator( bool state );
|
||||
|
||||
/**
|
||||
* @brief getCountType. Get the count type.
|
||||
*
|
||||
* @return The count type.
|
||||
*/
|
||||
CountType getCountType() const;
|
||||
|
||||
/**
|
||||
* @brief setCountType. Set the count type.
|
||||
*
|
||||
* @param count_type The count type.
|
||||
*/
|
||||
void setCountType( CountType count_type );
|
||||
|
||||
/**
|
||||
* @brief getStartupDelay. Get the startup delay.
|
||||
*
|
||||
* @return The delay.
|
||||
*/
|
||||
int getStartupDelay() const;
|
||||
|
||||
/**
|
||||
* @brief setStartupDelay. Set the startup delay.
|
||||
*
|
||||
* @param delay The size.
|
||||
*/
|
||||
void setStartupDelay( int delay );
|
||||
|
||||
/**
|
||||
* @brief getNumberColor. Get the number color.
|
||||
*
|
||||
@@ -351,116 +486,32 @@ class Preferences : public QObject
|
||||
void setNumberMargins( QMargins margins );
|
||||
|
||||
/**
|
||||
* @brief getCountType. Get the count type.
|
||||
* @brief getNewIndicatorType. Get the new indicator type.
|
||||
*
|
||||
* @return The count type.
|
||||
* @return The new indicator type.
|
||||
*/
|
||||
CountType getCountType() const;
|
||||
NewIndicatorType getNewIndicatorType() const;
|
||||
|
||||
/**
|
||||
* @brief setCountType. Set the count type.
|
||||
* @brief setNewIndicatorType. Set the new indicator type.
|
||||
*
|
||||
* @param count_type The count type.
|
||||
* @param type The indicator type.
|
||||
*/
|
||||
void setCountType( CountType count_type );
|
||||
void setNewIndicatorType( NewIndicatorType type );
|
||||
|
||||
/**
|
||||
* @brief getStartupDelay. Get the startup delay.
|
||||
* @brief getNewShadeColor. Get the new shade color.
|
||||
*
|
||||
* @return The delay.
|
||||
* @return The color.
|
||||
*/
|
||||
int getStartupDelay() const;
|
||||
QString getNewShadeColor() const;
|
||||
|
||||
/**
|
||||
* @brief setStartupDelay. Set the startup delay.
|
||||
* @brief setNewShadeColor. Set the new shade color.
|
||||
*
|
||||
* @param delay The size.
|
||||
* @param color The color.
|
||||
*/
|
||||
void setStartupDelay( int delay );
|
||||
|
||||
/**
|
||||
* @brief getMinimizeType. Get the minimize type.
|
||||
*
|
||||
* @return The minimize type.
|
||||
*/
|
||||
MinimizeType getMinimizeType() const;
|
||||
|
||||
/**
|
||||
* @brief setMinimizeType. Set the minimize type.
|
||||
*
|
||||
* @param minimize_type The minimize type.
|
||||
*/
|
||||
void setMinimizeType( MinimizeType minimize_type );
|
||||
|
||||
/**
|
||||
* @brief getMinimizeIconType. Get the minimize icon type.
|
||||
*
|
||||
* @return The minimize icon type.
|
||||
*/
|
||||
MinimizeIconType getMinimizeIconType() const;
|
||||
|
||||
/**
|
||||
* @brief setMinimizeType. Set the minimize icon type.
|
||||
*
|
||||
* @param minimize_icon_type The minimize icon type.
|
||||
*/
|
||||
void setMinimizeIconType( MinimizeIconType minimize_icon_type );
|
||||
|
||||
/**
|
||||
* @brief getStartMinimized. Get the start minimized state.
|
||||
*
|
||||
* @return The state.
|
||||
*/
|
||||
bool getStartMinimized() const;
|
||||
|
||||
/**
|
||||
* @brief setStartMinimized. Set the start minimized state.
|
||||
*
|
||||
* @param state The state.
|
||||
*/
|
||||
void setStartMinimized( bool state );
|
||||
|
||||
/**
|
||||
* @brief getRestoreWindowPositions. Get the restore window positions state.
|
||||
*
|
||||
* @return The state.
|
||||
*/
|
||||
bool getRestoreWindowPositions() const;
|
||||
|
||||
/**
|
||||
* @brief setRestoreWindowPositions. Set the restore window positions state.
|
||||
*
|
||||
* @param state The state.
|
||||
*/
|
||||
void setRestoreWindowPositions( bool state );
|
||||
|
||||
/**
|
||||
* @brief getCloseType. Get the close type.
|
||||
*
|
||||
* @return The state.
|
||||
*/
|
||||
CloseType getCloseType() const;
|
||||
|
||||
/**
|
||||
* @brief setCloseType. Set the close type.
|
||||
*
|
||||
* @param close_type The close type.
|
||||
*/
|
||||
void setCloseType( CloseType close_type );
|
||||
|
||||
/**
|
||||
* @brief getTheme. Get the theme state.
|
||||
*
|
||||
* @return The state.
|
||||
*/
|
||||
Theme getTheme() const;
|
||||
|
||||
/**
|
||||
* @brief setTheme. Set the theme state.
|
||||
*
|
||||
* @param theme The state.
|
||||
*/
|
||||
void setTheme( Theme theme );
|
||||
void setNewShadeColor( QString color );
|
||||
|
||||
/**
|
||||
* @brief getStartApp. Get the start application.
|
||||
@@ -574,6 +625,31 @@ class Preferences : public QObject
|
||||
*/
|
||||
void signalBrowserVersion();
|
||||
|
||||
/**
|
||||
* @brief signalMinimizeTypeChange. Signal a minimize type change.
|
||||
*/
|
||||
void signalMinimizeTypeChange();
|
||||
|
||||
/**
|
||||
* @brief signalCloseTypeChange. Signal a close type change.
|
||||
*/
|
||||
void signalCloseTypeChange();
|
||||
|
||||
/**
|
||||
* @brief signalMinimizeIconTypeChange. Signal a minimize icon type change.
|
||||
*/
|
||||
void signalMinimizeIconTypeChange();
|
||||
|
||||
/**
|
||||
* @brief signalStartMinimizedChange. Signal a start minimized state change.
|
||||
*/
|
||||
void signalStartMinimizedChange();
|
||||
|
||||
/**
|
||||
* @brief signalRestoreWindowPositionsChange. Signal a restore window positions state change.
|
||||
*/
|
||||
void signalRestoreWindowPositionsChange();
|
||||
|
||||
/**
|
||||
* @brief signalDefaultIconTypeChange. Signal a default icon type change.
|
||||
*/
|
||||
@@ -599,11 +675,31 @@ class Preferences : public QObject
|
||||
*/
|
||||
void signalIconDataChange();
|
||||
|
||||
/**
|
||||
* @brief signalThemeChange. Signal a theme state change.
|
||||
*/
|
||||
void signalThemeChange();
|
||||
|
||||
/**
|
||||
* @brief signalShowNumberChange. Signal a show number state change.
|
||||
*/
|
||||
void signalShowNumberChange();
|
||||
|
||||
/**
|
||||
* @brief signalShowNewIndicatorChange. Signal a show new indicator state change.
|
||||
*/
|
||||
void signalShowNewIndicatorChange();
|
||||
|
||||
/**
|
||||
* @brief signalCountTypeChange. Signal a count type change.
|
||||
*/
|
||||
void signalCountTypeChange();
|
||||
|
||||
/**
|
||||
* @brief signalStartupDelayChange. Signal a startup delay change.
|
||||
*/
|
||||
void signalStartupDelayChange();
|
||||
|
||||
/**
|
||||
* @brief signalNumberColorChange. Signal a number color change.
|
||||
*/
|
||||
@@ -625,50 +721,20 @@ class Preferences : public QObject
|
||||
void signalNumberMarginsChange();
|
||||
|
||||
/**
|
||||
* @brief signalCountTypeChange. Signal a count type change.
|
||||
* @brief signalNewIndicatorTypeChange. Signal a new indicator type change.
|
||||
*/
|
||||
void signalCountTypeChange();
|
||||
void signalNewIndicatorTypeChange();
|
||||
|
||||
/**
|
||||
* @brief signalStartupDelayChange. Signal a startup delay change.
|
||||
* @brief signalNewShadeColorChange. Signal a new shade color change.
|
||||
*/
|
||||
void signalStartupDelayChange();
|
||||
|
||||
/**
|
||||
* @brief signalMinimizeTypeChange. Signal a minimize type change.
|
||||
*/
|
||||
void signalMinimizeTypeChange();
|
||||
|
||||
/**
|
||||
* @brief signalMinimizeIconTypeChange. Signal a minimize icon type change.
|
||||
*/
|
||||
void signalMinimizeIconTypeChange();
|
||||
|
||||
/**
|
||||
* @brief signalStartMinimizedChange. Signal a start minimized state change.
|
||||
*/
|
||||
void signalStartMinimizedChange();
|
||||
|
||||
/**
|
||||
* @brief signalRestoreWindowPositionsChange. Signal a restore window positions state change.
|
||||
*/
|
||||
void signalRestoreWindowPositionsChange();
|
||||
|
||||
/**
|
||||
* @brief signalCloseTypeChange. Signal a close type change.
|
||||
*/
|
||||
void signalCloseTypeChange();
|
||||
void signalNewShadeColorChange();
|
||||
|
||||
/**
|
||||
* @brief signalDebugChange. Signal a debug state change.
|
||||
*/
|
||||
void signalDebugChange();
|
||||
|
||||
/**
|
||||
* @brief signalThemeChange. Signal a theme state change.
|
||||
*/
|
||||
void signalThemeChange();
|
||||
|
||||
/**
|
||||
* @brief signalStartAppChange. Signal a start application change.
|
||||
*/
|
||||
@@ -711,6 +777,60 @@ class Preferences : public QObject
|
||||
QString m_browser_version;
|
||||
QString m_browser_buildID;
|
||||
|
||||
/**
|
||||
* @brief m_version_major. Major version number.
|
||||
*/
|
||||
QString m_version_major;
|
||||
|
||||
/**
|
||||
* @brief m_version_minor. Minor version number.
|
||||
*/
|
||||
QString m_version_minor;
|
||||
|
||||
/**
|
||||
* @brief m_version_patch. patch version number.
|
||||
*/
|
||||
QString m_version_patch;
|
||||
|
||||
/**
|
||||
* @brief m_version_build. Git commits count.
|
||||
*/
|
||||
QString m_version_build;
|
||||
|
||||
/**
|
||||
* @brief m_version_build. Git hash.
|
||||
*/
|
||||
QString m_version_hash;
|
||||
|
||||
/**
|
||||
* @brief m_version_build. Git branch.
|
||||
*/
|
||||
QString m_version_branch;
|
||||
/**
|
||||
* @brief m_minimize_type. Selected minimize type.
|
||||
*/
|
||||
MinimizeType m_minimize_type;
|
||||
|
||||
/**
|
||||
* @brief m_close_type. Closing type for TB.
|
||||
*/
|
||||
CloseType m_close_type;
|
||||
|
||||
/**
|
||||
* @brief m_minimize_icon_type. Selected minimize icon type.
|
||||
*/
|
||||
MinimizeIconType m_minimize_icon_type;
|
||||
|
||||
/**
|
||||
* @brief m_start_minimized. Start TB minimized.
|
||||
*/
|
||||
bool m_start_minimized;
|
||||
|
||||
/**
|
||||
* @brief m_restore_window_positions. Force the same window positions on startup as recorded on the last hide.
|
||||
*/
|
||||
bool m_restore_window_positions;
|
||||
|
||||
/**
|
||||
* @brief m_default_icon_type. Selected icon type.
|
||||
*/
|
||||
@@ -746,11 +866,31 @@ class Preferences : public QObject
|
||||
*/
|
||||
QByteArray m_icon_data;
|
||||
|
||||
/**
|
||||
* @brief m_theme. The theme.
|
||||
*/
|
||||
Theme m_theme;
|
||||
|
||||
/**
|
||||
* @brief m_show_number. Show number in systray icon.
|
||||
*/
|
||||
bool m_show_number;
|
||||
|
||||
/**
|
||||
* @brief m_show_number. Show number in systray icon.
|
||||
*/
|
||||
bool m_show_new_indicator;
|
||||
|
||||
/**
|
||||
* @brief m_count_type. Selected count type.
|
||||
*/
|
||||
CountType m_count_type;
|
||||
|
||||
/**
|
||||
* @brief m_startup_delay. The startup delay.
|
||||
*/
|
||||
int m_startup_delay;
|
||||
|
||||
/**
|
||||
* @brief m_number_color. The color of the number in systray icon.
|
||||
*/
|
||||
@@ -772,79 +912,14 @@ class Preferences : public QObject
|
||||
QMargins m_number_margins;
|
||||
|
||||
/**
|
||||
* @brief m_count_type. Selected count type.
|
||||
* @brief m_new_indicator_type. Selected new indicator type.
|
||||
*/
|
||||
CountType m_count_type;
|
||||
NewIndicatorType m_new_indicator_type;
|
||||
|
||||
/**
|
||||
* @brief m_startup_delay. The startup delay.
|
||||
* @brief m_new_shade_color. The color of the new shade in systray icon.
|
||||
*/
|
||||
int m_startup_delay;
|
||||
|
||||
/**
|
||||
* @brief m_minimize_type. Selected minimize type.
|
||||
*/
|
||||
MinimizeType m_minimize_type;
|
||||
|
||||
/**
|
||||
* @brief m_minimize_icon_type. Selected minimize icon type.
|
||||
*/
|
||||
MinimizeIconType m_minimize_icon_type;
|
||||
|
||||
/**
|
||||
* @brief m_start_minimized. Start TB minimized.
|
||||
*/
|
||||
bool m_start_minimized;
|
||||
|
||||
/**
|
||||
* @brief m_restore_window_positions. Force the same window positions on startup as recorded on the last hide.
|
||||
*/
|
||||
bool m_restore_window_positions;
|
||||
|
||||
/**
|
||||
* @brief m_close_type. Closing type for TB.
|
||||
*/
|
||||
CloseType m_close_type;
|
||||
|
||||
/**
|
||||
* @brief m_debug. Display debug window.
|
||||
*/
|
||||
bool m_debug;
|
||||
|
||||
/**
|
||||
* @brief m_version_major. Major version number.
|
||||
*/
|
||||
QString m_version_major;
|
||||
|
||||
/**
|
||||
* @brief m_version_minor. Minor version number.
|
||||
*/
|
||||
QString m_version_minor;
|
||||
|
||||
/**
|
||||
* @brief m_version_patch. patch version number.
|
||||
*/
|
||||
QString m_version_patch;
|
||||
|
||||
/**
|
||||
* @brief m_version_build. Git commits count.
|
||||
*/
|
||||
QString m_version_build;
|
||||
|
||||
/**
|
||||
* @brief m_version_build. Git hash.
|
||||
*/
|
||||
QString m_version_hash;
|
||||
|
||||
/**
|
||||
* @brief m_version_build. Git branch.
|
||||
*/
|
||||
QString m_version_branch;
|
||||
|
||||
/**
|
||||
* @brief m_theme. The theme.
|
||||
*/
|
||||
Theme m_theme;
|
||||
QString m_new_shade_color;
|
||||
|
||||
/**
|
||||
* @brief m_start_app
|
||||
@@ -865,6 +940,11 @@ class Preferences : public QObject
|
||||
* @brief m_close_app_args
|
||||
*/
|
||||
QString m_close_app_args;
|
||||
|
||||
/**
|
||||
* @brief m_debug. Display debug window.
|
||||
*/
|
||||
bool m_debug;
|
||||
};
|
||||
|
||||
#endif // PREFERENCES_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>555</width>
|
||||
<width>463</width>
|
||||
<height>531</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -23,7 +23,7 @@
|
||||
<iconset resource="SysTray-X.qrc">
|
||||
<normaloff>:/files/icons/SysTray-X.png</normaloff>:/files/icons/SysTray-X.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_10">
|
||||
<layout class="QGridLayout" name="gridLayout_14">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_11">
|
||||
<item>
|
||||
@@ -348,241 +348,7 @@
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="3">
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>Number properties</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="showNumberCheckBox">
|
||||
<property name="text">
|
||||
<string>Display unread message count</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayoutNumColor">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Number color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="numberColorPushButton">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayoutNumSize">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Number size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="numberSizeSpinBox">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayoutAlignment">
|
||||
<item>
|
||||
<widget class="QLabel" name="numberAlignmentLabel">
|
||||
<property name="text">
|
||||
<string>Alignment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="numberAlignmentComboBox">
|
||||
<property name="currentIndex">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Top left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Top centre</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Top right</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Middle left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Middle centre</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Middle right</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Bottom left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Bottom centre</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Bottom right</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<widget class="QLabel" name="numberMarginsLabel">
|
||||
<property name="text">
|
||||
<string>Margins (left, top, right, bottom):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="numberMarginLeftSpinBox">
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="numberMarginTopSpinBox">
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="numberMarginRightSpinBox">
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="numberMarginBottomSpinBox">
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Startup delay</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="startupDelaySpinBox">
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>99</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>5</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QGroupBox" name="countTypeGroupBox">
|
||||
<property name="title">
|
||||
<string>Count type</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="unreadRadioButton">
|
||||
<property name="text">
|
||||
<string>Unread</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">countTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="newRadioButton">
|
||||
<property name="text">
|
||||
<string>New</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">countTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="1" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -595,7 +361,7 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="themeGroupBox">
|
||||
<property name="title">
|
||||
<string>Theme</string>
|
||||
@@ -824,6 +590,367 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>Count</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_10">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="showNumberCheckBox">
|
||||
<property name="text">
|
||||
<string>Show message count</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="showNewCheckBox">
|
||||
<property name="text">
|
||||
<string>Show new indicator</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Startup delay</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="startupDelaySpinBox">
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>99</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>5</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QGroupBox" name="countTypeGroupBox">
|
||||
<property name="title">
|
||||
<string>Count type</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_12">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="unreadRadioButton">
|
||||
<property name="text">
|
||||
<string>Unread</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">countTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="newRadioButton">
|
||||
<property name="text">
|
||||
<string>New</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">countTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0" rowspan="2" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>Number properties</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="1" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<widget class="QLabel" name="numberMarginsLabel">
|
||||
<property name="text">
|
||||
<string>Margins (left, top, right, bottom):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="numberMarginLeftSpinBox">
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="numberMarginTopSpinBox">
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="numberMarginRightSpinBox">
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="numberMarginBottomSpinBox">
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayoutNumColor">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Number color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="numberColorPushButton">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayoutNumSize">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Number size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="numberSizeSpinBox">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayoutAlignment">
|
||||
<item>
|
||||
<widget class="QLabel" name="numberAlignmentLabel">
|
||||
<property name="text">
|
||||
<string>Alignment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="numberAlignmentComboBox">
|
||||
<property name="currentIndex">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Top left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Top centre</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Top right</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Middle left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Middle centre</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Middle right</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Bottom left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Bottom centre</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Bottom right</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_7">
|
||||
<property name="title">
|
||||
<string>New indicator</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_20">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_19">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="newIconRoundRadioButton">
|
||||
<property name="text">
|
||||
<string>Icon round</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">newIndicatorTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="newIconStarRadioButton">
|
||||
<property name="text">
|
||||
<string>Icon star</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">newIndicatorTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_15">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="newShadeRadioButton">
|
||||
<property name="text">
|
||||
<string>Shade</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">newIndicatorTypeGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="newShadeColorPushButton">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="verticalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>104</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<spacer name="verticalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Apps</string>
|
||||
@@ -1059,12 +1186,13 @@
|
||||
</resources>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="countTypeGroup"/>
|
||||
<buttongroup name="minimizeTypeGroup"/>
|
||||
<buttongroup name="themeGroup"/>
|
||||
<buttongroup name="iconTypeGroup"/>
|
||||
<buttongroup name="defaultIconTypeGroup"/>
|
||||
<buttongroup name="minimizeIconTypeGroup"/>
|
||||
<buttongroup name="newIndicatorTypeGroup"/>
|
||||
<buttongroup name="countTypeGroup"/>
|
||||
<buttongroup name="closeTypeGroup"/>
|
||||
<buttongroup name="minimizeIconTypeGroup"/>
|
||||
<buttongroup name="minimizeTypeGroup"/>
|
||||
<buttongroup name="defaultIconTypeGroup"/>
|
||||
<buttongroup name="themeGroup"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
||||
@@ -108,6 +108,19 @@ PreferencesDialog::PreferencesDialog( SysTrayXLink *link, Preferences *pref, QWi
|
||||
m_tmp_default_icon_data = QByteArray();
|
||||
m_tmp_default_icon_mime = QString();
|
||||
|
||||
/*
|
||||
* Set theme button Ids
|
||||
*/
|
||||
m_ui->themeGroup->setId( m_ui->lightRadioButton, Preferences::PREF_THEME_LIGHT );
|
||||
m_ui->themeGroup->setId( m_ui->darkRadioButton, Preferences::PREF_THEME_DARK );
|
||||
|
||||
/*
|
||||
* Set new indicator button Ids
|
||||
*/
|
||||
m_ui->newIndicatorTypeGroup->setId( m_ui->newIconRoundRadioButton, Preferences::PREF_NEW_INDICATOR_ROUND );
|
||||
m_ui->newIndicatorTypeGroup->setId( m_ui->newIconStarRadioButton, Preferences::PREF_NEW_INDICATOR_STAR );
|
||||
m_ui->newIndicatorTypeGroup->setId( m_ui->newShadeRadioButton, Preferences::PREF_NEW_INDICATOR_SHADE);
|
||||
|
||||
/*
|
||||
* Signals and slots
|
||||
*/
|
||||
@@ -115,6 +128,8 @@ PreferencesDialog::PreferencesDialog( SysTrayXLink *link, Preferences *pref, QWi
|
||||
connect( m_ui->chooseCustomButton, &QPushButton::clicked, this, &PreferencesDialog::slotFileSelect );
|
||||
connect( m_ui->numberColorPushButton, &QPushButton::clicked, this, &PreferencesDialog::slotColorSelect );
|
||||
|
||||
connect( m_ui->newShadeColorPushButton, &QPushButton::clicked, this, &PreferencesDialog::slotNewShadeColorSelect );
|
||||
|
||||
connect( m_ui->savePushButton, &QPushButton::clicked, this, &PreferencesDialog::slotAccept);
|
||||
connect( m_ui->cancelPushButton, &QPushButton::clicked, this, &PreferencesDialog::slotReject);
|
||||
|
||||
@@ -136,12 +151,6 @@ PreferencesDialog::PreferencesDialog( SysTrayXLink *link, Preferences *pref, QWi
|
||||
*/
|
||||
setStartupDelay( m_pref->getStartupDelay() );
|
||||
|
||||
/*
|
||||
* Set theme button Ids
|
||||
*/
|
||||
m_ui->themeGroup->setId( m_ui->lightRadioButton, Preferences::PREF_THEME_LIGHT);
|
||||
m_ui->themeGroup->setId( m_ui->darkRadioButton, Preferences::PREF_THEME_DARK );
|
||||
|
||||
/*
|
||||
* Set number alignment
|
||||
*/
|
||||
@@ -152,6 +161,11 @@ PreferencesDialog::PreferencesDialog( SysTrayXLink *link, Preferences *pref, QWi
|
||||
*/
|
||||
setNumberMargins( m_pref->getNumberMargins() );
|
||||
|
||||
/*
|
||||
* Set new shade color
|
||||
*/
|
||||
setNewShadeColor( m_pref->getNewShadeColor() );
|
||||
|
||||
/*
|
||||
* Set the start and close application parameters
|
||||
*/
|
||||
@@ -365,7 +379,16 @@ void PreferencesDialog::setHideDefaultIcon( bool hide )
|
||||
|
||||
|
||||
/*
|
||||
* Set the enable number state
|
||||
* Set the theme
|
||||
*/
|
||||
void PreferencesDialog::setTheme( Preferences::Theme theme )
|
||||
{
|
||||
( m_ui->themeGroup->button( theme ) )->setChecked( true );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the show number state
|
||||
*/
|
||||
void PreferencesDialog::setShowNumber( bool state )
|
||||
{
|
||||
@@ -373,6 +396,33 @@ void PreferencesDialog::setShowNumber( bool state )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the show new indicator state
|
||||
*/
|
||||
void PreferencesDialog::setShowNewIndicator( bool state )
|
||||
{
|
||||
m_ui->showNewCheckBox->setChecked( state );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the startup delay
|
||||
*/
|
||||
void PreferencesDialog::setStartupDelay( int delay )
|
||||
{
|
||||
m_ui->startupDelaySpinBox->setValue( delay );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the count type
|
||||
*/
|
||||
void PreferencesDialog::setCountType( Preferences::CountType count_type )
|
||||
{
|
||||
( m_ui->countTypeGroup->button( count_type ) )->setChecked( true );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the number color
|
||||
*/
|
||||
@@ -418,29 +468,25 @@ void PreferencesDialog::setNumberMargins( QMargins margins )
|
||||
|
||||
|
||||
/*
|
||||
* Set the count type
|
||||
* Set the new indicator type
|
||||
*/
|
||||
void PreferencesDialog::setCountType( Preferences::CountType count_type )
|
||||
void PreferencesDialog::setNewIndicatorType( Preferences::NewIndicatorType new_indicator_type )
|
||||
{
|
||||
( m_ui->countTypeGroup->button( count_type ) )->setChecked( true );
|
||||
( m_ui->newIndicatorTypeGroup->button( new_indicator_type ) )->setChecked( true );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the startup delay
|
||||
* Set the new shade color
|
||||
*/
|
||||
void PreferencesDialog::setStartupDelay( int delay )
|
||||
void PreferencesDialog::setNewShadeColor( QString color )
|
||||
{
|
||||
m_ui->startupDelaySpinBox->setValue( delay );
|
||||
}
|
||||
m_new_shade_color = color;
|
||||
|
||||
QPixmap pixmap( 256, 256 );
|
||||
pixmap.fill( QColor( color ) );
|
||||
|
||||
/*
|
||||
* Set the theme
|
||||
*/
|
||||
void PreferencesDialog::setTheme( Preferences::Theme theme )
|
||||
{
|
||||
( m_ui->themeGroup->button( theme ) )->setChecked( true );
|
||||
m_ui->newShadeColorPushButton->setIcon( QIcon( pixmap ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -506,18 +552,20 @@ void PreferencesDialog::slotAccept()
|
||||
m_pref->setStartMinimized( m_ui->startMinimizedCheckBox->isChecked() );
|
||||
m_pref->setRestoreWindowPositions( m_ui->restorePositionscheckBox->isChecked() );
|
||||
m_pref->setCloseType( static_cast< Preferences::CloseType >( m_ui->closeTypeGroup->checkedId() ) );
|
||||
Preferences::Theme theme = static_cast< Preferences::Theme >( m_ui->themeGroup->checkedId() );
|
||||
m_pref->setTheme( theme );
|
||||
|
||||
m_pref->setShowNumber( m_ui->showNumberCheckBox->isChecked() );
|
||||
m_pref->setNumberSize( m_ui->numberSizeSpinBox->value() );
|
||||
m_pref->setCountType( static_cast< Preferences::CountType >( m_ui->countTypeGroup->checkedId() ) );
|
||||
m_pref->setShowNewIndicator( m_ui->showNewCheckBox->isChecked() );
|
||||
m_pref->setStartupDelay( m_ui->startupDelaySpinBox->value() );
|
||||
m_pref->setCountType( static_cast< Preferences::CountType >( m_ui->countTypeGroup->checkedId() ) );
|
||||
m_pref->setNumberSize( m_ui->numberSizeSpinBox->value() );
|
||||
|
||||
m_pref->setNumberAlignment( m_ui->numberAlignmentComboBox->currentIndex() );
|
||||
m_pref->setNumberMargins( QMargins( m_ui->numberMarginLeftSpinBox->value(), m_ui->numberMarginTopSpinBox->value(),
|
||||
m_ui->numberMarginRightSpinBox->value(), m_ui->numberMarginBottomSpinBox->value() ) );
|
||||
|
||||
Preferences::Theme theme = static_cast< Preferences::Theme >( m_ui->themeGroup->checkedId() );
|
||||
m_pref->setTheme( theme );
|
||||
m_pref->setNewIndicatorType( static_cast< Preferences::NewIndicatorType >( m_ui->newIndicatorTypeGroup->checkedId() ) );
|
||||
m_pref->setNewShadeColor( m_new_shade_color );
|
||||
|
||||
QString startApp = m_ui->startAppLineEdit->text();
|
||||
m_pref->setStartApp( startApp );
|
||||
@@ -583,15 +631,19 @@ void PreferencesDialog::slotReject()
|
||||
setStartMinimized( m_pref->getStartMinimized() );
|
||||
setRestoreWindowPositions( m_pref->getRestoreWindowPositions() );
|
||||
setCloseType( m_pref->getCloseType() );
|
||||
setTheme( m_pref->getTheme() );
|
||||
|
||||
setShowNumber( m_pref->getShowNumber() );
|
||||
setShowNewIndicator( m_pref->getShowNewIndicator() );
|
||||
setStartupDelay( m_pref->getStartupDelay());
|
||||
setCountType( m_pref->getCountType() );
|
||||
setNumberColor( m_pref->getNumberColor() );
|
||||
setNumberSize( m_pref->getNumberSize());
|
||||
setCountType( m_pref->getCountType() );
|
||||
setStartupDelay( m_pref->getStartupDelay());
|
||||
setNumberAlignment( m_pref->getNumberAlignment() );
|
||||
setNumberMargins( m_pref->getNumberMargins() );
|
||||
setTheme( m_pref->getTheme() );
|
||||
setNewIndicatorType( m_pref->getNewIndicatorType() );
|
||||
setNewShadeColor( m_pref->getNewShadeColor() );
|
||||
|
||||
setStartApp( m_pref->getStartApp() );
|
||||
setStartAppArgs( m_pref->getStartAppArgs() );
|
||||
setCloseApp( m_pref->getCloseApp() );
|
||||
@@ -651,7 +703,7 @@ void PreferencesDialog::slotDefaultFileSelect()
|
||||
|
||||
|
||||
/*
|
||||
* Handle the colro select button
|
||||
* Handle the color select button
|
||||
*/
|
||||
void PreferencesDialog::slotColorSelect()
|
||||
{
|
||||
@@ -665,6 +717,21 @@ void PreferencesDialog::slotColorSelect()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the new shade color select button
|
||||
*/
|
||||
void PreferencesDialog::slotNewShadeColorSelect()
|
||||
{
|
||||
QColor color( m_new_shade_color );
|
||||
QColorDialog color_dialog( color );
|
||||
|
||||
if( color_dialog.exec() )
|
||||
{
|
||||
setNewShadeColor( color_dialog.selectedColor().name() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the start application button
|
||||
*/
|
||||
@@ -719,6 +786,24 @@ void PreferencesDialog::slotBrowserVersion()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the start minimized change signal
|
||||
*/
|
||||
void PreferencesDialog::slotStartMinimizedChange()
|
||||
{
|
||||
setStartMinimized( m_pref->getStartMinimized() );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the restore window positions change signal
|
||||
*/
|
||||
void PreferencesDialog::slotRestoreWindowPositionsChange()
|
||||
{
|
||||
setRestoreWindowPositions( m_pref->getRestoreWindowPositions() );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the minimize type change signal
|
||||
*/
|
||||
@@ -737,23 +822,6 @@ void PreferencesDialog::slotMinimizeIconTypeChange()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the start minimized change signal
|
||||
*/
|
||||
void PreferencesDialog::slotStartMinimizedChange()
|
||||
{
|
||||
setStartMinimized( m_pref->getStartMinimized() );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the restore window positions change signal
|
||||
*/
|
||||
void PreferencesDialog::slotRestoreWindowPositionsChange()
|
||||
{
|
||||
setRestoreWindowPositions( m_pref->getRestoreWindowPositions() );
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle the minimize on close change signal
|
||||
*/
|
||||
@@ -821,7 +889,16 @@ void PreferencesDialog::slotHideDefaultIconChange()
|
||||
|
||||
|
||||
/*
|
||||
* Handle the enable number state change
|
||||
* Handle the theme change signal
|
||||
*/
|
||||
void PreferencesDialog::slotThemeChange()
|
||||
{
|
||||
setTheme( m_pref->getTheme() );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the show number state change
|
||||
*/
|
||||
void PreferencesDialog::slotShowNumberChange()
|
||||
{
|
||||
@@ -829,6 +906,15 @@ void PreferencesDialog::slotShowNumberChange()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the show new indicator state change
|
||||
*/
|
||||
void PreferencesDialog::slotShowNewIndicatorChange()
|
||||
{
|
||||
setShowNewIndicator( m_pref->getShowNewIndicator() );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the number color change
|
||||
*/
|
||||
@@ -884,11 +970,20 @@ void PreferencesDialog::slotNumberMarginsChange()
|
||||
|
||||
|
||||
/*
|
||||
* Handle the theme change signal
|
||||
* Handle the new indicator type change
|
||||
*/
|
||||
void PreferencesDialog::slotThemeChange()
|
||||
void PreferencesDialog::slotNewIndicatorTypeChange()
|
||||
{
|
||||
setTheme( m_pref->getTheme() );
|
||||
setNewIndicatorType( m_pref->getNewIndicatorType() );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the new shade color change
|
||||
*/
|
||||
void PreferencesDialog::slotNewShadeColorChange()
|
||||
{
|
||||
setNewShadeColor( m_pref->getNewShadeColor() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -146,6 +146,13 @@ class PreferencesDialog : public QDialog
|
||||
*/
|
||||
void setHideDefaultIcon( bool hide );
|
||||
|
||||
/**
|
||||
* @brief setTheme. Set the theme.
|
||||
*
|
||||
* @param theme The theme.
|
||||
*/
|
||||
void setTheme( Preferences::Theme theme );
|
||||
|
||||
/**
|
||||
* @brief setShowNumber. Set the show number state.
|
||||
*
|
||||
@@ -153,6 +160,27 @@ class PreferencesDialog : public QDialog
|
||||
*/
|
||||
void setShowNumber( bool state );
|
||||
|
||||
/**
|
||||
* @brief setShowNewIndicator. Set the show new indicator state.
|
||||
*
|
||||
* @param state The state.
|
||||
*/
|
||||
void setShowNewIndicator( bool state );
|
||||
|
||||
/**
|
||||
* @brief setCountType. Set the count type.
|
||||
*
|
||||
* @param count_type The count type.
|
||||
*/
|
||||
void setCountType( Preferences::CountType count_type );
|
||||
|
||||
/**
|
||||
* @brief setStartupDelay. Set the startup delay.
|
||||
*
|
||||
* @param delay The delay.
|
||||
*/
|
||||
void setStartupDelay( int size );
|
||||
|
||||
/**
|
||||
* @brief setNumberColor. Set the number color.
|
||||
*
|
||||
@@ -189,25 +217,18 @@ class PreferencesDialog : public QDialog
|
||||
QMargins getNumberMargins() const;
|
||||
|
||||
/**
|
||||
* @brief setCountType. Set the count type.
|
||||
* @brief setNewIndicatorType. Set the count type.
|
||||
*
|
||||
* @param count_type The count type.
|
||||
* @param new_indicator_type The new indicator type.
|
||||
*/
|
||||
void setCountType( Preferences::CountType count_type );
|
||||
void setNewIndicatorType( Preferences::NewIndicatorType new_indicator_type );
|
||||
|
||||
/**
|
||||
* @brief setStartupDelay. Set the startup delay.
|
||||
* @brief setNewShadeColor. Set the new shade color.
|
||||
*
|
||||
* @param delay The delay.
|
||||
* @param color The color.
|
||||
*/
|
||||
void setStartupDelay( int size );
|
||||
|
||||
/**
|
||||
* @brief setTheme. Set the theme.
|
||||
*
|
||||
* @param theme The theme.
|
||||
*/
|
||||
void setTheme( Preferences::Theme theme );
|
||||
void setNewShadeColor( QString color );
|
||||
|
||||
/**
|
||||
* @brief setStartApp. Set the start application.
|
||||
@@ -314,11 +335,31 @@ class PreferencesDialog : public QDialog
|
||||
*/
|
||||
void slotDefaultIconDataChange();
|
||||
|
||||
/**
|
||||
* @brief slotThemeChange. Slot for handling theme change.
|
||||
*/
|
||||
void slotThemeChange();
|
||||
|
||||
/**
|
||||
* @brief slotCountTypeChange. Slot for handling count type change.
|
||||
*/
|
||||
void slotCountTypeChange();
|
||||
|
||||
/**
|
||||
* @brief slotStartupDelayChange. Slot for handling startup delay change.
|
||||
*/
|
||||
void slotStartupDelayChange();
|
||||
|
||||
/**
|
||||
* @brief slotShowNumberChange. Slot for handling show number state change.
|
||||
*/
|
||||
void slotShowNumberChange();
|
||||
|
||||
/**
|
||||
* @brief slotShowNewIndicatorChange. Slot for handling show new indicator state change.
|
||||
*/
|
||||
void slotShowNewIndicatorChange();
|
||||
|
||||
/**
|
||||
* @brief slotNumberColorChange. Slot for handling number color change.
|
||||
*/
|
||||
@@ -340,19 +381,14 @@ class PreferencesDialog : public QDialog
|
||||
void slotNumberMarginsChange();
|
||||
|
||||
/**
|
||||
* @brief slotCountTypeChange. Slot for handling count type change.
|
||||
* @brief slotNewIndicatorTypeChange. Slot for handling new indicator type change.
|
||||
*/
|
||||
void slotCountTypeChange();
|
||||
void slotNewIndicatorTypeChange();
|
||||
|
||||
/**
|
||||
* @brief slotStartupDelayChange. Slot for handling startup delay change.
|
||||
* @brief slotNewShadeColorChange. Slot for handling new shade color change.
|
||||
*/
|
||||
void slotStartupDelayChange();
|
||||
|
||||
/**
|
||||
* @brief slotThemeChange. Slot for handling theme change.
|
||||
*/
|
||||
void slotThemeChange();
|
||||
void slotNewShadeColorChange();
|
||||
|
||||
/**
|
||||
* @brief slotStartAppChange. Slot for handling start application change.
|
||||
@@ -401,6 +437,11 @@ class PreferencesDialog : public QDialog
|
||||
*/
|
||||
void slotColorSelect();
|
||||
|
||||
/**
|
||||
* @brief slotNewShadeColorSelect. Handle the choose new shade color button click.
|
||||
*/
|
||||
void slotNewShadeColorSelect();
|
||||
|
||||
/**
|
||||
* @brief slotStartAppSelect. Handle the start application button click.
|
||||
*/
|
||||
@@ -452,6 +493,11 @@ class PreferencesDialog : public QDialog
|
||||
* @brief m_number_color. Temporary storage for the number color.
|
||||
*/
|
||||
QString m_number_color;
|
||||
|
||||
/**
|
||||
* @brief m_new_shade_color. Temporary storage for the new shade color.
|
||||
*/
|
||||
QString m_new_shade_color;
|
||||
};
|
||||
|
||||
#endif // PREFERENCESDIALOG_H
|
||||
|
||||
@@ -121,19 +121,22 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
|
||||
connect( m_preferences, &Preferences::signalHideDefaultIconChange, m_pref_dialog, &PreferencesDialog::slotHideDefaultIconChange );
|
||||
connect( m_preferences, &Preferences::signalIconTypeChange, m_pref_dialog, &PreferencesDialog::slotIconTypeChange );
|
||||
connect( m_preferences, &Preferences::signalIconDataChange, m_pref_dialog, &PreferencesDialog::slotIconDataChange );
|
||||
connect( m_preferences, &Preferences::signalShowNumberChange, m_pref_dialog, &PreferencesDialog::slotShowNumberChange );
|
||||
connect( m_preferences, &Preferences::signalNumberColorChange, m_pref_dialog, &PreferencesDialog::slotNumberColorChange );
|
||||
connect( m_preferences, &Preferences::signalNumberSizeChange, m_pref_dialog, &PreferencesDialog::slotNumberSizeChange );
|
||||
connect( m_preferences, &Preferences::signalNumberAlignmentChange, m_pref_dialog, &PreferencesDialog::slotNumberAlignmentChange );
|
||||
connect( m_preferences, &Preferences::signalNumberMarginsChange, m_pref_dialog, &PreferencesDialog::slotNumberMarginsChange );
|
||||
connect( m_preferences, &Preferences::signalCountTypeChange, m_pref_dialog, &PreferencesDialog::slotCountTypeChange );
|
||||
connect( m_preferences, &Preferences::signalStartupDelayChange, m_pref_dialog, &PreferencesDialog::slotStartupDelayChange );
|
||||
connect( m_preferences, &Preferences::signalMinimizeTypeChange, m_pref_dialog, &PreferencesDialog::slotMinimizeTypeChange );
|
||||
connect( m_preferences, &Preferences::signalMinimizeIconTypeChange, m_pref_dialog, &PreferencesDialog::slotMinimizeIconTypeChange );
|
||||
connect( m_preferences, &Preferences::signalStartMinimizedChange, m_pref_dialog, &PreferencesDialog::slotStartMinimizedChange );
|
||||
connect( m_preferences, &Preferences::signalRestoreWindowPositionsChange, m_pref_dialog, &PreferencesDialog::slotRestoreWindowPositionsChange );
|
||||
connect( m_preferences, &Preferences::signalCloseTypeChange, m_pref_dialog, &PreferencesDialog::slotCloseTypeChange );
|
||||
connect( m_preferences, &Preferences::signalThemeChange, m_pref_dialog, &PreferencesDialog::slotThemeChange );
|
||||
connect( m_preferences, &Preferences::signalShowNumberChange, m_pref_dialog, &PreferencesDialog::slotShowNumberChange );
|
||||
connect( m_preferences, &Preferences::signalShowNewIndicatorChange, m_pref_dialog, &PreferencesDialog::slotShowNewIndicatorChange );
|
||||
connect( m_preferences, &Preferences::signalStartupDelayChange, m_pref_dialog, &PreferencesDialog::slotStartupDelayChange );
|
||||
connect( m_preferences, &Preferences::signalCountTypeChange, m_pref_dialog, &PreferencesDialog::slotCountTypeChange );
|
||||
connect( m_preferences, &Preferences::signalNumberColorChange, m_pref_dialog, &PreferencesDialog::slotNumberColorChange );
|
||||
connect( m_preferences, &Preferences::signalNumberSizeChange, m_pref_dialog, &PreferencesDialog::slotNumberSizeChange );
|
||||
connect( m_preferences, &Preferences::signalNumberAlignmentChange, m_pref_dialog, &PreferencesDialog::slotNumberAlignmentChange );
|
||||
connect( m_preferences, &Preferences::signalNumberMarginsChange, m_pref_dialog, &PreferencesDialog::slotNumberMarginsChange );
|
||||
connect( m_preferences, &Preferences::signalNewIndicatorTypeChange, m_pref_dialog, &PreferencesDialog::slotNewIndicatorTypeChange );
|
||||
connect( m_preferences, &Preferences::signalNewShadeColorChange, m_pref_dialog, &PreferencesDialog::slotNewShadeColorChange );
|
||||
connect( m_preferences, &Preferences::signalStartAppChange, m_pref_dialog, &PreferencesDialog::slotStartAppChange );
|
||||
connect( m_preferences, &Preferences::signalStartAppArgsChange, m_pref_dialog, &PreferencesDialog::slotStartAppArgsChange );
|
||||
connect( m_preferences, &Preferences::signalCloseAppChange, m_pref_dialog, &PreferencesDialog::slotCloseAppChange );
|
||||
@@ -145,19 +148,22 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
|
||||
connect( m_preferences, &Preferences::signalHideDefaultIconChange, m_link, &SysTrayXLink::slotHideDefaultIconChange );
|
||||
connect( m_preferences, &Preferences::signalIconTypeChange, m_link, &SysTrayXLink::slotIconTypeChange );
|
||||
connect( m_preferences, &Preferences::signalIconDataChange, m_link, &SysTrayXLink::slotIconDataChange );
|
||||
connect( m_preferences, &Preferences::signalShowNumberChange, m_link, &SysTrayXLink::slotShowNumberChange );
|
||||
connect( m_preferences, &Preferences::signalNumberColorChange, m_link, &SysTrayXLink::slotNumberColorChange );
|
||||
connect( m_preferences, &Preferences::signalNumberSizeChange, m_link, &SysTrayXLink::slotNumberSizeChange );
|
||||
connect( m_preferences, &Preferences::signalNumberAlignmentChange, m_link, &SysTrayXLink::slotNumberAlignmentChange );
|
||||
connect( m_preferences, &Preferences::signalNumberMarginsChange, m_link, &SysTrayXLink::slotNumberMarginsChange );
|
||||
connect( m_preferences, &Preferences::signalCountTypeChange, m_link, &SysTrayXLink::slotCountTypeChange );
|
||||
connect( m_preferences, &Preferences::signalMinimizeTypeChange, m_link, &SysTrayXLink::slotMinimizeTypeChange );
|
||||
connect( m_preferences, &Preferences::signalMinimizeIconTypeChange, m_link, &SysTrayXLink::slotMinimizeIconTypeChange );
|
||||
connect( m_preferences, &Preferences::signalStartupDelayChange, m_link, &SysTrayXLink::slotStartupDelayChange );
|
||||
connect( m_preferences, &Preferences::signalStartMinimizedChange, m_link, &SysTrayXLink::slotStartMinimizedChange );
|
||||
connect( m_preferences, &Preferences::signalRestoreWindowPositionsChange, m_link, &SysTrayXLink::slotRestoreWindowPositionsChange );
|
||||
connect( m_preferences, &Preferences::signalCloseTypeChange, m_link, &SysTrayXLink::slotCloseTypeChange );
|
||||
connect( m_preferences, &Preferences::signalThemeChange, m_link, &SysTrayXLink::slotThemeChange );
|
||||
connect( m_preferences, &Preferences::signalShowNumberChange, m_link, &SysTrayXLink::slotShowNumberChange );
|
||||
connect( m_preferences, &Preferences::signalShowNewIndicatorChange, m_link, &SysTrayXLink::slotShowNewIndicatorChange );
|
||||
connect( m_preferences, &Preferences::signalStartupDelayChange, m_link, &SysTrayXLink::slotStartupDelayChange );
|
||||
connect( m_preferences, &Preferences::signalCountTypeChange, m_link, &SysTrayXLink::slotCountTypeChange );
|
||||
connect( m_preferences, &Preferences::signalNumberColorChange, m_link, &SysTrayXLink::slotNumberColorChange );
|
||||
connect( m_preferences, &Preferences::signalNumberSizeChange, m_link, &SysTrayXLink::slotNumberSizeChange );
|
||||
connect( m_preferences, &Preferences::signalNumberAlignmentChange, m_link, &SysTrayXLink::slotNumberAlignmentChange );
|
||||
connect( m_preferences, &Preferences::signalNumberMarginsChange, m_link, &SysTrayXLink::slotNumberMarginsChange );
|
||||
connect( m_preferences, &Preferences::signalNewIndicatorTypeChange, m_link, &SysTrayXLink::slotNewIndicatorTypeChange );
|
||||
connect( m_preferences, &Preferences::signalNewShadeColorChange, m_link, &SysTrayXLink::slotNewShadeColorChange );
|
||||
connect( m_preferences, &Preferences::signalStartAppChange, m_link, &SysTrayXLink::slotStartAppChange );
|
||||
connect( m_preferences, &Preferences::signalStartAppArgsChange, m_link, &SysTrayXLink::slotStartAppArgsChange );
|
||||
connect( m_preferences, &Preferences::signalCloseAppChange, m_link, &SysTrayXLink::slotCloseAppChange );
|
||||
@@ -204,18 +210,14 @@ SysTrayX::SysTrayX( QObject *parent ) : QObject( parent )
|
||||
//slotLoadLanguage( "nl" );
|
||||
//slotLoadLanguage( "pt-BR" );
|
||||
//slotLoadLanguage( "ru" );
|
||||
slotSelectIconObject( false );
|
||||
slotSelectIconObject( true );
|
||||
|
||||
<<<<<<< HEAD
|
||||
slotMailCount( 10, 1 );
|
||||
=======
|
||||
slotSetUnreadMail( 10 );
|
||||
|
||||
m_preferences->setStartApp( "/home/maxime/test.sh" );
|
||||
m_preferences->setStartAppArgs( "/home/maxime/startup.txt StartupString" );
|
||||
slotStartApp();
|
||||
>>>>>>> develop
|
||||
*/
|
||||
// m_preferences->setStartApp( "/home/maxime/test.sh" );
|
||||
// m_preferences->setStartAppArgs( "/home/maxime/startup.txt StartupString" );
|
||||
// slotStartApp();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -321,12 +323,15 @@ void SysTrayX::showTrayIcon()
|
||||
connect( m_preferences, &Preferences::signalDefaultIconDataChange, m_tray_icon, &SysTrayXIcon::slotDefaultIconDataChange );
|
||||
connect( m_preferences, &Preferences::signalIconTypeChange, m_tray_icon, &SysTrayXIcon::slotIconTypeChange );
|
||||
connect( m_preferences, &Preferences::signalIconDataChange, m_tray_icon, &SysTrayXIcon::slotIconDataChange );
|
||||
connect( m_preferences, &Preferences::signalThemeChange, m_tray_icon, &SysTrayXIcon::slotThemeChange );
|
||||
connect( m_preferences, &Preferences::signalShowNumberChange, m_tray_icon, &SysTrayXIcon::slotShowNumberChange );
|
||||
connect( m_preferences, &Preferences::signalShowNewIndicatorChange, m_tray_icon, &SysTrayXIcon::slotShowNewIndicatorChange );
|
||||
connect( m_preferences, &Preferences::signalNumberColorChange, m_tray_icon, &SysTrayXIcon::slotNumberColorChange );
|
||||
connect( m_preferences, &Preferences::signalNumberSizeChange, m_tray_icon, &SysTrayXIcon::slotNumberSizeChange );
|
||||
connect( m_preferences, &Preferences::signalNumberAlignmentChange, m_tray_icon, &SysTrayXIcon::slotNumberAlignmentChange );
|
||||
connect( m_preferences, &Preferences::signalNumberMarginsChange, m_tray_icon, &SysTrayXIcon::slotNumberMarginsChange );
|
||||
connect( m_preferences, &Preferences::signalThemeChange, m_tray_icon, &SysTrayXIcon::slotThemeChange );
|
||||
connect( m_preferences, &Preferences::signalNewIndicatorTypeChange, m_tray_icon, &SysTrayXIcon::slotNewIndicatorTypeChange );
|
||||
connect( m_preferences, &Preferences::signalNewShadeColorChange, m_tray_icon, &SysTrayXIcon::slotNewShadeColorChange );
|
||||
|
||||
connect( m_link, &SysTrayXLink::signalMailCount, m_tray_icon, &SysTrayXIcon::slotMailCount );
|
||||
|
||||
@@ -358,12 +363,15 @@ void SysTrayX::hideTrayIcon()
|
||||
disconnect( m_preferences, &Preferences::signalDefaultIconDataChange, m_tray_icon, &SysTrayXIcon::slotDefaultIconDataChange );
|
||||
disconnect( m_preferences, &Preferences::signalIconTypeChange, m_tray_icon, &SysTrayXIcon::slotIconTypeChange );
|
||||
disconnect( m_preferences, &Preferences::signalIconDataChange, m_tray_icon, &SysTrayXIcon::slotIconDataChange );
|
||||
disconnect( m_preferences, &Preferences::signalThemeChange, m_tray_icon, &SysTrayXIcon::slotThemeChange );
|
||||
disconnect( m_preferences, &Preferences::signalShowNumberChange, m_tray_icon, &SysTrayXIcon::slotShowNumberChange );
|
||||
disconnect( m_preferences, &Preferences::signalShowNewIndicatorChange, m_tray_icon, &SysTrayXIcon::slotShowNewIndicatorChange );
|
||||
disconnect( m_preferences, &Preferences::signalNumberColorChange, m_tray_icon, &SysTrayXIcon::slotNumberColorChange );
|
||||
disconnect( m_preferences, &Preferences::signalNumberSizeChange, m_tray_icon, &SysTrayXIcon::slotNumberSizeChange );
|
||||
disconnect( m_preferences, &Preferences::signalNumberAlignmentChange, m_tray_icon, &SysTrayXIcon::slotNumberAlignmentChange );
|
||||
disconnect( m_preferences, &Preferences::signalNumberMarginsChange, m_tray_icon, &SysTrayXIcon::slotNumberMarginsChange );
|
||||
disconnect( m_preferences, &Preferences::signalThemeChange, m_tray_icon, &SysTrayXIcon::slotThemeChange );
|
||||
disconnect( m_preferences, &Preferences::signalNewIndicatorTypeChange, m_tray_icon, &SysTrayXIcon::slotNewIndicatorTypeChange );
|
||||
disconnect( m_preferences, &Preferences::signalNewShadeColorChange, m_tray_icon, &SysTrayXIcon::slotNewShadeColorChange );
|
||||
|
||||
disconnect( m_link, &SysTrayXLink::signalMailCount, m_tray_icon, &SysTrayXIcon::slotMailCount );
|
||||
|
||||
@@ -433,12 +441,15 @@ void SysTrayX::showKdeTrayIcon()
|
||||
connect( m_preferences, &Preferences::signalHideDefaultIconChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotHideDefaultIconChange );
|
||||
connect( m_preferences, &Preferences::signalIconTypeChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotIconTypeChange );
|
||||
connect( m_preferences, &Preferences::signalIconDataChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotIconDataChange );
|
||||
connect( m_preferences, &Preferences::signalThemeChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotThemeChange );
|
||||
connect( m_preferences, &Preferences::signalShowNumberChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotShowNumberChange );
|
||||
connect( m_preferences, &Preferences::signalShowNewIndicatorChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotShowNewIndicatorChange );
|
||||
connect( m_preferences, &Preferences::signalNumberColorChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotNumberColorChange );
|
||||
connect( m_preferences, &Preferences::signalNumberSizeChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotNumberSizeChange );
|
||||
connect( m_preferences, &Preferences::signalNumberAlignmentChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotNumberAlignmentChange );
|
||||
connect( m_preferences, &Preferences::signalNumberMarginsChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotNumberMarginsChange );
|
||||
connect( m_preferences, &Preferences::signalThemeChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotThemeChange );
|
||||
connect( m_preferences, &Preferences::signalNewIndicatorTypeChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotNewIndicatorTypeChange );
|
||||
connect( m_preferences, &Preferences::signalNewShadeColorChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotNewShadeColorChange );
|
||||
|
||||
connect( m_link, &SysTrayXLink::signalMailCount, m_kde_tray_icon, &SysTrayXStatusNotifier::slotMailCount );
|
||||
|
||||
@@ -469,12 +480,15 @@ void SysTrayX::hideKdeTrayIcon()
|
||||
disconnect( m_preferences, &Preferences::signalHideDefaultIconChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotHideDefaultIconChange );
|
||||
disconnect( m_preferences, &Preferences::signalIconTypeChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotIconTypeChange );
|
||||
disconnect( m_preferences, &Preferences::signalIconDataChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotIconDataChange );
|
||||
disconnect( m_preferences, &Preferences::signalThemeChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotThemeChange );
|
||||
disconnect( m_preferences, &Preferences::signalShowNumberChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotShowNumberChange );
|
||||
disconnect( m_preferences, &Preferences::signalShowNewIndicatorChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotShowNewIndicatorChange );
|
||||
disconnect( m_preferences, &Preferences::signalNumberColorChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotNumberColorChange );
|
||||
disconnect( m_preferences, &Preferences::signalNumberSizeChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotNumberSizeChange );
|
||||
disconnect( m_preferences, &Preferences::signalNumberAlignmentChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotNumberAlignmentChange );
|
||||
disconnect( m_preferences, &Preferences::signalNumberMarginsChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotNumberMarginsChange );
|
||||
disconnect( m_preferences, &Preferences::signalThemeChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotThemeChange );
|
||||
disconnect( m_preferences, &Preferences::signalNewIndicatorTypeChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotNewIndicatorTypeChange );
|
||||
disconnect( m_preferences, &Preferences::signalNewShadeColorChange, m_kde_tray_icon, &SysTrayXStatusNotifier::slotNewShadeColorChange );
|
||||
|
||||
disconnect( m_link, &SysTrayXLink::signalMailCount, m_kde_tray_icon, &SysTrayXStatusNotifier::slotMailCount );
|
||||
|
||||
|
||||
@@ -31,12 +31,18 @@ SysTrayXIcon::SysTrayXIcon( SysTrayXLink* link, Preferences* pref, QObject* pare
|
||||
m_unread_mail = 0;
|
||||
m_new_mail = 0;
|
||||
|
||||
m_pixmap_clean = QPixmap();
|
||||
m_pixmap_count = QPixmap();
|
||||
m_image_indicator = QImage();
|
||||
|
||||
m_show_number = m_pref->getShowNumber();
|
||||
m_show_new_indicator = m_pref->getShowNewIndicator();
|
||||
m_number_color = m_pref->getNumberColor();
|
||||
m_number_size = m_pref->getNumberSize();
|
||||
m_number_alignment = Qt::AlignHCenter | Qt::AlignVCenter;
|
||||
setNumberAlignment( m_pref->getNumberAlignment() );
|
||||
m_number_margins = m_pref->getNumberMargins();
|
||||
m_new_shade_color = m_pref->getNewShadeColor();
|
||||
|
||||
setToolTip( tr( "SysTray-X: Thunderbird add-on companion app" ) );
|
||||
|
||||
@@ -56,6 +62,11 @@ void SysTrayXIcon::setDefaultIconType( Preferences::DefaultIconType icon_type
|
||||
*/
|
||||
m_default_icon_type = icon_type;
|
||||
|
||||
/*
|
||||
* Set base params
|
||||
*/
|
||||
renderBase();
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
@@ -91,6 +102,11 @@ void SysTrayXIcon::setDefaultIconData( const QByteArray& icon_data )
|
||||
*/
|
||||
m_default_icon_data = icon_data;
|
||||
|
||||
/*
|
||||
* Set base params
|
||||
*/
|
||||
renderBase();
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
@@ -111,6 +127,11 @@ void SysTrayXIcon::setIconType( Preferences::IconType icon_type )
|
||||
*/
|
||||
m_icon_type = icon_type;
|
||||
|
||||
/*
|
||||
* Set base params
|
||||
*/
|
||||
renderBase();
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
@@ -146,6 +167,11 @@ void SysTrayXIcon::setIconData( const QByteArray& icon_data )
|
||||
*/
|
||||
m_icon_data = icon_data;
|
||||
|
||||
/*
|
||||
* Set base params
|
||||
*/
|
||||
renderBase();
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
@@ -174,6 +200,26 @@ void SysTrayXIcon::showNumber( bool state )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Enable/disable new indicator
|
||||
*/
|
||||
void SysTrayXIcon::showNewIndicator( bool state )
|
||||
{
|
||||
if( m_show_new_indicator != state )
|
||||
{
|
||||
/*
|
||||
* Store the new value
|
||||
*/
|
||||
m_show_new_indicator = state;
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
renderIcon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set number color
|
||||
*/
|
||||
@@ -276,6 +322,50 @@ void SysTrayXIcon::setNumberMargins( QMargins margins )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the new indicator type
|
||||
*/
|
||||
void SysTrayXIcon::setNewIndicatorType( Preferences::NewIndicatorType new_indicator_type )
|
||||
{
|
||||
if( m_new_indicator_type != new_indicator_type )
|
||||
{
|
||||
/*
|
||||
* Store the new value
|
||||
*/
|
||||
m_new_indicator_type = new_indicator_type;
|
||||
|
||||
/*
|
||||
* Set base params
|
||||
*/
|
||||
renderBase();
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
renderIcon();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set new shade color
|
||||
*/
|
||||
void SysTrayXIcon::setNewShadeColor( const QString& color )
|
||||
{
|
||||
if( m_new_shade_color != color )
|
||||
{
|
||||
/*
|
||||
* Store the new value
|
||||
*/
|
||||
m_new_shade_color = color;
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
renderIcon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the number of unread/new mails
|
||||
*/
|
||||
@@ -297,6 +387,155 @@ void SysTrayXIcon::setMailCount( int unread_mail, int new_mail )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the base for rendering
|
||||
*/
|
||||
void SysTrayXIcon::renderBase()
|
||||
{
|
||||
/*
|
||||
* Set the clean icon
|
||||
*/
|
||||
switch( m_default_icon_type )
|
||||
{
|
||||
case Preferences::PREF_DEFAULT_ICON_DEFAULT:
|
||||
{
|
||||
QString version = m_pref->getBrowserVersion();
|
||||
|
||||
if( version.section( '.', 0, 0 ).toInt() < 115 )
|
||||
{
|
||||
m_pixmap_clean = QPixmap( ":/files/icons/Thunderbird.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pixmap_clean = QPixmap( ":/files/icons/Thunderbird115.png" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_DEFAULT_ICON_HIDE:
|
||||
{
|
||||
m_pixmap_clean = QPixmap();
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_DEFAULT_ICON_CUSTOM:
|
||||
{
|
||||
m_pixmap_clean.loadFromData( m_default_icon_data );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the count icon
|
||||
*/
|
||||
switch( m_icon_type )
|
||||
{
|
||||
case Preferences::PREF_BLANK_ICON:
|
||||
{
|
||||
Preferences::Theme theme = m_pref->getTheme();
|
||||
|
||||
if( theme == Preferences::PREF_THEME_LIGHT )
|
||||
{
|
||||
m_pixmap_count = QPixmap( ":/files/icons/blank-icon.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pixmap_count = QPixmap( ":/files/icons/blank-icon-dark.png" );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_NEWMAIL_ICON:
|
||||
{
|
||||
QIcon new_mail = QIcon::fromTheme("mail-unread", QIcon(":/files/icons/mail-unread.png"));
|
||||
m_pixmap_count = new_mail.pixmap( 256, 256 );
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_CUSTOM_ICON:
|
||||
{
|
||||
m_pixmap_count.loadFromData( m_icon_data );
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_NO_ICON:
|
||||
{
|
||||
QPixmap lookthrough( 256, 256 );
|
||||
lookthrough.fill( Qt::transparent );
|
||||
m_pixmap_count = lookthrough;
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_TB_ICON:
|
||||
{
|
||||
QString version = m_pref->getBrowserVersion();
|
||||
|
||||
if( version.section( '.', 0, 0 ).toInt() < 115 )
|
||||
{
|
||||
m_pixmap_count = QPixmap( ":/files/icons/Thunderbird.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pixmap_count = QPixmap( ":/files/icons/Thunderbird115.png" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the new indicator
|
||||
*/
|
||||
switch( m_pref->getNewIndicatorType() )
|
||||
{
|
||||
case Preferences::PREF_NEW_INDICATOR_ROUND:
|
||||
{
|
||||
m_image_indicator = QImage( ":/files/icons/new-indicator-round.png" );
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_NEW_INDICATOR_STAR:
|
||||
{
|
||||
m_image_indicator = QImage( ":/files/icons/new-indicator-star-close.png" );
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
m_image_indicator = QImage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Shade the pixmap
|
||||
*/
|
||||
void SysTrayXIcon::shade( QPixmap& pixmap )
|
||||
{
|
||||
QPainter painter( &pixmap );
|
||||
painter.setCompositionMode( painter.CompositionMode_Overlay );
|
||||
painter.fillRect( pixmap.rect(), QColor( m_new_shade_color ) );
|
||||
painter.end();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Indicator on the pixmap
|
||||
*/
|
||||
void SysTrayXIcon::indicator( QPixmap& pixmap )
|
||||
{
|
||||
int size_x = pixmap.width() / 2;
|
||||
int size_y = pixmap.width() / 2;
|
||||
QRect topRight( size_x, 0, size_x, size_y );
|
||||
|
||||
QPainter painter( &pixmap );
|
||||
painter.drawImage( topRight, m_image_indicator );
|
||||
painter.end();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set and render the icon in the system tray
|
||||
*/
|
||||
@@ -316,91 +555,22 @@ void SysTrayXIcon::renderIcon()
|
||||
|
||||
if( count > 0 )
|
||||
{
|
||||
switch( m_icon_type )
|
||||
{
|
||||
case Preferences::PREF_BLANK_ICON:
|
||||
{
|
||||
Preferences::Theme theme = m_pref->getTheme();
|
||||
|
||||
if( theme == Preferences::PREF_THEME_LIGHT )
|
||||
{
|
||||
pixmap = QPixmap( ":/files/icons/blank-icon.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
pixmap = QPixmap( ":/files/icons/blank-icon-dark.png" );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_NEWMAIL_ICON:
|
||||
{
|
||||
QIcon new_mail = QIcon::fromTheme("mail-unread", QIcon(":/files/icons/mail-unread.png"));
|
||||
pixmap = new_mail.pixmap( 256, 256 );
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_CUSTOM_ICON:
|
||||
{
|
||||
pixmap.loadFromData( m_icon_data );
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_NO_ICON:
|
||||
{
|
||||
QPixmap lookthrough( 256, 256 );
|
||||
lookthrough.fill( Qt::transparent );
|
||||
pixmap = lookthrough;
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_TB_ICON:
|
||||
{
|
||||
QString version = m_pref->getBrowserVersion();
|
||||
|
||||
if( version.section( '.', 0, 0 ).toInt() < 115 )
|
||||
{
|
||||
pixmap = QPixmap( ":/files/icons/Thunderbird.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
pixmap = QPixmap( ":/files/icons/Thunderbird115.png" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
pixmap = m_pixmap_count;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch( m_default_icon_type )
|
||||
pixmap = m_pixmap_clean;
|
||||
}
|
||||
|
||||
if( m_show_new_indicator && m_new_mail > 0 )
|
||||
{
|
||||
if( m_pref->getNewIndicatorType() == Preferences::PREF_NEW_INDICATOR_SHADE )
|
||||
{
|
||||
case Preferences::PREF_DEFAULT_ICON_DEFAULT:
|
||||
{
|
||||
QString version = m_pref->getBrowserVersion();
|
||||
|
||||
if( version.section( '.', 0, 0 ).toInt() < 115 )
|
||||
{
|
||||
pixmap = QPixmap( ":/files/icons/Thunderbird.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
pixmap = QPixmap( ":/files/icons/Thunderbird115.png" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_DEFAULT_ICON_HIDE:
|
||||
{
|
||||
pixmap = QPixmap();
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_DEFAULT_ICON_CUSTOM:
|
||||
{
|
||||
pixmap.loadFromData( m_default_icon_data );
|
||||
break;
|
||||
}
|
||||
shade( pixmap );
|
||||
}
|
||||
else
|
||||
{
|
||||
indicator( pixmap );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -485,7 +655,16 @@ void SysTrayXIcon::slotIconDataChange()
|
||||
|
||||
|
||||
/*
|
||||
* Handle the enable number state change signal
|
||||
* Handle the theme change signal
|
||||
*/
|
||||
void SysTrayXIcon::slotThemeChange()
|
||||
{
|
||||
renderIcon();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the show number state change signal
|
||||
*/
|
||||
void SysTrayXIcon::slotShowNumberChange()
|
||||
{
|
||||
@@ -493,6 +672,15 @@ void SysTrayXIcon::slotShowNumberChange()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the show new indicator state change signal
|
||||
*/
|
||||
void SysTrayXIcon::slotShowNewIndicatorChange()
|
||||
{
|
||||
showNewIndicator( m_pref->getShowNewIndicator() );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the number color change signal
|
||||
*/
|
||||
@@ -530,11 +718,20 @@ void SysTrayXIcon::slotNumberMarginsChange()
|
||||
|
||||
|
||||
/*
|
||||
* Handle the theme change signal
|
||||
* Handle the new indicator type change signal
|
||||
*/
|
||||
void SysTrayXIcon::slotThemeChange()
|
||||
void SysTrayXIcon::slotNewIndicatorTypeChange()
|
||||
{
|
||||
renderIcon();
|
||||
setNewIndicatorType( m_pref->getNewIndicatorType() );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the new shade color change signal
|
||||
*/
|
||||
void SysTrayXIcon::slotNewShadeColorChange()
|
||||
{
|
||||
setNewShadeColor( m_pref->getNewShadeColor() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -82,6 +82,13 @@ class SysTrayXIcon : public QSystemTrayIcon
|
||||
*/
|
||||
void showNumber( bool state );
|
||||
|
||||
/**
|
||||
* @brief showNewIndicator. Set the show new indicator state.
|
||||
*
|
||||
* @param state Show / hide.
|
||||
*/
|
||||
void showNewIndicator( bool state );
|
||||
|
||||
/**
|
||||
* @brief setNumberColor. Set the number color.
|
||||
*
|
||||
@@ -110,6 +117,20 @@ class SysTrayXIcon : public QSystemTrayIcon
|
||||
*/
|
||||
void setNumberMargins( QMargins margins );
|
||||
|
||||
/**
|
||||
* @brief setNewShadeColor. Set the new shade color.
|
||||
*
|
||||
* @param color The color.
|
||||
*/
|
||||
void setNewShadeColor( const QString& color );
|
||||
|
||||
/**
|
||||
* @brief setNewIndicatorType. Set the new indicator type.
|
||||
*
|
||||
* @param new_indicator_type The new indicator type
|
||||
*/
|
||||
void setNewIndicatorType( Preferences::NewIndicatorType new_indicator_type );
|
||||
|
||||
/**
|
||||
* @brief setMailCount. Set the number of unread/new mails.
|
||||
*
|
||||
@@ -121,7 +142,26 @@ class SysTrayXIcon : public QSystemTrayIcon
|
||||
private:
|
||||
|
||||
/**
|
||||
* @brief setIcon. Set a new rendered icon.
|
||||
* @brief renderBase. Set the base pixmaps for the icon.
|
||||
*/
|
||||
void renderBase();
|
||||
|
||||
/**
|
||||
* @brief shade. Shade the icon.
|
||||
*
|
||||
* @param pixmap Pixmap to shade.
|
||||
*/
|
||||
void shade( QPixmap& pixmap );
|
||||
|
||||
/**
|
||||
* @brief indicator. Set the new mail indicator.
|
||||
*
|
||||
* @param pixmap Pixmap to put the indicator on.
|
||||
*/
|
||||
void indicator( QPixmap& pixmap );
|
||||
|
||||
/**
|
||||
* @brief renderIcon. Render the icon.
|
||||
*/
|
||||
void renderIcon();
|
||||
|
||||
@@ -162,11 +202,21 @@ class SysTrayXIcon : public QSystemTrayIcon
|
||||
*/
|
||||
void slotIconDataChange();
|
||||
|
||||
/**
|
||||
* @brief slotThemeChange. Slot for handling theme change signals.
|
||||
*/
|
||||
void slotThemeChange();
|
||||
|
||||
/**
|
||||
* @brief slotShowNumberChange. Slot for handling show number change signals.
|
||||
*/
|
||||
void slotShowNumberChange();
|
||||
|
||||
/**
|
||||
* @brief slotShowNewIndicatorChange. Slot for handling show new indicator change signals.
|
||||
*/
|
||||
void slotShowNewIndicatorChange();
|
||||
|
||||
/**
|
||||
* @brief slotNumberColorChange. Slot for handling number color change signals.
|
||||
*/
|
||||
@@ -188,9 +238,14 @@ class SysTrayXIcon : public QSystemTrayIcon
|
||||
void slotNumberMarginsChange();
|
||||
|
||||
/**
|
||||
* @brief slotThemeChange. Slot for handling theme change signals.
|
||||
* @brief slotNewIndicatorTypeChange. Slot for handling new indicator type change signals.
|
||||
*/
|
||||
void slotThemeChange();
|
||||
void slotNewIndicatorTypeChange();
|
||||
|
||||
/**
|
||||
* @brief slotNewShadeColorChange. Slot for handling new shade color change signals.
|
||||
*/
|
||||
void slotNewShadeColorChange();
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -213,6 +268,21 @@ class SysTrayXIcon : public QSystemTrayIcon
|
||||
*/
|
||||
Preferences* m_pref;
|
||||
|
||||
/**
|
||||
* @brief m_pixmap_count Pixmap to be used when counting.
|
||||
*/
|
||||
QPixmap m_pixmap_count;
|
||||
|
||||
/**
|
||||
* @brief m_pixmap_clean Pixmap to be used when there is no new mail.
|
||||
*/
|
||||
QPixmap m_pixmap_clean;
|
||||
|
||||
/**
|
||||
* @brief m_image_indicator Image to be used as new mail indicator.
|
||||
*/
|
||||
QImage m_image_indicator;
|
||||
|
||||
/**
|
||||
* @brief m_default_icon_type. Storage for the default icon type.
|
||||
*/
|
||||
@@ -248,6 +318,11 @@ class SysTrayXIcon : public QSystemTrayIcon
|
||||
*/
|
||||
bool m_show_number;
|
||||
|
||||
/**
|
||||
* @brief m_show_new_indicator. Show the new indicator.
|
||||
*/
|
||||
bool m_show_new_indicator;
|
||||
|
||||
/**
|
||||
* @brief m_number_color. Color of the unread/new mail number.
|
||||
*/
|
||||
@@ -268,6 +343,17 @@ class SysTrayXIcon : public QSystemTrayIcon
|
||||
*/
|
||||
QMargins m_number_margins;
|
||||
|
||||
/**
|
||||
* @brief m_new_indicator_type. Storage for the new indicator type.
|
||||
*/
|
||||
Preferences::NewIndicatorType m_new_indicator_type;
|
||||
|
||||
|
||||
/**
|
||||
* @brief m_new_shade_color. Color of the new shade.
|
||||
*/
|
||||
QString m_new_shade_color;
|
||||
|
||||
/**
|
||||
* @brief m_unread_mail. Storage for the number of unread mails.
|
||||
*/
|
||||
|
||||
@@ -691,6 +691,16 @@ void SysTrayXLink::DecodePreferences( const QJsonObject& pref )
|
||||
m_pref->setShowNumber( show_number );
|
||||
}
|
||||
|
||||
if( pref.contains( "showNewIndicator" ) && pref[ "showNewIndicator" ].isString() )
|
||||
{
|
||||
bool show_new_indicator = pref[ "showNewIndicator" ].toString() == "true";
|
||||
|
||||
/*
|
||||
* Store the new show new indicator state
|
||||
*/
|
||||
m_pref->setShowNewIndicator( show_new_indicator );
|
||||
}
|
||||
|
||||
if( pref.contains( "numberColor" ) && pref[ "numberColor" ].isString() )
|
||||
{
|
||||
QString number_color = pref[ "numberColor" ].toString();
|
||||
@@ -915,7 +925,9 @@ void SysTrayXLink::EncodePreferences( const Preferences& pref )
|
||||
prefObject.insert("iconType", QJsonValue::fromVariant( QString::number( pref.getIconType() ) ) );
|
||||
prefObject.insert("iconMime", QJsonValue::fromVariant( pref.getIconMime() ) );
|
||||
prefObject.insert("icon", QJsonValue::fromVariant( QString( pref.getIconData().toBase64() ) ) );
|
||||
prefObject.insert("theme", QJsonValue::fromVariant( QString::number( pref.getTheme() ) ) );
|
||||
prefObject.insert("showNumber", QJsonValue::fromVariant( QString( pref.getShowNumber() ? "true" : "false" ) ) );
|
||||
prefObject.insert("showNewIndicator", QJsonValue::fromVariant( QString( pref.getShowNewIndicator() ? "true" : "false" ) ) );
|
||||
prefObject.insert("numberColor", QJsonValue::fromVariant( QString( pref.getNumberColor() ) ) );
|
||||
prefObject.insert("numberSize", QJsonValue::fromVariant( QString::number( pref.getNumberSize() ) ) );
|
||||
prefObject.insert("numberAlignment", QJsonValue::fromVariant( QString::number( pref.getNumberAlignment() ) ) );
|
||||
@@ -929,7 +941,6 @@ void SysTrayXLink::EncodePreferences( const Preferences& pref )
|
||||
prefObject.insert("numberMargins", marginsObject );
|
||||
prefObject.insert("countType", QJsonValue::fromVariant( QString::number( pref.getCountType() ) ) );
|
||||
prefObject.insert("startupDelay", QJsonValue::fromVariant( QString::number( pref.getStartupDelay() ) ) );
|
||||
prefObject.insert("theme", QJsonValue::fromVariant( QString::number( pref.getTheme() ) ) );
|
||||
|
||||
prefObject.insert("startApp", QJsonValue::fromVariant( pref.getStartApp() ) );
|
||||
prefObject.insert("startAppArgs", QJsonValue::fromVariant( pref.getStartAppArgs() ) );
|
||||
@@ -968,9 +979,18 @@ void SysTrayXLink::slotLinkRead( QByteArray message )
|
||||
|
||||
|
||||
/*
|
||||
* Handle a debug state change signal
|
||||
* Handle a positions change signal
|
||||
*/
|
||||
void SysTrayXLink::slotDebugChange()
|
||||
void SysTrayXLink::slotPositions( QList< QPoint > positions )
|
||||
{
|
||||
sendPositions( positions );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle a restore window positions state change signal
|
||||
*/
|
||||
void SysTrayXLink::slotRestoreWindowPositionsChange()
|
||||
{
|
||||
if( m_pref->getAppPrefChanged() )
|
||||
{
|
||||
@@ -1015,18 +1035,6 @@ void SysTrayXLink::slotStartMinimizedChange()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle a restore window positions state change signal
|
||||
*/
|
||||
void SysTrayXLink::slotRestoreWindowPositionsChange()
|
||||
{
|
||||
if( m_pref->getAppPrefChanged() )
|
||||
{
|
||||
sendPreferences();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle a close type change signal
|
||||
*/
|
||||
@@ -1099,6 +1107,18 @@ void SysTrayXLink::slotIconDataChange()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle a theme change signal
|
||||
*/
|
||||
void SysTrayXLink::slotThemeChange()
|
||||
{
|
||||
if( m_pref->getAppPrefChanged() )
|
||||
{
|
||||
sendPreferences();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle a show number state change signal
|
||||
*/
|
||||
@@ -1111,6 +1131,42 @@ void SysTrayXLink::slotShowNumberChange()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle a show new indicator state change signal
|
||||
*/
|
||||
void SysTrayXLink::slotShowNewIndicatorChange()
|
||||
{
|
||||
if( m_pref->getAppPrefChanged() )
|
||||
{
|
||||
sendPreferences();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the count type change signal
|
||||
*/
|
||||
void SysTrayXLink::slotCountTypeChange()
|
||||
{
|
||||
if( m_pref->getAppPrefChanged() )
|
||||
{
|
||||
sendPreferences();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle a startup delay change signal
|
||||
*/
|
||||
void SysTrayXLink::slotStartupDelayChange()
|
||||
{
|
||||
if( m_pref->getAppPrefChanged() )
|
||||
{
|
||||
sendPreferences();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle a number color change signal
|
||||
*/
|
||||
@@ -1160,9 +1216,9 @@ void SysTrayXLink::slotNumberMarginsChange()
|
||||
|
||||
|
||||
/*
|
||||
* Handle the count type change signal
|
||||
* Handle the new indicator type change signal
|
||||
*/
|
||||
void SysTrayXLink::slotCountTypeChange()
|
||||
void SysTrayXLink::slotNewIndicatorTypeChange()
|
||||
{
|
||||
if( m_pref->getAppPrefChanged() )
|
||||
{
|
||||
@@ -1172,30 +1228,9 @@ void SysTrayXLink::slotCountTypeChange()
|
||||
|
||||
|
||||
/*
|
||||
* Handle a startup delay change signal
|
||||
* Handle the new shade color change signal
|
||||
*/
|
||||
void SysTrayXLink::slotStartupDelayChange()
|
||||
{
|
||||
if( m_pref->getAppPrefChanged() )
|
||||
{
|
||||
sendPreferences();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle a positions change signal
|
||||
*/
|
||||
void SysTrayXLink::slotPositions( QList< QPoint > positions )
|
||||
{
|
||||
sendPositions( positions );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle a theme change signal
|
||||
*/
|
||||
void SysTrayXLink::slotThemeChange()
|
||||
void SysTrayXLink::slotNewShadeColorChange()
|
||||
{
|
||||
if( m_pref->getAppPrefChanged() )
|
||||
{
|
||||
@@ -1250,3 +1285,15 @@ void SysTrayXLink::slotCloseAppArgsChange()
|
||||
sendPreferences();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle a debug state change signal
|
||||
*/
|
||||
void SysTrayXLink::slotDebugChange()
|
||||
{
|
||||
if( m_pref->getAppPrefChanged() )
|
||||
{
|
||||
sendPreferences();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,6 +259,16 @@ class SysTrayXLink : public QObject
|
||||
*/
|
||||
void slotDebugChange();
|
||||
|
||||
/**
|
||||
* @brief slotPositions. Slot for handling a window positions change.
|
||||
*/
|
||||
void slotPositions( QList< QPoint > positions );
|
||||
|
||||
/**
|
||||
* @brief slotRestoreWindowPositionsChange. Handle a change in restore window positions state.
|
||||
*/
|
||||
void slotRestoreWindowPositionsChange();
|
||||
|
||||
/**
|
||||
* @brief slotMinimizeTypeChange. Slot for handling minimize type change signals.
|
||||
*/
|
||||
@@ -274,11 +284,6 @@ class SysTrayXLink : public QObject
|
||||
*/
|
||||
void slotStartMinimizedChange();
|
||||
|
||||
/**
|
||||
* @brief slotRestoreWindowPositionsChange. Handle a change in restore window positions state.
|
||||
*/
|
||||
void slotRestoreWindowPositionsChange();
|
||||
|
||||
/**
|
||||
* @brief slotCloseTypeChange. Slot for handling close type change signals.
|
||||
*/
|
||||
@@ -309,11 +314,31 @@ class SysTrayXLink : public QObject
|
||||
*/
|
||||
void slotIconDataChange();
|
||||
|
||||
/**
|
||||
* @brief slotThemeChange. Slot for handling theme change signals.
|
||||
*/
|
||||
void slotThemeChange();
|
||||
|
||||
/**
|
||||
* @brief slotShowNumberChange. Handle a change in show number state.
|
||||
*/
|
||||
void slotShowNumberChange();
|
||||
|
||||
/**
|
||||
* @brief slotShowNewIndicatorChange. Handle a change in show new indicator state.
|
||||
*/
|
||||
void slotShowNewIndicatorChange();
|
||||
|
||||
/**
|
||||
* @brief slotCountTypeChange. Slot for handling count type change signals.
|
||||
*/
|
||||
void slotCountTypeChange();
|
||||
|
||||
/**
|
||||
* @brief slotStartupDelayChange. Handle a change in startup delay.
|
||||
*/
|
||||
void slotStartupDelayChange();
|
||||
|
||||
/**
|
||||
* @brief slotNumberColorChange. Handle a change in number color.
|
||||
*/
|
||||
@@ -335,24 +360,14 @@ class SysTrayXLink : public QObject
|
||||
void slotNumberMarginsChange();
|
||||
|
||||
/**
|
||||
* @brief slotCountTypeChange. Slot for handling count type change signals.
|
||||
* @brief slotNewIndicatorTypeChange. Slot for handling new indicator type change signals.
|
||||
*/
|
||||
void slotCountTypeChange();
|
||||
void slotNewIndicatorTypeChange();
|
||||
|
||||
/**
|
||||
* @brief slotStartupDelayChange. Handle a change in startup delay.
|
||||
* @brief slotNewShadeColorChange. Handle a change in new shade color.
|
||||
*/
|
||||
void slotStartupDelayChange();
|
||||
|
||||
/**
|
||||
* @brief slotPositions. Slot for handling a window positions change.
|
||||
*/
|
||||
void slotPositions( QList< QPoint > positions );
|
||||
|
||||
/**
|
||||
* @brief slotThemeChange. Slot for handling theme change signals.
|
||||
*/
|
||||
void slotThemeChange();
|
||||
void slotNewShadeColorChange();
|
||||
|
||||
/**
|
||||
* @brief slotStartAppChange. Slot for handling start application change signals.
|
||||
|
||||
@@ -36,12 +36,18 @@ SysTrayXStatusNotifier::SysTrayXStatusNotifier( SysTrayXLink* link, Preferences*
|
||||
m_unread_mail = 0;
|
||||
m_new_mail = 0;
|
||||
|
||||
m_pixmap_clean = QPixmap();
|
||||
m_pixmap_count = QPixmap();
|
||||
m_image_indicator = QImage();
|
||||
|
||||
m_show_number = m_pref->getShowNumber();
|
||||
m_show_new_indicator = m_pref->getShowNewIndicator();
|
||||
m_number_color = m_pref->getNumberColor();
|
||||
m_number_size = m_pref->getNumberSize();
|
||||
m_number_alignment = Qt::AlignHCenter | Qt::AlignVCenter;
|
||||
setNumberAlignment( m_pref->getNumberAlignment() );
|
||||
m_number_margins = m_pref->getNumberMargins();
|
||||
m_new_shade_color = m_pref->getNewShadeColor();
|
||||
|
||||
/*
|
||||
* Setup notifier
|
||||
@@ -87,6 +93,11 @@ void SysTrayXStatusNotifier::setDefaultIconType( Preferences::DefaultIconType
|
||||
*/
|
||||
m_default_icon_type = icon_type;
|
||||
|
||||
/*
|
||||
* Set base params
|
||||
*/
|
||||
renderBase();
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
@@ -122,6 +133,11 @@ void SysTrayXStatusNotifier::setDefaultIconData( const QByteArray& icon_data
|
||||
*/
|
||||
m_default_icon_data = icon_data;
|
||||
|
||||
/*
|
||||
* Set base params
|
||||
*/
|
||||
renderBase();
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
@@ -157,6 +173,11 @@ void SysTrayXStatusNotifier::setIconType( Preferences::IconType icon_type )
|
||||
*/
|
||||
m_icon_type = icon_type;
|
||||
|
||||
/*
|
||||
* Set base params
|
||||
*/
|
||||
renderBase();
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
@@ -192,6 +213,11 @@ void SysTrayXStatusNotifier::setIconData( const QByteArray& icon_data )
|
||||
*/
|
||||
m_icon_data = icon_data;
|
||||
|
||||
/*
|
||||
* Set base params
|
||||
*/
|
||||
renderBase();
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
@@ -220,6 +246,26 @@ void SysTrayXStatusNotifier::showNumber( bool state )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Enable/disable new indicator
|
||||
*/
|
||||
void SysTrayXStatusNotifier::showNewIndicator( bool state )
|
||||
{
|
||||
if( m_show_new_indicator != state )
|
||||
{
|
||||
/*
|
||||
* Store the new value
|
||||
*/
|
||||
m_show_new_indicator = state;
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
renderIcon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set number color
|
||||
*/
|
||||
@@ -322,6 +368,51 @@ void SysTrayXStatusNotifier::setNumberMargins( QMargins margins )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the new indicator type
|
||||
*/
|
||||
void SysTrayXStatusNotifier::setNewIndicatorType( Preferences::NewIndicatorType new_indicator_type )
|
||||
{
|
||||
if( m_new_indicator_type != new_indicator_type )
|
||||
{
|
||||
/*
|
||||
* Store the new value
|
||||
*/
|
||||
m_new_indicator_type = new_indicator_type;
|
||||
|
||||
/*
|
||||
* Set base params
|
||||
*/
|
||||
renderBase();
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
renderIcon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set new shade color
|
||||
*/
|
||||
void SysTrayXStatusNotifier::setNewShadeColor( const QString& color )
|
||||
{
|
||||
if( m_new_shade_color != color )
|
||||
{
|
||||
/*
|
||||
* Store the new value
|
||||
*/
|
||||
m_new_shade_color = color;
|
||||
|
||||
/*
|
||||
* Render and set a new icon in the tray
|
||||
*/
|
||||
renderIcon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the number of unread/new mails
|
||||
*/
|
||||
@@ -343,6 +434,154 @@ void SysTrayXStatusNotifier::setMailCount( int unread_mail, int new_mail )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the base for rendering
|
||||
*/
|
||||
void SysTrayXStatusNotifier::renderBase()
|
||||
{
|
||||
/*
|
||||
* Set the clean icon
|
||||
*/
|
||||
switch( m_default_icon_type )
|
||||
{
|
||||
case Preferences::PREF_DEFAULT_ICON_DEFAULT:
|
||||
{
|
||||
QString version = m_pref->getBrowserVersion();
|
||||
|
||||
if( version.section( '.', 0, 0 ).toInt() < 115 )
|
||||
{
|
||||
m_pixmap_clean = QPixmap( ":/files/icons/Thunderbird.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pixmap_clean = QPixmap( ":/files/icons/Thunderbird115.png" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_DEFAULT_ICON_HIDE:
|
||||
{
|
||||
m_pixmap_clean = QPixmap();
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_DEFAULT_ICON_CUSTOM:
|
||||
{
|
||||
m_pixmap_clean.loadFromData( m_default_icon_data );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the count icon
|
||||
*/
|
||||
switch( m_icon_type )
|
||||
{
|
||||
case Preferences::PREF_BLANK_ICON:
|
||||
{
|
||||
Preferences::Theme theme = m_pref->getTheme();
|
||||
|
||||
if( theme == Preferences::PREF_THEME_LIGHT )
|
||||
{
|
||||
m_pixmap_count = QPixmap( ":/files/icons/blank-icon.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pixmap_count = QPixmap( ":/files/icons/blank-icon-dark.png" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_NEWMAIL_ICON:
|
||||
{
|
||||
QIcon new_mail = QIcon::fromTheme("mail-unread", QIcon(":/files/icons/mail-unread.png"));
|
||||
m_pixmap_count = new_mail.pixmap( 256, 256 );
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_CUSTOM_ICON:
|
||||
{
|
||||
m_pixmap_count.loadFromData( m_icon_data );
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_NO_ICON:
|
||||
{
|
||||
QPixmap lookthrough( 256, 256 );
|
||||
lookthrough.fill( Qt::transparent );
|
||||
m_pixmap_count = lookthrough;
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_TB_ICON:
|
||||
{
|
||||
QString version = m_pref->getBrowserVersion();
|
||||
|
||||
if( version.section( '.', 0, 0 ).toInt() < 115 )
|
||||
{
|
||||
m_pixmap_count = QPixmap( ":/files/icons/Thunderbird.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pixmap_count = QPixmap( ":/files/icons/Thunderbird115.png" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the new indicator
|
||||
*/
|
||||
switch( m_new_indicator_type )
|
||||
{
|
||||
case Preferences::PREF_NEW_INDICATOR_ROUND:
|
||||
{
|
||||
m_image_indicator = QImage( ":/files/icons/new-indicator-round.png" );
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_NEW_INDICATOR_STAR:
|
||||
{
|
||||
m_image_indicator = QImage( ":/files/icons/new-indicator-star-close.png" );
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
m_image_indicator = QImage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Shade the pixmap
|
||||
*/
|
||||
void SysTrayXStatusNotifier::shade( QPixmap& pixmap )
|
||||
{
|
||||
QPainter painter( &pixmap );
|
||||
painter.setCompositionMode( painter.CompositionMode_Overlay );
|
||||
painter.fillRect( pixmap.rect(), QColor( m_new_shade_color ) );
|
||||
painter.end();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Indicator on the pixmap
|
||||
*/
|
||||
void SysTrayXStatusNotifier::indicator( QPixmap& pixmap )
|
||||
{
|
||||
int size_x = pixmap.width() / 2;
|
||||
int size_y = pixmap.width() / 2;
|
||||
QRect topRight( size_x, 0, size_x, size_y );
|
||||
|
||||
QPainter painter( &pixmap );
|
||||
painter.drawImage( topRight, m_image_indicator );
|
||||
painter.end();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set and render the icon in the system tray
|
||||
*/
|
||||
@@ -362,90 +601,22 @@ void SysTrayXStatusNotifier::renderIcon()
|
||||
|
||||
if( count > 0 )
|
||||
{
|
||||
switch( m_icon_type )
|
||||
{
|
||||
case Preferences::PREF_BLANK_ICON:
|
||||
{
|
||||
Preferences::Theme theme = m_pref->getTheme();
|
||||
|
||||
if( theme == Preferences::PREF_THEME_LIGHT )
|
||||
{
|
||||
pixmap = QPixmap( ":/files/icons/blank-icon.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
pixmap = QPixmap( ":/files/icons/blank-icon-dark.png" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_NEWMAIL_ICON:
|
||||
{
|
||||
QIcon new_mail = QIcon::fromTheme("mail-unread", QIcon(":/files/icons/mail-unread.png"));
|
||||
pixmap = new_mail.pixmap( 256, 256 );
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_CUSTOM_ICON:
|
||||
{
|
||||
pixmap.loadFromData( m_icon_data );
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_NO_ICON:
|
||||
{
|
||||
QPixmap lookthrough( 256, 256 );
|
||||
lookthrough.fill( Qt::transparent );
|
||||
pixmap = lookthrough;
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_TB_ICON:
|
||||
{
|
||||
QString version = m_pref->getBrowserVersion();
|
||||
|
||||
if( version.section( '.', 0, 0 ).toInt() < 115 )
|
||||
{
|
||||
pixmap = QPixmap( ":/files/icons/Thunderbird.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
pixmap = QPixmap( ":/files/icons/Thunderbird115.png" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
pixmap = m_pixmap_count;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch( m_default_icon_type )
|
||||
pixmap = m_pixmap_clean;
|
||||
}
|
||||
|
||||
if( m_show_new_indicator && m_new_mail > 0 )
|
||||
{
|
||||
if( m_pref->getNewIndicatorType() == Preferences::PREF_NEW_INDICATOR_SHADE )
|
||||
{
|
||||
case Preferences::PREF_DEFAULT_ICON_DEFAULT:
|
||||
{
|
||||
QString version = m_pref->getBrowserVersion();
|
||||
|
||||
if( version.section( '.', 0, 0 ).toInt() < 115 )
|
||||
{
|
||||
pixmap = QPixmap( ":/files/icons/Thunderbird.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
pixmap = QPixmap( ":/files/icons/Thunderbird115.png" );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_DEFAULT_ICON_HIDE:
|
||||
{
|
||||
pixmap = QPixmap();
|
||||
break;
|
||||
}
|
||||
|
||||
case Preferences::PREF_DEFAULT_ICON_CUSTOM:
|
||||
{
|
||||
pixmap.loadFromData( m_default_icon_data );
|
||||
break;
|
||||
}
|
||||
shade( pixmap );
|
||||
}
|
||||
else
|
||||
{
|
||||
indicator( pixmap );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -560,7 +731,16 @@ void SysTrayXStatusNotifier::slotIconDataChange()
|
||||
|
||||
|
||||
/*
|
||||
* Handle the enable number state change signal
|
||||
* Handle the theme change signal
|
||||
*/
|
||||
void SysTrayXStatusNotifier::slotThemeChange()
|
||||
{
|
||||
renderIcon();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the show number state change signal
|
||||
*/
|
||||
void SysTrayXStatusNotifier::slotShowNumberChange()
|
||||
{
|
||||
@@ -568,6 +748,15 @@ void SysTrayXStatusNotifier::slotShowNumberChange()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the show new indicator state change signal
|
||||
*/
|
||||
void SysTrayXStatusNotifier::slotShowNewIndicatorChange()
|
||||
{
|
||||
showNewIndicator( m_pref->getShowNewIndicator() );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the number color change signal
|
||||
*/
|
||||
@@ -605,11 +794,20 @@ void SysTrayXStatusNotifier::slotNumberMarginsChange()
|
||||
|
||||
|
||||
/*
|
||||
* Handle the theme change signal
|
||||
* Handle the new indicator type change signal
|
||||
*/
|
||||
void SysTrayXStatusNotifier::slotThemeChange()
|
||||
void SysTrayXStatusNotifier::slotNewIndicatorTypeChange()
|
||||
{
|
||||
renderIcon();
|
||||
setNewIndicatorType( m_pref->getNewIndicatorType() );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the new shade color change signal
|
||||
*/
|
||||
void SysTrayXStatusNotifier::slotNewShadeColorChange()
|
||||
{
|
||||
setNewShadeColor( m_pref->getNewShadeColor() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
* Qt includes
|
||||
*/
|
||||
#include <KStatusNotifierItem>
|
||||
#include <QImage>
|
||||
#include <QPixmap>
|
||||
|
||||
/*
|
||||
* Predefines
|
||||
@@ -93,6 +95,13 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
|
||||
*/
|
||||
void showNumber( bool state );
|
||||
|
||||
/**
|
||||
* @brief showNewIndicator. Set the show new indicator state.
|
||||
*
|
||||
* @param state Show / hide.
|
||||
*/
|
||||
void showNewIndicator( bool state );
|
||||
|
||||
/**
|
||||
* @brief setNumberColor. Set the number color.
|
||||
*
|
||||
@@ -121,6 +130,20 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
|
||||
*/
|
||||
void setNumberMargins( QMargins margins );
|
||||
|
||||
/**
|
||||
* @brief setNewIndicatorType. Set the new indicator type.
|
||||
*
|
||||
* @param new_indicator_type The new indicator type.
|
||||
*/
|
||||
void setNewIndicatorType( Preferences::NewIndicatorType new_indicator_type );
|
||||
|
||||
/**
|
||||
* @brief setNewShadeColor. Set the new shade color.
|
||||
*
|
||||
* @param color The color.
|
||||
*/
|
||||
void setNewShadeColor( const QString& color );
|
||||
|
||||
/**
|
||||
* @brief setMailCount. Set the number of unread/new mails.
|
||||
*
|
||||
@@ -131,6 +154,25 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* @brief renderBase. Set the base pixmaps for the icon.
|
||||
*/
|
||||
void renderBase();
|
||||
|
||||
/**
|
||||
* @brief shade. Shade a pixmap
|
||||
*
|
||||
* @param pixmap Pixmap to shade.
|
||||
*/
|
||||
void shade( QPixmap& pixmap );
|
||||
|
||||
/**
|
||||
* @brief indicator. Add a new indicator to the icon.
|
||||
*
|
||||
* @param pixmap Pixmap to alter.
|
||||
*/
|
||||
void indicator( QPixmap& pixmap );
|
||||
|
||||
/**
|
||||
* @brief setIcon. Set a new rendered icon.
|
||||
*/
|
||||
@@ -183,11 +225,21 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
|
||||
*/
|
||||
void slotIconDataChange();
|
||||
|
||||
/**
|
||||
* @brief slotThemeChange. Slot for handling theme change signals.
|
||||
*/
|
||||
void slotThemeChange();
|
||||
|
||||
/**
|
||||
* @brief slotShowNumberChange. Slot for handling show number change signals.
|
||||
*/
|
||||
void slotShowNumberChange();
|
||||
|
||||
/**
|
||||
* @brief slotShowNewIndicatorChange. Slot for handling show new indicator change signals.
|
||||
*/
|
||||
void slotShowNewIndicatorChange();
|
||||
|
||||
/**
|
||||
* @brief slotNumberColorChange. Slot for handling number color change signals.
|
||||
*/
|
||||
@@ -209,9 +261,14 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
|
||||
void slotNumberMarginsChange();
|
||||
|
||||
/**
|
||||
* @brief slotThemeChange. Slot for handling theme change signals.
|
||||
* @brief slotNewIndicatorTypeChange. Slot for handling new indicator type change signals.
|
||||
*/
|
||||
void slotThemeChange();
|
||||
void slotNewIndicatorTypeChange();
|
||||
|
||||
/**
|
||||
* @brief slotNewShadeColorChange. Slot for handling new shade color change signals.
|
||||
*/
|
||||
void slotNewShadeColorChange();
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -242,6 +299,21 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
|
||||
*/
|
||||
Preferences* m_pref;
|
||||
|
||||
/**
|
||||
* @brief m_pixmap_count Pixmap to be used when counting.
|
||||
*/
|
||||
QPixmap m_pixmap_count;
|
||||
|
||||
/**
|
||||
* @brief m_pixmap_clean Pixmap to be used when there is no new mail.
|
||||
*/
|
||||
QPixmap m_pixmap_clean;
|
||||
|
||||
/**
|
||||
* @brief m_image_indicator Image to be used as new mail indicator.
|
||||
*/
|
||||
QImage m_image_indicator;
|
||||
|
||||
/**
|
||||
* @brief m_default_icon_type. Storage for the default icon type.
|
||||
*/
|
||||
@@ -282,6 +354,11 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
|
||||
*/
|
||||
bool m_show_number;
|
||||
|
||||
/**
|
||||
* @brief m_show_new_indicator. Show the new indicator.
|
||||
*/
|
||||
bool m_show_new_indicator;
|
||||
|
||||
/**
|
||||
* @brief m_number_color. Color of the unread/new mail number.
|
||||
*/
|
||||
@@ -302,6 +379,16 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
|
||||
*/
|
||||
QMargins m_number_margins;
|
||||
|
||||
/**
|
||||
* @brief m_new_indicator_type. The new indicator type.
|
||||
*/
|
||||
Preferences::NewIndicatorType m_new_indicator_type;
|
||||
|
||||
/**
|
||||
* @brief m_new_shade_color. Color of the new shade.
|
||||
*/
|
||||
QString m_new_shade_color;
|
||||
|
||||
/**
|
||||
* @brief m_unread_mail. Storage for the number of unread mails.
|
||||
*/
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
"description": "Tab for Icon options"
|
||||
},
|
||||
|
||||
"tab_count": {
|
||||
"message": "Count",
|
||||
"description": "Tab for Count options"
|
||||
},
|
||||
|
||||
"tab_apps": {
|
||||
"message": "Apps",
|
||||
"description": "Tab for Apps options"
|
||||
@@ -204,11 +209,6 @@
|
||||
"description": "Caption for Number options"
|
||||
},
|
||||
|
||||
"icons_number_display": {
|
||||
"message": "Display unread message count",
|
||||
"description": "Display the number"
|
||||
},
|
||||
|
||||
"icons_number_color": {
|
||||
"message": "Number color:",
|
||||
"description": "Color of the number"
|
||||
@@ -274,21 +274,6 @@
|
||||
"description": "Number margins (left, top, right, bottom)"
|
||||
},
|
||||
|
||||
"icons_number_count_type": {
|
||||
"message": "Message count type:",
|
||||
"description": "Count type options"
|
||||
},
|
||||
|
||||
"icons_number_count_unread": {
|
||||
"message": "Unread",
|
||||
"description": "Count unread mails"
|
||||
},
|
||||
|
||||
"icons_number_count_new": {
|
||||
"message": "New",
|
||||
"description": "Count new mails"
|
||||
},
|
||||
|
||||
"icons_startup_delay": {
|
||||
"message": "Startup delay",
|
||||
"description": "Startup delay"
|
||||
@@ -309,6 +294,40 @@
|
||||
"description": "The dark theme"
|
||||
},
|
||||
|
||||
"count": {
|
||||
"message": "Count",
|
||||
"description": "Title for Count options"
|
||||
},
|
||||
|
||||
"count_number_display": {
|
||||
"message": "Show unread message count",
|
||||
"description": "Show the new message count"
|
||||
},
|
||||
|
||||
"count_new_indicator_display": {
|
||||
"message": "Show new indicator",
|
||||
"description": "Show the new message indicator"
|
||||
},
|
||||
|
||||
|
||||
|
||||
"count_number_count_type": {
|
||||
"message": "Message count type:",
|
||||
"description": "Count type options"
|
||||
},
|
||||
|
||||
"count_number_count_unread": {
|
||||
"message": "Unread",
|
||||
"description": "Count unread mails"
|
||||
},
|
||||
|
||||
"count_number_count_new": {
|
||||
"message": "New",
|
||||
"description": "Count new mails"
|
||||
},
|
||||
|
||||
|
||||
|
||||
"apps": {
|
||||
"message": "Apps",
|
||||
"description": "Title for Apps options"
|
||||
|
||||
@@ -561,6 +561,7 @@ SysTrayX.Messaging = {
|
||||
"iconMime",
|
||||
"icon",
|
||||
"showNumber",
|
||||
"showNewIndicator",
|
||||
"numberColor",
|
||||
"numberSize",
|
||||
"numberAlignment",
|
||||
@@ -594,6 +595,7 @@ SysTrayX.Messaging = {
|
||||
const iconMime = result.iconMime || "image/png";
|
||||
const icon = result.icon || [];
|
||||
const showNumber = result.showNumber || "true";
|
||||
const showNewIndicator = result.showNewIndicator || "true";
|
||||
let numberColor = result.numberColor || "#000000";
|
||||
const numberSize = result.numberSize || "10";
|
||||
const numberAlignment = result.numberAlignment || "4";
|
||||
@@ -634,6 +636,7 @@ SysTrayX.Messaging = {
|
||||
iconMime,
|
||||
icon,
|
||||
showNumber,
|
||||
showNewIndicator,
|
||||
numberColor,
|
||||
numberSize,
|
||||
numberAlignment,
|
||||
@@ -773,6 +776,13 @@ SysTrayX.Link = {
|
||||
});
|
||||
}
|
||||
|
||||
const showNewIndicator = response["preferences"].showNewIndicator;
|
||||
if (showNewIndicator) {
|
||||
await storage().set({
|
||||
showNewIndicator: showNewIndicator,
|
||||
});
|
||||
}
|
||||
|
||||
const numberColor = response["preferences"].numberColor;
|
||||
if (numberColor) {
|
||||
await storage().set({
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<div class="tab">
|
||||
<button class="tablinks active" id="Windows">__MSG_tab_windows__</button>
|
||||
<button class="tablinks" id="Icon">__MSG_tab_icon__</button>
|
||||
<button class="tablinks" id="Count">__MSG_tab_count__</button>
|
||||
<button class="tablinks" id="Apps">__MSG_tab_apps__</button>
|
||||
<button class="tablinks" id="Mail">__MSG_tab_mail__</button>
|
||||
<button class="tablinks" id="Debug">__MSG_tab_debug__</button>
|
||||
@@ -337,19 +338,6 @@
|
||||
<caption>
|
||||
__MSG_icons_number_options__
|
||||
</caption>
|
||||
<tr>
|
||||
<td>
|
||||
<div id="inputcheck">
|
||||
<input type="checkbox" name="showNumber" id="showNo" value="" />
|
||||
<label for="showNo" id="showNumberLabel"
|
||||
>__MSG_icons_number_display__</label
|
||||
>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="numberColor">__MSG_icons_number_color__</label>
|
||||
@@ -443,22 +431,6 @@
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="counttype">
|
||||
<td>
|
||||
<label for="countType">__MSG_icons_number_count_type__</label>
|
||||
<input
|
||||
type="radio"
|
||||
name="countType"
|
||||
id="numberUnread"
|
||||
value="0"
|
||||
/>
|
||||
<label for="numberUnread"
|
||||
>__MSG_icons_number_count_unread__</label
|
||||
>
|
||||
<input type="radio" name="countType" id="numberNew" value="1" />
|
||||
<label for="numberNew">__MSG_icons_number_count_new__</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
@@ -513,6 +485,56 @@
|
||||
<script src="js/options_iconform.js"></script>
|
||||
</div>
|
||||
|
||||
<div id="CountContent" class="tabcontent">
|
||||
<form name="countform">
|
||||
<h3>__MSG_count__</h3>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div id="inputcheck">
|
||||
<input type="checkbox" name="showNumber" id="showNo" value="" />
|
||||
<label for="showNo" id="showNumberLabel"
|
||||
>__MSG_count_number_display__</label
|
||||
>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div id="inputcheck">
|
||||
<input type="checkbox" name="showNewIndicator" id="showNew" value="" />
|
||||
<label for="showNew" id="showNewIndicatorLabel"
|
||||
>__MSG_count_new_indicator_display__</label
|
||||
>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
<tr id="counttype">
|
||||
<td>
|
||||
<label for="countType">__MSG_count_number_count_type__</label>
|
||||
<input
|
||||
type="radio"
|
||||
name="countType"
|
||||
id="numberUnread"
|
||||
value="0"
|
||||
/>
|
||||
<label for="numberUnread"
|
||||
>__MSG_count_number_count_unread__</label
|
||||
>
|
||||
<input type="radio" name="countType" id="numberNew" value="1" />
|
||||
<label for="numberNew">__MSG_count_number_count_new__</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="AppsContent" class="tabcontent">
|
||||
<form name="appsform">
|
||||
<h3>__MSG_apps__</h3>
|
||||
|
||||
@@ -203,7 +203,7 @@ SysTrayX.SaveOptions = {
|
||||
});
|
||||
|
||||
//
|
||||
// Save enable number state
|
||||
// Save show number state
|
||||
//
|
||||
const showNumber = document.querySelector(
|
||||
'input[name="showNumber"]'
|
||||
@@ -212,6 +212,16 @@ SysTrayX.SaveOptions = {
|
||||
showNumber: `${showNumber}`,
|
||||
});
|
||||
|
||||
//
|
||||
// Save show new indicator state
|
||||
//
|
||||
const showNewIndicator = document.querySelector(
|
||||
'input[name="showNewIndicator"]'
|
||||
).checked;
|
||||
await storage().set({
|
||||
showNewIndicator: `${showNewIndicator}`,
|
||||
});
|
||||
|
||||
//
|
||||
// Save theme preferences
|
||||
//
|
||||
@@ -454,7 +464,7 @@ SysTrayX.RestoreOptions = {
|
||||
);
|
||||
|
||||
//
|
||||
// Restore enable number state
|
||||
// Restore show number state
|
||||
//
|
||||
await storage()
|
||||
.get("showNumber")
|
||||
@@ -463,6 +473,16 @@ SysTrayX.RestoreOptions = {
|
||||
SysTrayX.RestoreOptions.onShowNumberError
|
||||
);
|
||||
|
||||
//
|
||||
// Restore show new indicator state
|
||||
//
|
||||
await storage()
|
||||
.get("showNewIndicator")
|
||||
.then(
|
||||
SysTrayX.RestoreOptions.setShowNewIndicator,
|
||||
SysTrayX.RestoreOptions.onShowNewIndicatorError
|
||||
);
|
||||
|
||||
//
|
||||
// Restore number color
|
||||
//
|
||||
@@ -830,7 +850,7 @@ SysTrayX.RestoreOptions = {
|
||||
},
|
||||
|
||||
//
|
||||
// Restore enable number state
|
||||
// Restore show number state
|
||||
//
|
||||
setShowNumber: function (result) {
|
||||
const showNumber = result.showNumber || "true";
|
||||
@@ -843,6 +863,20 @@ SysTrayX.RestoreOptions = {
|
||||
console.log(`showNumber Error: ${error}`);
|
||||
},
|
||||
|
||||
//
|
||||
// Restore show new indicator state
|
||||
//
|
||||
setShowNewIndicator: function (result) {
|
||||
const showNewIndicator = result.showNewIndicator || "true";
|
||||
|
||||
const checkbox = document.querySelector(`input[name="showNewIndicator"]`);
|
||||
checkbox.checked = showNewIndicator === "true";
|
||||
},
|
||||
|
||||
onShowNewIndicatorError: function (error) {
|
||||
console.log(`showNewIndicator Error: ${error}`);
|
||||
},
|
||||
|
||||
//
|
||||
// Restore number color
|
||||
//
|
||||
@@ -1209,6 +1243,11 @@ SysTrayX.StorageChanged = {
|
||||
showNumber: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "showNewIndicator") {
|
||||
SysTrayX.RestoreOptions.setShowNewIndicator({
|
||||
showNewIndicator: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "numberColor") {
|
||||
SysTrayX.RestoreOptions.setNumberColor({
|
||||
numberColor: changes[item].newValue,
|
||||
|
||||
Reference in New Issue
Block a user