Added several improvements, changes and bug fixes

This commit is contained in:
Robert Vokac 2024-03-16 15:33:09 +00:00
parent 30d4ff30a4
commit a95ca6a58d
No known key found for this signature in database
GPG Key ID: 693D30BEE3329055
2 changed files with 13 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
@ -61,8 +62,12 @@ public class ActivityPanel extends JPanel implements Comparable<ActivityPanel> {
add(totalComment);
add(today);
add(remains);
name.setHorizontalAlignment(JTextField.LEFT);
comment.setHorizontalAlignment(JTextField.LEFT);
ticket.setHorizontalAlignment(JTextField.LEFT);
// JButton moveThisButton = new SmallTButton("Move ");
// JButton moveThisButton = new SmallTButton("Move ");
// JButton moveBeforeButton = new SmallTButton("Here");
JButton copyButton = new SmallTButton("Copy");
JButton deleteButton = new SmallTButton("Delete");
@ -241,6 +246,9 @@ public class ActivityPanel extends JPanel implements Comparable<ActivityPanel> {
subject.setText(activity.createSubject());
totalComment.setText(activity.createTotalComment());
sortkey.setText(String.valueOf(activity.getSortkey()));
name.setFont(SwingUtils.VERY_SMALL_FONT);
comment.setFont(SwingUtils.VERY_SMALL_FONT);
ticket.setFont(SwingUtils.VERY_SMALL_FONT);
this.activityRepository = activityRepository;
//this.setBorder(BorderFactory.createLineBorder(Color.ORANGE, 1));
setAlignmentX(LEFT_ALIGNMENT);

View File

@ -214,13 +214,16 @@ public class DayPanel extends JPanel {
double done = 0d;
double todo = 8d;
for(ActivityPanel ap:list) {
panelInsideScrollPane.add(ap);
double now = ap.getActivity().getSpentHours() + ap.getActivity().getSpentMinutes() / 60d;
done = done + now;
todo = todo - now;
ap.today.setText(TTime.ofMilliseconds((int)(done * 60d * 60d * 1000d)).toString().substring(0,5));
ap.remains.setText(TTime.ofMilliseconds((int)(todo * 60d * 60d * 1000d)).toString().substring(0,5));
panelInsideScrollPane.add(ap);
ap.revalidate();
}
revalidate();
}