Commit 27038e00 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix icon size for hdpi support

parent 9ee79666
......@@ -205,7 +205,7 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
// File browse button
mFileBrowseButton = new QPushButton(mFileBox);
fileBoxHLayout->addWidget(mFileBrowseButton);
mFileBrowseButton->setIcon(SmallIcon(QStringLiteral("document-open")));
mFileBrowseButton->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
int size = mFileBrowseButton->sizeHint().height();
mFileBrowseButton->setFixedSize(size, size);
mFileBrowseButton->setToolTip(i18nc("@info:tooltip", "Choose a file"));
......@@ -805,7 +805,7 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
// The file browser dialog is activated by the PickLogFileRadio class.
QPushButton* browseButton = new QPushButton(box);
boxHLayout->addWidget(browseButton);
browseButton->setIcon(SmallIcon(QStringLiteral("document-open")));
browseButton->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
int size = browseButton->sizeHint().height();
browseButton->setFixedSize(size, size);
browseButton->setToolTip(i18nc("@info:tooltip", "Choose a file"));
......@@ -1110,7 +1110,7 @@ void EditEmailAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
grid->addWidget(mEmailToEdit, 1, 1);
mEmailAddressButton = new QPushButton(parent);
mEmailAddressButton->setIcon(SmallIcon(QStringLiteral("help-contents")));
mEmailAddressButton->setIcon(QIcon::fromTheme(QStringLiteral("help-contents")));
int size = mEmailAddressButton->sizeHint().height();
mEmailAddressButton->setFixedSize(size, size);
connect(mEmailAddressButton, &QPushButton::clicked, this, &EditEmailAlarmDlg::openAddressBook);
......
......@@ -1333,7 +1333,7 @@ EditPrefTab::EditPrefTab(StackedScrollGroup* scrollGroup)
mSoundFile = new QLineEdit(box);
mSoundFileLabel->setBuddy(mSoundFile);
mSoundFileBrowse = new QPushButton(box);
mSoundFileBrowse->setIcon(QIcon(SmallIcon(QStringLiteral("document-open"))));
mSoundFileBrowse->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
int size = mSoundFileBrowse->sizeHint().height();
mSoundFileBrowse->setFixedSize(size, size);
connect(mSoundFileBrowse, SIGNAL(clicked()), SLOT(slotBrowseSoundFile()));
......
......@@ -171,7 +171,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
// File play button
mFilePlay = new QPushButton(box);
boxHLayout->addWidget(mFilePlay);
mFilePlay->setIcon(SmallIcon(QStringLiteral("media-playback-start")));
mFilePlay->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-start")));
connect(mFilePlay, &QPushButton::clicked, this, &SoundWidget::playSound);
mFilePlay->setToolTip(i18nc("@info:tooltip", "Test the sound"));
mFilePlay->setWhatsThis(i18nc("@info:whatsthis", "Play the selected sound file."));
......@@ -189,7 +189,7 @@ SoundWidget::SoundWidget(bool showPlay, bool showRepeat, QWidget* parent)
// File browse button
mFileBrowseButton = new PushButton(box);
boxHLayout->addWidget(mFileBrowseButton);
mFileBrowseButton->setIcon(QIcon(SmallIcon(QStringLiteral("document-open"))));
mFileBrowseButton->setIcon(QIcon(QIcon::fromTheme(QStringLiteral("document-open"))));
int size = mFileBrowseButton->sizeHint().height();
mFileBrowseButton->setFixedSize(size, size);
connect(mFileBrowseButton, &PushButton::clicked, this, &SoundWidget::slotPickFile);
......@@ -454,7 +454,7 @@ void SoundWidget::playSound()
Phonon::createPath(mPlayer, output);
#endif
connect(mPlayer, &Phonon::MediaObject::finished, this, &SoundWidget::playFinished);
mFilePlay->setIcon(SmallIcon(QStringLiteral("media-playback-stop"))); // change the play button to a stop button
mFilePlay->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-stop"))); // change the play button to a stop button
mFilePlay->setToolTip(i18nc("@info:tooltip", "Stop sound"));
mFilePlay->setWhatsThis(i18nc("@info:whatsthis", "Stop playing the sound"));
mPlayer->play();
......@@ -467,7 +467,7 @@ void SoundWidget::playFinished()
{
delete mPlayer; // this stops playing if not already stopped
mPlayer = Q_NULLPTR;
mFilePlay->setIcon(SmallIcon(QStringLiteral("media-playback-start")));
mFilePlay->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-start")));
mFilePlay->setToolTip(i18nc("@info:tooltip", "Test the sound"));
mFilePlay->setWhatsThis(i18nc("@info:whatsthis", "Play the selected sound file."));
}
......
......@@ -92,7 +92,7 @@ SoundPicker::SoundPicker(QWidget* parent)
// Sound file picker button
mFilePicker = new PushButton(this);
mFilePicker->setIcon(QIcon(SmallIcon(QStringLiteral("audio-x-generic"))));
mFilePicker->setIcon(QIcon::fromTheme(QStringLiteral("audio-x-generic")));
int size = mFilePicker->sizeHint().height();
mFilePicker->setFixedSize(size, size);
connect(mFilePicker, &PushButton::clicked, this, &SoundPicker::slotPickFile);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment