Fix battery history

pull/11/head
cutefishd 5 years ago
parent af37a7590b
commit bb841dee9c

@ -0,0 +1,170 @@
<?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:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
version="1.1"
id="svg26"
sodipodi:docname="performance.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
<metadata
id="metadata30">
<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 />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2160"
inkscape:window-height="1247"
id="namedview28"
showgrid="false"
inkscape:zoom="2.8710938"
inkscape:cx="36.499997"
inkscape:cy="22.712089"
inkscape:window-x="0"
inkscape:window-y="35"
inkscape:window-maximized="1"
inkscape:current-layer="svg26"
inkscape:document-rotation="0" />
<defs
id="defs12">
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient862-5"
id="linearGradient914"
x1="0"
y1="32"
x2="64"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient862-5"
x1="7.9373002"
x2="7.9373002"
y1="15.081"
y2="1.852"
gradientTransform="scale(3.7796)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#0e71de"
offset="0"
id="stop2-6" />
<stop
stop-color="#25c9ff"
offset="1"
id="stop4-7" />
</linearGradient>
</defs>
<rect
style="opacity:0.95;fill:url(#linearGradient914);fill-opacity:1.0;stroke:none;stroke-width:1.00157"
id="rect906"
width="64"
height="64"
x="0"
y="0" />
<g
id="g94-0"
transform="matrix(0.16649938,0,0,0.16649938,-53.866346,-13.734628)" />
<g
id="g925"
transform="matrix(1.9952564,0,0,1.9952564,6.960187,9.5730373)">
<g
id="g12"
transform="translate(0.03135961,3.6151407)">
<g
id="g10">
<path
d="m 14.631,14.252 c -0.199,0 -0.391,-0.079 -0.532,-0.221 l -2.313,-2.324 c -0.145,-0.145 -0.223,-0.343 -0.218,-0.548 0.005,-0.205 0.094,-0.398 0.246,-0.536 l 3.724,-3.375 c 0.222,-0.201 0.54,-0.25 0.813,-0.127 0.272,0.124 0.445,0.397 0.44,0.696 -0.036,2.051 -0.19,4.386 -1.571,6.147 -0.132,0.169 -0.332,0.273 -0.546,0.286 -0.013,0.002 -0.028,0.002 -0.043,0.002 z"
fill="#2196f3"
id="path8" />
</g>
</g>
<g
id="g18-3"
transform="translate(0.03135961,3.6151407)">
<g
id="g16">
<path
d="M 8.823,8.433 C 8.625,8.433 8.435,8.355 8.294,8.215 L 5.971,5.902 C 5.818,5.751 5.739,5.541 5.752,5.326 5.765,5.111 5.868,4.913 6.038,4.78 7.8,3.4 10.135,3.245 12.185,3.209 c 0.303,0.025 0.573,0.168 0.696,0.44 0.124,0.272 0.073,0.592 -0.127,0.813 L 9.379,8.187 C 9.241,8.339 9.047,8.428 8.843,8.433 c -0.007,0 -0.013,0 -0.02,0 z"
fill="#2196f3"
id="path14" />
</g>
</g>
<g
id="g24"
transform="translate(0.03135961,3.6151407)">
<g
id="g22">
<path
d="m 5.786,15.251 c -0.196,0 -0.388,-0.077 -0.53,-0.22 -0.195,-0.195 -0.267,-0.481 -0.188,-0.746 0.269,-0.899 0.961,-3.057 1.573,-3.669 0.834,-0.834 2.193,-0.835 3.029,0 0.835,0.836 0.835,2.195 0,3.03 -0.612,0.612 -2.77,1.304 -3.669,1.573 -0.07,0.021 -0.143,0.032 -0.215,0.032 z"
fill="#ff9800"
id="path20" />
</g>
</g>
<g
id="g30"
transform="translate(0.03135961,3.6151407)">
<g
id="g28">
<path
d="m 7.821,7.744 3.315,-3.675 c 2.089,-2.414 5.286,-4.015 8.136,-4.068 0.201,-0.01 0.4,0.076 0.544,0.22 0.144,0.144 0.224,0.341 0.22,0.544 -0.054,2.85 -1.655,6.047 -4.08,8.146 l -3.663,3.306 z"
fill="#eceff1"
id="path26" />
</g>
</g>
<g
id="g36"
transform="translate(0.03135961,3.6151407)">
<g
id="g34">
<path
d="M 11.921,3.214 C 9.927,3.258 7.698,3.45 6.001,4.78 5.832,4.912 5.728,5.111 5.715,5.326 5.703,5.54 5.782,5.75 5.935,5.902 L 7.785,7.744 11.1,4.068 c 0.257,-0.297 0.532,-0.583 0.821,-0.854 z"
fill="#1d83d4"
id="path32" />
</g>
</g>
<g
id="g42"
transform="translate(0.03135961,3.6151407)">
<g
id="g40">
<path
d="m 8.119,9.99 c -0.549,0 -1.097,0.209 -1.514,0.626 -0.612,0.612 -1.304,2.77 -1.573,3.669 -0.079,0.264 -0.007,0.551 0.188,0.746 L 9.635,10.616 C 9.216,10.198 8.668,9.99 8.119,9.99 Z"
fill="#de8400"
id="path38" />
</g>
</g>
<g
id="g48"
transform="translate(0.03135961,3.6151407)">
<g
id="g46">
<path
d="m 19.268,-0.001 c -0.011,0 -0.022,0 -0.032,0.001 C 16.737,0.047 13.972,1.283 11.921,3.214 11.632,3.486 11.358,3.771 11.1,4.069 L 7.785,7.744 10.146,10.105 19.89,0.36 C 19.859,0.31 19.822,0.263 19.78,0.22 19.644,0.083 19.458,-0.001 19.268,-0.001 Z"
fill="#cdd0d2"
id="path44" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.6 KiB

@ -0,0 +1,119 @@
<?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:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
version="1.1"
id="svg26"
sodipodi:docname="powersave.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
<metadata
id="metadata30">
<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 />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2160"
inkscape:window-height="1247"
id="namedview28"
showgrid="false"
inkscape:zoom="5.7421875"
inkscape:cx="53.189968"
inkscape:cy="43.934665"
inkscape:window-x="0"
inkscape:window-y="35"
inkscape:window-maximized="1"
inkscape:current-layer="svg26"
inkscape:document-rotation="0" />
<defs
id="defs12">
<linearGradient
inkscape:collect="always"
xlink:href="#SVGID_1_"
id="linearGradient914"
x1="0"
y1="32"
x2="64"
y2="32"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="SVGID_1_"
gradientUnits="userSpaceOnUse"
x1="256"
x2="256"
y1="512"
y2="0">
<stop
offset="0"
stop-color="#ffedad"
id="stop2" />
<stop
offset="1"
stop-color="#ffffe5"
id="stop4" />
</linearGradient>
<linearGradient
id="SVGID_2_"
gradientUnits="userSpaceOnUse"
x1="256"
x2="256"
y1="407"
y2="105">
<stop
offset="0"
stop-color="#ffde00"
id="stop7" />
<stop
offset="1"
stop-color="#fd5900"
id="stop9" />
</linearGradient>
</defs>
<rect
style="opacity:0.95;fill:url(#linearGradient914);fill-opacity:1.0;stroke:none;stroke-width:1.00157"
id="rect906"
width="64"
height="64"
x="0"
y="0" />
<g
id="g94-0"
transform="matrix(0.16649938,0,0,0.16649938,-53.866346,-13.734628)" />
<g
id="Energy_1_"
transform="matrix(0.09933775,0,0,0.09933775,6.569536,6.569536)">
<g
id="g20">
<g
id="g18">
<path
d="m 405.829,237.134 c -0.607,-4.857 -5.014,-8.336 -9.915,-7.711 -4.866,0.607 -8.318,5.048 -7.711,9.915 0.685,5.465 1.032,11.016 1.032,16.663 0,73.47 -59.765,133.235 -133.235,133.235 -42.024,0 -81.474,-20.119 -106.471,-53.294 h 17.648 c 4.91,0 8.882,-3.973 8.882,-8.883 0,-4.909 -3.973,-8.882 -8.882,-8.882 h -35.53 c -4.909,0 -8.882,3.973 -8.882,8.882 v 35.53 c 0,4.91 3.973,8.882 8.882,8.882 4.91,0 8.882,-3.973 8.882,-8.882 v -9.746 C 168.962,386.62 211.12,407 256,407 c 83.263,0 151,-67.737 151,-151 0,-6.393 -0.399,-12.69 -1.171,-18.866 z m -282.032,35.529 c -0.685,-5.465 -1.032,-11.016 -1.032,-16.663 0,-73.47 59.765,-133.235 133.235,-133.235 42.024,0 81.474,20.119 106.471,53.294 h -17.648 c -4.91,0 -8.882,3.973 -8.882,8.883 0,4.909 3.973,8.882 8.882,8.882 h 35.53 c 4.909,0 8.882,-3.973 8.882,-8.882 v -35.53 c 0,-4.91 -3.973,-8.882 -8.882,-8.882 -4.91,0 -8.882,3.973 -8.882,8.882 v 9.745 C 343.038,125.379 300.88,105 256,105 c -83.263,0 -151,67.736 -151,151 0,6.393 0.399,12.69 1.171,18.866 0.564,4.493 4.389,7.781 8.804,7.781 0.364,0 0.737,-0.026 1.11,-0.069 4.867,-0.607 8.319,-5.049 7.712,-9.915 z m 110.413,88.962 c 3.72,1.885 8.207,0.93 10.851,-2.229 l 88.823,-106.588 c 1.952,-2.351 2.568,-5.542 1.613,-8.448 -0.946,-2.906 -3.322,-5.118 -6.289,-5.855 l -62.437,-15.613 15.605,-62.445 c 1.006,-4.016 -0.902,-8.197 -4.589,-10.071 -3.704,-1.865 -8.188,-0.945 -10.851,2.229 l -88.823,106.588 c -1.952,2.351 -2.568,5.543 -1.613,8.449 0.946,2.906 3.322,5.118 6.289,5.855 l 62.437,15.614 -15.605,62.445 c -1.005,4.015 0.903,8.196 4.589,10.069 z"
fill="url(#SVGID_2_)"
id="path16"
style="fill:url(#SVGID_2_)" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

@ -9,7 +9,7 @@ Item {
height: 150
property int value: 0
property int radius: height * 0.2
property int radius: height * 0.15
property bool enableAnimation: false
Rectangle {

@ -99,7 +99,7 @@ ItemPage {
}
RoundedItem {
visible: history.count
visible: history.count > 2
Label {
text: qsTr("History")
@ -143,7 +143,7 @@ ItemPage {
}
}
yStep: batteryPage.historyType === BatteryHistoryModel.RateType ? 10 : 20
visible: history.count > 1
visible: history.count > 2
}
}

@ -108,6 +108,10 @@ Canvas {
}
}
// The data is empty.
if (point === undefined)
return
c.stroke();
c.strokeStyle = 'rgba(0, 0, 0, 0)';
c.lineTo(point.x, height - yPadding);

@ -0,0 +1,47 @@
import QtQuick 2.4
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import FishUI 1.0 as FishUI
import "../"
ItemPage {
id: control
headerTitle: qsTr("Power")
Scrollable {
anchors.fill: parent
contentHeight: layout.implicitHeight
ColumnLayout {
id: layout
anchors.fill: parent
spacing: FishUI.Units.largeSpacing * 2
RoundedItem {
Label {
text: qsTr("Mode")
color: FishUI.Theme.disabledTextColor
bottomPadding: FishUI.Units.smallSpacing
}
RowLayout {
spacing: FishUI.Units.largeSpacing * 2
IconCheckBox {
source: "qrc:/images/powersave.svg"
text: qsTr("Power Save")
checked: true
}
IconCheckBox {
source: "qrc:/images/performance.svg"
text: qsTr("Performance")
checked: false
}
}
}
}
}
}

@ -92,6 +92,13 @@ Item {
iconSource: "battery.svg"
}
// ListElement {
// title: qsTr("Power")
// name: "power"
// page: "qrc:/qml/Power/main.qml"
// iconSource: "battery.svg"
// }
ListElement {
title: qsTr("About")
name: "about"

@ -87,5 +87,8 @@
<file>qml/NetworkPage/WirelessDetailsDialog.qml</file>
<file>qml/NetworkPage/WiredItem.qml</file>
<file>qml/RoundedItem.qml</file>
<file>images/powersave.svg</file>
<file>images/performance.svg</file>
<file>qml/Power/main.qml</file>
</qresource>
</RCC>

Loading…
Cancel
Save