换图标

This commit is contained in:
flykhan 2023-08-31 15:34:05 +08:00
parent de57e166c1
commit 6383a53fbe
2 changed files with 14 additions and 14 deletions

View File

@ -54,7 +54,7 @@ void MainWindow::initMainWindow()
// 设置滑块属性 // 设置滑块属性
ui->time_slider->setStyleSheet("QSlider::groove:horizontal { background-color: white; }" ui->time_slider->setStyleSheet("QSlider::groove:horizontal { background-color: white; }"
"QSlider::handle:horizontal { background-color: blue; width: 20px;}"); "QSlider::handle:horizontal { background-color: yellow; width: 20px;}");
ui->volume_slider->setStyleSheet("QSlider::groove:horizontal { background-color: gray; }" ui->volume_slider->setStyleSheet("QSlider::groove:horizontal { background-color: gray; }"
"QSlider::handle:horizontal { background-color: yellow; width: 20px;}"); "QSlider::handle:horizontal { background-color: yellow; width: 20px;}");
ui->volume_slider->setMinimum(0); // 最小音量 0 ui->volume_slider->setMinimum(0); // 最小音量 0
@ -274,13 +274,13 @@ void MainWindow::on_play_btn_clicked()
{ {
if(play_btn_flag == 0) if(play_btn_flag == 0)
{ {
ui->play_btn->setIcon(QIcon(":/icon/button_play")); ui->play_btn->setIcon(QIcon(":/icon2/pause"));
kill(mplayer_pid,SIGCONT); kill(mplayer_pid,SIGCONT);
play_btn_flag = 1; play_btn_flag = 1;
} }
else if (play_btn_flag == 1) else if (play_btn_flag == 1)
{ {
ui->play_btn->setIcon(QIcon(":/icon/button")); ui->play_btn->setIcon(QIcon(":/icon2/play"));
kill(mplayer_pid,SIGSTOP); kill(mplayer_pid,SIGSTOP);
play_btn_flag = 0; play_btn_flag = 0;
} }
@ -332,14 +332,14 @@ void MainWindow::on_mute_btn_clicked()
{ {
if(mute_flag == 0) // 没静音则按下后设置静音 if(mute_flag == 0) // 没静音则按下后设置静音
{ {
ui->mute_btn->setIcon(QIcon(":/icon/mute1")); ui->mute_btn->setIcon(QIcon(":/icon2/sound-on"));
// volume_mute_switch(1); // volume_mute_switch(1);
// mute_flag = 1; // mute_flag = 1;
volume_mute_switch(++mute_flag); volume_mute_switch(++mute_flag);
} }
else if (mute_flag == 1) // 已静音则按下后取消静音 else if (mute_flag == 1) // 已静音则按下后取消静音
{ {
ui->mute_btn->setIcon(QIcon(":/icon/mute2")); ui->mute_btn->setIcon(QIcon(":/icon2/sound-off"));
volume_mute_switch(--mute_flag); volume_mute_switch(--mute_flag);
} }
} }

View File

@ -138,7 +138,7 @@ color: rgb(255, 255, 0);</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="res.qrc"> <iconset resource="res.qrc">
<normaloff>:/icon/back</normaloff>:/icon/back</iconset> <normaloff>:/icon2/play-previous</normaloff>:/icon2/play-previous</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -155,7 +155,7 @@ color: rgb(255, 255, 0);</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="res.qrc"> <iconset resource="res.qrc">
<normaloff>:/icon/last</normaloff>:/icon/last</iconset> <normaloff>:/icon2/rewind-back</normaloff>:/icon2/rewind-back</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -172,7 +172,7 @@ color: rgb(255, 255, 0);</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="res.qrc"> <iconset resource="res.qrc">
<normaloff>:/icon/button</normaloff>:/icon/button</iconset> <normaloff>:/icon2/play</normaloff>:/icon2/play</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -189,7 +189,7 @@ color: rgb(255, 255, 0);</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="res.qrc"> <iconset resource="res.qrc">
<normaloff>:/icon/next</normaloff>:/icon/next</iconset> <normaloff>:/icon2/rewind-forward</normaloff>:/icon2/rewind-forward</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -206,7 +206,7 @@ color: rgb(255, 255, 0);</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="res.qrc"> <iconset resource="res.qrc">
<normaloff>:/icon/front</normaloff>:/icon/front</iconset> <normaloff>:/icon2/play-next</normaloff>:/icon2/play-next</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -245,7 +245,7 @@ color: rgb(255, 255, 0);</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="res.qrc"> <iconset resource="res.qrc">
<normaloff>:/icon/mute2</normaloff>:/icon/mute2</iconset> <normaloff>:/icon2/sound-off</normaloff>:/icon2/sound-off</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -262,7 +262,7 @@ color: rgb(255, 255, 0);</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="res.qrc"> <iconset resource="res.qrc">
<normaloff>:/icon/volume0</normaloff>:/icon/volume0</iconset> <normaloff>:/icon2/volume-down</normaloff>:/icon2/volume-down</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -279,7 +279,7 @@ color: rgb(255, 255, 0);</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="res.qrc"> <iconset resource="res.qrc">
<normaloff>:/icon/volume1</normaloff>:/icon/volume1</iconset> <normaloff>:/icon2/volume-up</normaloff>:/icon2/volume-up</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -334,7 +334,7 @@ color: rgb(255, 255, 0);</string>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1055</width> <width>1055</width>
<height>25</height> <height>26</height>
</rect> </rect>
</property> </property>
</widget> </widget>