Add no icon preference

This commit is contained in:
Ximi1970
2020-05-27 11:35:10 +02:00
parent e5d6190573
commit cfd7c80afd
5 changed files with 57 additions and 7 deletions

View File

@@ -42,7 +42,8 @@ class Preferences : public QObject
enum IconType {
PREF_BLANK_ICON = 0,
PREF_NEWMAIL_ICON,
PREF_CUSTOM_ICON
PREF_CUSTOM_ICON,
PREF_NO_ICON
};
/*

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>495</width>
<height>540</height>
<width>525</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
@@ -275,6 +275,33 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QRadioButton" name="noIconRadioButton">
<property name="text">
<string>No icon</string>
</property>
<attribute name="buttonGroup">
<string notr="true">iconTypeGroup</string>
</attribute>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
@@ -457,9 +484,9 @@
</connection>
</connections>
<buttongroups>
<buttongroup name="defaultIconTypeGroup"/>
<buttongroup name="minimizeTypeGroup"/>
<buttongroup name="iconTypeGroup"/>
<buttongroup name="countTypeGroup"/>
<buttongroup name="minimizeTypeGroup"/>
<buttongroup name="defaultIconTypeGroup"/>
<buttongroup name="iconTypeGroup"/>
</buttongroups>
</ui>

View File

@@ -50,6 +50,7 @@ PreferencesDialog::PreferencesDialog( SysTrayXLink *link, Preferences *pref, QWi
m_ui->iconTypeGroup->setId( m_ui->blankRadioButton, Preferences::PREF_BLANK_ICON );
m_ui->iconTypeGroup->setId( m_ui->newMailButton, Preferences::PREF_NEWMAIL_ICON );
m_ui->iconTypeGroup->setId( m_ui->customRadioButton, Preferences::PREF_CUSTOM_ICON );
m_ui->iconTypeGroup->setId( m_ui->noIconRadioButton, Preferences::PREF_NO_ICON );
/*
* Set count type button Ids

View File

@@ -234,6 +234,8 @@ void SysTrayXIcon::renderIcon()
{
QPixmap pixmap;
m_unread_mail = 9;
if( m_unread_mail > 0 )
{
switch( m_icon_type )
@@ -256,6 +258,14 @@ void SysTrayXIcon::renderIcon()
pixmap.loadFromData( m_icon_data );
break;
}
case Preferences::PREF_NO_ICON:
{
QPixmap lookthrough( 256, 256 );
lookthrough.fill( Qt::transparent );
pixmap = lookthrough;
break;
}
}
}
else

View File

@@ -163,6 +163,9 @@
&emsp;
</td>
</tr>
<tr>
<td><input type="radio" name="iconType" value="3" /> No icon</td>
</tr>
</table>
<table id="numberprops">
@@ -195,7 +198,15 @@
<tr>
<td>
<label for="numberSize">Number size:</label>
<input type="number" name="numberSize" value="0" min="1" max="999" step="1" size="3" />
<input
type="number"
name="numberSize"
value="0"
min="1"
max="999"
step="1"
size="3"
/>
</td>
</tr>
</table>