Added menus to timeline window

This commit is contained in:
Snowyfox 2021-07-17 06:03:59 -04:00
parent 05f09ac9f4
commit 2e094afbf6
2 changed files with 24 additions and 5 deletions

View File

@ -37,6 +37,7 @@ ComposeWindow extends JFrame {
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
display = new ComposeComponent();
setContentPane(display);
}

View File

@ -4,6 +4,9 @@ import javax.swing.JPanel;
import javax.swing.JComponent;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JSeparator;
import javax.swing.Box;
import javax.swing.BorderFactory;
import java.awt.BorderLayout;
@ -44,7 +47,26 @@ TimelineWindow extends JFrame {
pack();
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setContentPane(display = new TimelineComponent());
JMenu programMenu = new JMenu("Program");
programMenu.add("Open home timeline");
programMenu.add("Open messages timeline");
programMenu.add("Open local timeline");
programMenu.add("Open federated timeline");
programMenu.add(new JSeparator());
programMenu.add("Create a post");
programMenu.add("Open auto post view");
programMenu.add(new JSeparator());
programMenu.add("Quit");
JMenu timelineMenu = new JMenu("Timeline");
timelineMenu.add("Flip to newest post");
JMenuBar menuBar = new JMenuBar();
menuBar.add(programMenu);
menuBar.add(timelineMenu);
setJMenuBar(menuBar);
display = new TimelineComponent();
setContentPane(display);
}
}
@ -70,14 +92,10 @@ TimelineComponent extends JPanel {
prev = new JButton("<");
next = new JButton(">");
pageLabel = new JLabel("0 / 0");
Box bottom = Box.createHorizontalBox();
bottom.add(Box.createGlue());
bottom.add(prev);
bottom.add(Box.createHorizontalStrut(8));
bottom.add(pageLabel);
bottom.add(Box.createHorizontalStrut(8));
bottom.add(next);
JPanel centre = new JPanel();