mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-03 01:42:20 +08:00
新增刷新按钮(和WebEngineView的右键菜单并存)
This commit is contained in:
parent
bd8f660fe9
commit
c9c0357646
@ -30,6 +30,8 @@
|
||||
<file>icons/homepage_dark.svg</file>
|
||||
<file>icons/category_active_dark.svg</file>
|
||||
<file>icons/category_active.svg</file>
|
||||
<file>icons/refresh-page-dark.svg</file>
|
||||
<file>icons/refresh-page.svg</file>
|
||||
</qresource>
|
||||
<qresource prefix="/">
|
||||
<file>Logo-Spark.png</file>
|
||||
|
54
icons/refresh-page-dark.svg
Normal file
54
icons/refresh-page-dark.svg
Normal file
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
||||
height="16"
|
||||
width="16"
|
||||
sodipodi:docname="refresh-page-dark.svg"
|
||||
xml:space="preserve"
|
||||
viewBox="0 0 16 16"
|
||||
y="0px"
|
||||
x="0px"
|
||||
id="Layer_1"
|
||||
version="1.1"><metadata
|
||||
id="metadata9"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs7" /><sodipodi:namedview
|
||||
inkscape:current-layer="Layer_1"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-x="0"
|
||||
inkscape:cy="8.8351119"
|
||||
inkscape:cx="12.452215"
|
||||
inkscape:zoom="34.711876"
|
||||
showgrid="true"
|
||||
id="namedview5"
|
||||
inkscape:window-height="958"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0"
|
||||
guidetolerance="10"
|
||||
gridtolerance="10"
|
||||
objecttolerance="10"
|
||||
borderopacity="1"
|
||||
bordercolor="#666666"
|
||||
pagecolor="#ffffff"><inkscape:grid
|
||||
id="grid834"
|
||||
type="xygrid" /></sodipodi:namedview>
|
||||
<g
|
||||
style="fill:#ffffff;fill-opacity:0.60000002"
|
||||
transform="scale(0.03125,0.0312082)"
|
||||
id="XMLID_2_">
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:0.60000002"
|
||||
d="M 436.6,75.4 C 390.1,28.9 326.7,0 256,0 114.5,0 0,114.5 0,256 0,397.5 114.5,512 256,512 375.2,512 474.8,430.1 503.6,320.2 h -67 C 410.5,394.7 339.8,447.7 256,447.7 149.9,447.7 64.2,362.1 64.2,255.9 64.2,149.7 149.9,64.2 256,64.2 c 53.1,0 100.5,22.3 135,56.8 L 287.7,224.3 H 512 V 0 Z"
|
||||
id="XMLID_4_" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
52
icons/refresh-page.svg
Normal file
52
icons/refresh-page.svg
Normal file
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
||||
height="16"
|
||||
width="16"
|
||||
sodipodi:docname="refresh-page.svg"
|
||||
xml:space="preserve"
|
||||
viewBox="0 0 16 16"
|
||||
y="0px"
|
||||
x="0px"
|
||||
id="Layer_1"
|
||||
version="1.1"><metadata
|
||||
id="metadata9"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs7" /><sodipodi:namedview
|
||||
inkscape:current-layer="Layer_1"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-x="0"
|
||||
inkscape:cy="8.8351119"
|
||||
inkscape:cx="12.452215"
|
||||
inkscape:zoom="34.711876"
|
||||
showgrid="true"
|
||||
id="namedview5"
|
||||
inkscape:window-height="958"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0"
|
||||
guidetolerance="10"
|
||||
gridtolerance="10"
|
||||
objecttolerance="10"
|
||||
borderopacity="1"
|
||||
bordercolor="#666666"
|
||||
pagecolor="#ffffff"><inkscape:grid
|
||||
id="grid834"
|
||||
type="xygrid" /></sodipodi:namedview>
|
||||
<g
|
||||
transform="scale(0.03125,0.0312082)"
|
||||
id="XMLID_2_">
|
||||
<path
|
||||
d="M 436.6,75.4 C 390.1,28.9 326.7,0 256,0 114.5,0 0,114.5 0,256 0,397.5 114.5,512 256,512 375.2,512 474.8,430.1 503.6,320.2 h -67 C 410.5,394.7 339.8,447.7 256,447.7 149.9,447.7 64.2,362.1 64.2,255.9 64.2,149.7 149.9,64.2 256,64.2 c 53.1,0 100.5,22.3 135,56.8 L 287.7,224.3 H 512 V 0 Z"
|
||||
id="XMLID_4_" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.8 KiB |
10
widget.cpp
10
widget.cpp
@ -263,6 +263,7 @@ void Widget::setTheme(bool isDark,QColor color)
|
||||
// ui->scrollArea->setStyleSheet("background-color:#252525");
|
||||
ui->label_show->setStyleSheet("background-color:#252525");
|
||||
ui->pushButton_return->setIcon(QIcon(":/icons/icons/category_active_dark.svg"));
|
||||
ui->pushButton_refresh->setIcon(QIcon(":/icons/icons/refresh-page-dark.svg"));
|
||||
}else {
|
||||
// 亮色模式
|
||||
themeIsDark=false;
|
||||
@ -273,6 +274,7 @@ void Widget::setTheme(bool isDark,QColor color)
|
||||
// ui->scrollArea->setStyleSheet("background-color:#F8F8F8");
|
||||
ui->label_show->setStyleSheet("background-color:#F8F8F8");
|
||||
ui->pushButton_return->setIcon(QIcon(":/icons/icons/category_active.svg"));
|
||||
ui->pushButton_refresh->setIcon(QIcon(":/icons/icons/refresh-page.svg"));
|
||||
}
|
||||
main_color=color;
|
||||
m_loadweb->setTheme(themeIsDark,color);
|
||||
@ -713,6 +715,14 @@ void Widget::on_pushButton_return_clicked()
|
||||
// }
|
||||
}
|
||||
|
||||
void Widget::on_pushButton_refresh_clicked()
|
||||
{
|
||||
if(ui->stackedWidget->currentIndex() == 2) //如果在详情页面要重新触发UrlChanged
|
||||
emit ui->webEngineView->urlChanged(ui->webEngineView->url());
|
||||
else
|
||||
ui->webEngineView->reload();
|
||||
}
|
||||
|
||||
void Widget::on_comboBox_server_currentIndexChanged(const QString &arg1)
|
||||
{
|
||||
if(configCanSave){
|
||||
|
4
widget.h
4
widget.h
@ -75,7 +75,9 @@ private slots:
|
||||
|
||||
void on_webEngineView_loadFinished(bool arg1);
|
||||
|
||||
public:
|
||||
void on_pushButton_refresh_clicked();
|
||||
|
||||
public:
|
||||
|
||||
QUrl url;
|
||||
|
||||
|
82
widget.ui
82
widget.ui
@ -61,35 +61,35 @@
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item row="6" column="0" colspan="5">
|
||||
<item row="6" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_video">
|
||||
<property name="text">
|
||||
<string>视频播放</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="0" colspan="5">
|
||||
<item row="16" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_download">
|
||||
<property name="text">
|
||||
<string>下载列表</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0" colspan="5">
|
||||
<item row="12" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_system">
|
||||
<property name="text">
|
||||
<string>系统工具</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0" colspan="5">
|
||||
<item row="13" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_theme">
|
||||
<property name="text">
|
||||
<string>主题美化</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="5">
|
||||
<item row="5" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_music">
|
||||
<property name="text">
|
||||
<string>音乐欣赏</string>
|
||||
@ -131,7 +131,7 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<item row="0" column="5">
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@ -147,14 +147,21 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="5">
|
||||
<item row="11" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_dev">
|
||||
<property name="text">
|
||||
<string>编程开发</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<item row="9" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_office">
|
||||
<property name="text">
|
||||
<string>办公学习</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="pushButton_return">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@ -162,6 +169,9 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>回到分类</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
@ -171,13 +181,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0" colspan="5">
|
||||
<widget class="QPushButton" name="menu_office">
|
||||
<property name="text">
|
||||
<string>办公学习</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
@ -191,21 +194,21 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="5">
|
||||
<item row="10" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_read">
|
||||
<property name="text">
|
||||
<string>阅读翻译</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0" colspan="5">
|
||||
<item row="14" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_other">
|
||||
<property name="text">
|
||||
<string>其他应用</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="5">
|
||||
<item row="2" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_main">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
@ -215,35 +218,35 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="5">
|
||||
<item row="7" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_photo">
|
||||
<property name="text">
|
||||
<string>图形图像</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="5">
|
||||
<item row="8" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_game">
|
||||
<property name="text">
|
||||
<string>游戏娱乐</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="5">
|
||||
<item row="4" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_chat">
|
||||
<property name="text">
|
||||
<string>社交沟通</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="5">
|
||||
<item row="3" column="0" colspan="6">
|
||||
<widget class="QPushButton" name="menu_network">
|
||||
<property name="text">
|
||||
<string>网络应用</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="0" colspan="5">
|
||||
<item row="15" column="0" colspan="6">
|
||||
<widget class="QWidget" name="line1_widget" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@ -275,6 +278,26 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="pushButton_refresh">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>重新加载</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/icons/refresh-page.svg</normaloff>:/icons/icons/refresh-page.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -287,7 +310,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
@ -308,6 +331,9 @@
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWebEngineView" name="webEngineView">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::DefaultContextMenu</enum>
|
||||
</property>
|
||||
<property name="url">
|
||||
<url>
|
||||
<string>about:blank</string>
|
||||
@ -428,7 +454,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>889</width>
|
||||
<width>470</width>
|
||||
<height>854</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -868,8 +894,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>851</width>
|
||||
<height>323</height>
|
||||
<width>98</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
@ -999,7 +1025,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>692</width>
|
||||
<height>994</height>
|
||||
<height>836</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_23">
|
||||
|
Loading…
x
Reference in New Issue
Block a user