Sidebar Menu updated.

This commit is contained in:
Asal Lotfi
2025-08-03 18:40:12 +03:30
parent 9887b2af42
commit 4fe385b021
4 changed files with 62 additions and 2 deletions
@@ -5,7 +5,6 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.to.telegramfinalproject.Models.Message; import org.to.telegramfinalproject.Models.Message;
import java.sql.Timestamp;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -12,7 +12,7 @@ import java.io.IOException;
public class TelegramApplication extends Application { public class TelegramApplication extends Application {
@Override @Override
public void start(Stage stage) throws IOException { public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(TelegramApplication.class.getResource("/org/to/telegramfinalproject/Intro.fxml")); FXMLLoader fxmlLoader = new FXMLLoader(TelegramApplication.class.getResource("/org/to/telegramfinalproject/sidebar_menu.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 1480, 820); Scene scene = new Scene(fxmlLoader.load(), 1480, 820);
stage.setTitle("Telegram"); stage.setTitle("Telegram");
stage.setScene(scene); stage.setScene(scene);
@@ -0,0 +1,11 @@
.menu-button {
-fx-background-color: transparent;
-fx-text-fill: white;
-fx-font-size: 13px;
-fx-alignment: CENTER_LEFT;
-fx-padding: 6 10 6 10;
}
.menu-button:hover {
-fx-background-color: #2c3e50;
}
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.*?>
<AnchorPane xmlns:fx="http://javafx.com/fxml" fx:controller="org.to.telegramfinalproject.UI.SidebarController"
prefWidth="260" style="-fx-background-color: #1f2a36;">
<VBox spacing="10" AnchorPane.topAnchor="0" AnchorPane.bottomAnchor="0" AnchorPane.leftAnchor="0" AnchorPane.rightAnchor="0">
<!-- Top Profile Section -->
<VBox alignment="CENTER_LEFT" spacing="5" padding="10">
<HBox spacing="10" alignment="CENTER_LEFT">
<ImageView fx:id="profileImage" fitWidth="40" fitHeight="40"/>
<VBox>
<Label fx:id="usernameLabel" text="Asal" textFill="white" style="-fx-font-size: 14px; -fx-font-weight: bold;" />
<Hyperlink fx:id="setEmojiStatus" text="Set Emoji Status" textFill="#5FA6F9" />
</VBox>
</HBox>
</VBox>
<!-- Menu Buttons -->
<VBox spacing="8" padding="10">
<Button fx:id="myProfileButton" text="My Profile" styleClass="menu-button"/>
<Button fx:id="newGroupButton" text="New Group" styleClass="menu-button"/>
<Button fx:id="newChannelButton" text="New Channel" styleClass="menu-button"/>
<Button fx:id="contactsButton" text="Contacts" styleClass="menu-button"/>
<Button fx:id="savedMessagesButton" text="Saved Messages" styleClass="menu-button"/>
<Button fx:id="settingsButton" text="Settings" styleClass="menu-button"/>
<Button fx:id="telegramFeaturesButton" text="Telegram Features" styleClass="menu-button"/>
<Button fx:id="telegramQnAButton" text="Telegram Q&amp;A" styleClass="menu-button"/>
</VBox>
<!-- Spacer -->
<VBox VBox.vgrow="ALWAYS"/>
<!-- Bottom Section: Night Mode & Version -->
<VBox spacing="8" padding="10">
<HBox spacing="10" alignment="CENTER_LEFT">
<Label text="Night Mode" textFill="white" />
<ToggleButton fx:id="nightModeToggle"/>
</HBox>
<VBox spacing="2" alignment="CENTER_LEFT">
<Label text="Telegram Desktop" textFill="#5FA6F9" style="-fx-font-size: 11px;"/>
<Label text="Version 5.16.6 x64 About" textFill="#5FA6F9" style="-fx-font-size: 11px;"/>
</VBox>
</VBox>
</VBox>
</AnchorPane>