Some code optimization

This commit is contained in:
RememBerBer 2021-11-26 13:02:10 +08:00
parent ae0c839172
commit bb092027b4
4 changed files with 9 additions and 4 deletions

View File

@ -218,7 +218,7 @@
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Some codes and feature were copied from oshi's demo project."/>
<text value="Some codes and feature were copied from the demo project of oshi."/>
</properties>
</component>
</children>

View File

@ -436,7 +436,7 @@ public class AboutDialog extends JDialog {
iconFontLabel.setText("<html><a href=\"https://www.iconfont.cn/\">iconfont</a></html>");
panel6.add(iconFontLabel, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label6 = new JLabel();
label6.setText("Some codes and feature were copied from oshi's demo project.");
label6.setText("Some codes and feature were copied from the demo project of oshi.");
panel6.add(label6, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel7 = new JPanel();
panel7.setLayout(new GridLayoutManager(1, 1, new Insets(5, 3, 20, 0), -1, -1));

View File

@ -112,11 +112,15 @@ public class PowerSourceForm {
powerPanel.add(spacer2, new GridConstraints(2, 1, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
JLabel label1 = new JLabel();
label1.setHorizontalAlignment(SwingConstants.RIGHT);
label1.setHorizontalTextPosition(SwingConstants.RIGHT);
if (powerSource.isCharging()) {
label1.setHorizontalAlignment(SwingConstants.RIGHT);
label1.setHorizontalTextPosition(SwingConstants.RIGHT);
label1.setIcon(new FlatSVGIcon("icons/Charging.svg"));
label1.setText("Charging");
} else {
label1.setIcon(new FlatSVGIcon("icons/indicator_light.svg"));
label1.setText("Remaining Time: " + formatTimeRemaining(powerSource.getTimeRemainingEstimated()));
}
powerPanel.add(label1, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1637896375042" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5964" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#1afa29" p-id="5965"></path></svg>

After

Width:  |  Height:  |  Size: 475 B